Skip to content
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

JS-255 Restore cognitive complexity calculation at file level #4833

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yassin-kammoun-sonarsource
Copy link
Contributor

@yassin-kammoun-sonarsource yassin-kammoun-sonarsource commented Sep 19, 2024

The complexity calculation at file level is restored to its previous state the SonarJS ESLint plugin before this change. However, when the rule is activated for cognitive complexity at the function level, the new behavior for a nesting function that does not account for its nested function's complexity is preserved. The RSPEC of the rule was also slightly improved.

It might not be obvious to review this PR. I think that the changes on the unit test assertions and the absence of changes in the ruling is proof enough that everything is working as it should. Therefore, reviewing those might be enough.

Last but not least, I think the rule should be implemented from scratch as it's becoming quite difficult to understand what it actually does. However, I suggest we postpone this to later and create a ticket for this.

Copy link

sonarqube-next bot commented Sep 19, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant