Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@arturbosch
Copy link
Member

@arturbosch arturbosch commented May 24, 2020

detekt_complexity

I've noticed that adding one additional project metric to the complexity can be quite challenging - adding many small changes to many files (Shotgun Surgery) and it can't be extended by users.
I think we have here an opportunity for a more generic approach which is out of scope for this but may be an idea for #2680.

@arturbosch arturbosch added this to the 1.10.0 milestone May 24, 2020
@codecov
Copy link

codecov bot commented May 24, 2020

Codecov Report

Merging #2727 into master will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2727      +/-   ##
============================================
+ Coverage     80.58%   80.63%   +0.04%     
- Complexity     2317     2321       +4     
============================================
  Files           379      380       +1     
  Lines          6960     6971      +11     
  Branches       1260     1259       -1     
============================================
+ Hits           5609     5621      +12     
  Misses          724      724              
+ Partials        627      626       -1     
Impacted Files Coverage Δ Complexity Δ
.../arturbosch/detekt/cli/console/ComplexityMetric.kt 100.00% <100.00%> (ø) 8.00 <1.00> (+1.00)
...ch/detekt/cli/console/ComplexityReportGenerator.kt 92.59% <100.00%> (+5.63%) 9.00 <0.00> (ø)
...in/io/github/detekt/metrics/CognitiveComplexity.kt 89.55% <100.00%> (+0.15%) 2.00 <1.00> (ø)
.../processors/ProjectCognitiveComplexityProcessor.kt 100.00% <100.00%> (ø) 3.00 <3.00> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56abbea...cfe3245. Read the comment docs.

Copy link
Member

@schalkms schalkms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding many small changes to many files

I'm counting 5 files that were changed in the production code. IMHO this is not too bad.

}
}

private class MetricResults : Detektion {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's already a suitable test overload for Detektion in the codebase.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is!
It's a bit unfortunately here, but I do no want to depend on detekt-test.
This duplication can be merged after we clean up the api a bit.

@arturbosch arturbosch merged commit 4e65b86 into master May 25, 2020
@arturbosch arturbosch deleted the cognitive-complexity-in-report branch May 25, 2020 10:21
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.

3 participants