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

Update S3776: "Cognitive Complexity" should provide values for remediation function and cost #1112

Closed
Errrric opened this issue Jan 26, 2018 · 2 comments
Assignees
Labels
Type: Bug Exceptions and blocking issues during analysis.
Milestone

Comments

@Errrric
Copy link

Errrric commented Jan 26, 2018

Hello,
I just started to use your great plugin to review my code, however i just encountered an issue that think would be nice to fix.

Description

The cognitive complexity rule "Cognitive Complexity of methods should not be too high" trigger issues, but do not increase technical debt. There is not remediation cost formula associated with the rule.

Repro steps

  1. Step A
    Activate the "Cognitive Complexity of methods should not be too high" rule if necessary.
    Create a complex method ( or lower the rule threshold ) in order to create a violation in a code sample.

  2. Step B
    Analyse it. And you'll see an issue, but no increase of the technical debt in the SonarQube App

Expected behavior

There should be an effort associated with the issue

Actual behavior

No cost increase.

Known workarounds

None

Related information

SonarC# Version6.7.1 (build 4347)
SonarQube Scanner for MSBuild 4.0
Microsoft (R) Build Engine version 15.5.180.51428

Thanks for your work.

Regards

Eric A

@valhristov
Copy link
Contributor

Hi @Errrric, thanks for the feedback, we will fix this in the next release of SonarC# in a few weeks. The fix will not be perfect though, because for technical reasons SonarC# supports only Constant remediation functions. I override the function in RSPEC to Constant/10min (it could vary depending on the complexity, but that's what the other functions are).

@valhristov valhristov added Type: Bug Exceptions and blocking issues during analysis. Area: Rules labels Jan 26, 2018
@valhristov valhristov added this to the 6.8 milestone Jan 26, 2018
@valhristov valhristov changed the title Cognitive Complexity issues do not increase technical debt Update S3776: "Cognitive Complexity" should provide values for remediation function and cost Jan 26, 2018
@Errrric
Copy link
Author

Errrric commented Jan 26, 2018

Thanks for your quick answer and your support !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Exceptions and blocking issues during analysis.
Projects
None yet
Development

No branches or pull requests

3 participants