-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Code quality: Detekt update #11976
base: master
Are you sure you want to change the base?
Code quality: Detekt update #11976
Conversation
Oh my I inverted all the kotlin.preconditions.check thingies... Later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look like good changes with it without detekt
I'm not sure if I do want to keep it tbh, it's annoying and not super helpful
Some are, some are a bit fuzzy, but worth a thought. Take it as you wish - simply merging would probably provoke a bunch of conflicts in other PR's, or take them one by one in little steps...
As check running with every single push it's overkill, methinks too - mainly because we don't get the actual report in readable form out of it. We could, however, make running it locally easier with some shell scripts, then once in a while use it to reduce code smells. OR - we could include the run as is, make it nonfatal & run only for releases, but push the report into the repo so it's always current - per release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ready for this if you are
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Do we even want to maintain detekt? If yes, this would be a step.
@Suppress
; not-so-nice: it doesn't respect the same suppression keywords as Studio inspections.Warnings left after this PR
detekt
Metrics
12,453 number of properties
6,469 number of functions
2,886 number of classes
89 number of packages
649 number of kt files
Complexity Report
124,516 lines of code (loc)
92,378 source lines of code (sloc)
71,380 logical lines of code (lloc)
16,826 comment lines of code (cloc)
24,088 cyclomatic complexity (mcc)
19,599 cognitive complexity
25 number of total code smells
18% comment source ratio
337 mcc per 1,000 lloc
0 code smells per 1,000 lloc
Findings (25)
complexity, CyclomaticComplexMethod (9)
Prefer splitting up complex methods into smaller, easier to test methods.
Documentation
complexity, LargeClass (7)
One class should have one responsibility. Large classes tend to handle many things at once. Split up large classes into smaller classes that are easier to understand.
Documentation
complexity, NestedBlockDepth (1)
Excessive nesting leads to hidden complexity. Prefer extracting code to make it easier to understand.
Documentation
naming, MemberNameEqualsClassName (2)
A member should not be given the same name as its parent class or object.
Documentation
naming, TopLevelPropertyNaming (2)
Top level property names should follow the naming convention set in the projects configuration.
Documentation
naming, VariableNaming (1)
Variable names should follow the naming convention set in the projects configuration.
Documentation
style, UnusedPrivateClass (1)
Private class is unused and should be removed.
Documentation
style, UnusedPrivateProperty (2)
Property is unused and should be removed.
Documentation
generated with detekt version 1.23.6 on 2024-07-17 12:43:48 UTC
Each of these remaining has a relatively simple reason it's not treated right away here. Go ahead and Ask.