Affects PMD Version: 6.54.0 and 7.0.0-rc1
Description:
When using the CognitiveComplexity rule for Java in PMD 6.54.0, the RuleViolation returns the line range covering the entire method, from the start to the end (e.g., 3-7 in the provided example). However, when using PMD 7.0.0-rc1, it only returns the line number of the method signature (e.g., 3-3 in the provided example).
Code Sample demonstrating the issue:
public class Example { public void sampleMethod() { // Line 3 if (true) { System.out.println("Hello, world!"); } } // Line 7 }
Steps to reproduce:
Please provide detailed steps for how we can reproduce the bug.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4