-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cyclomatic Complexity rule yields multiple messages for same scope #559
Comments
I have a fix for this, I've just got to clean it up and write an accompanying test; I will generate a PR when that is ready. |
davidtgillard
added a commit
to davidtgillard/FSharpLint
that referenced
this issue
Oct 28, 2022
- Issue fsprojects#559: fix for cyclomatic complexity rule yielding multiple messages for same scope - Added tests for this case
davidtgillard
added a commit
to davidtgillard/FSharpLint
that referenced
this issue
Oct 28, 2022
- Issue fsprojects#559: fix for cyclomatic complexity rule yielding multiple messages for same scope - Added tests for this case
davidtgillard
added a commit
to davidtgillard/FSharpLint
that referenced
this issue
Oct 28, 2022
- Issue fsprojects#559: fix for cyclomatic complexity rule yielding multiple messages for same scope - Added tests for this case
knocte
pushed a commit
that referenced
this issue
Oct 30, 2022
- Issue #559: fix for cyclomatic complexity rule yielding multiple messages for same scope - Added tests for this case
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Under particular circumstances, the present implementation of the Cyclomatic Complexity rule FL0071 will necessarily generate multiple messages when the complexity exceeds the configurable maximum.
Repro steps
As an example: running the linter on the following snippet of code with a
maxComplexity
of 5 yields the output below.snippet:
output:
...and so on.
Expected behavior
Only one message should be reported, indicating the highest cyclomatic complexity (31 in the example above).
Actual behavior
See above.
Known workarounds
The linter is still usable in its current state, but the over-reporting of messages is confusing and annoying.
Related information
The cause of the issue is that the
runner
in theCyclomaticComplexity
module is issuing a warning for all bindings pushed off the stack when the binding is advanced, even if the start of the binding is the same. It should cut these down to only those with the maximum cyclomatic complexity.The text was updated successfully, but these errors were encountered: