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

Inline Cases enum and inline other external test code into the test classes #6107

Merged
merged 17 commits into from
May 20, 2023

Conversation

TWiStErRob
Copy link
Member

More changes related to #1089 cc @vanniktech @schalkms

I wanted to work on LoopWithTooManyJumpStatements and then noticed the Cases enum and the comment on it. I wanted some relaxing activity to rest anyway, so I moved all the files into code blocks like in newer tests. Then I went ahead by looking at other resourceAsPath, and there were some without an enum declaration too, so moved them as well.

I deliberately did not make significant changes like splitting up the code blocks into N tests, because that would be much harder to review. Babysteps.

Tried to make no modifications other than copy-paste, few exceptions:

  • rename variable/field names that host the code
  • remove package cases declarations
  • remove unnecessary suppressions
  • remove a few empty lines to make the codes more compact
  • real changes are towards he end of the commit list

Tip: for review I recommend using IDEA, commit by commit + use the "right click in any code editor > Compare with clipboard" feature to compare deleted files (copy to clipboard) with added code blocks.

TWiStErRob added 17 commits May 18, 2023 10:24
…med to thresholdInClasses.

Also simplify test code.
LargeClassSpec.kt:15:9: The function `should detect only the nested large class which exceeds threshold 70` is too long (107). The maximum length is 60. [LongMethod]

NestedBlockDepthSpec.kt:18:9: The function `should detect only the nested large class` is too long (108). The maximum length is 60. [LongMethod]

EmptyCodeSpec.kt:156:13: The function `test` is too long (61). The maximum length is 60. [LongMethod]

UtilityClassWithPublicConstructorSpec.kt:99:13: The function does not report given classes is too long (110). The maximum length is 60. [LongMethod]
@TWiStErRob TWiStErRob added the housekeeping Marker for housekeeping tasks and refactorings label May 18, 2023
@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #6107 (36c15c4) into main (01fa957) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main    #6107   +/-   ##
=========================================
  Coverage     84.86%   84.86%           
  Complexity     4011     4011           
=========================================
  Files           568      568           
  Lines         13422    13422           
  Branches       2368     2368           
=========================================
  Hits          11390    11390           
  Misses          871      871           
  Partials       1161     1161           

@vanniktech
Copy link
Contributor

Thanks for linking me, but I've stopped using Detekt, so please feel free to continue this in any direction you'd want.

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.

Thanks for doing this tedious work! I like!

Copy link
Member

@cortinico cortinico left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup @TWiStErRob

@cortinico cortinico merged commit 93de544 into detekt:main May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core housekeeping Marker for housekeeping tasks and refactorings rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants