saveourtool / diktat

Strict coding standard for Kotlin and a custom set of rules for detecting code smells, code style issues and bugs
https://diktat.saveourtool.com
MIT License
544 stars 39 forks source link

Fixed `MAGIC_NUMBER` #1883

Closed DrAlexD closed 11 months ago

DrAlexD commented 11 months ago

What's done:

Closes #1826

codecov[bot] commented 11 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (0063c8b) 78.33% compared to head (7a3b256) 78.30%.

Files Patch % Lines
...l/diktat/ruleset/rules/chapter3/MagicNumberRule.kt 76.92% 0 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1883 +/- ## ============================================ - Coverage 78.33% 78.30% -0.03% - Complexity 2458 2465 +7 ============================================ Files 134 134 Lines 8696 8699 +3 Branches 2201 2202 +1 ============================================ Hits 6812 6812 Misses 905 905 - Partials 979 982 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 11 months ago

JUnit Tests (macOS, EnricoMi/publish-unit-test-result-action@v2)

   166 files  ±0     166 suites  ±0   6m 4s :stopwatch: + 2m 4s 1 430 tests +4  1 392 :heavy_check_mark: +4  38 :zzz: ±0  0 :x: ±0  2 809 runs  +4  2 771 :heavy_check_mark: +4  38 :zzz: ±0  0 :x: ±0 

Results for commit 7a3b2569. ± Comparison against base commit 0063c8ba.

This pull request removes 7 and adds 11 tests. Note that renamed tests count towards both. ``` com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check all param in config true() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore numbers in test(Path) com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore top level constants() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check value parameter in function with config() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check value parameter with config() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check value parameter() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ simple check() ``` ``` com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check all() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore companion object property declaration() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore constant declaration() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore enums() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore extension functions() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore hash code function() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore local variable declaration() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore pairs created using 'to'() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore property declaration() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore ranges() … ```

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 11 months ago

JUnit Tests (Windows, EnricoMi/publish-unit-test-result-action@v2)

   166 files  ±0     166 suites  ±0   7m 6s :stopwatch: -26s 1 430 tests +4  1 413 :heavy_check_mark: +4  17 :zzz: ±0  0 :x: ±0  2 809 runs  +4  2 792 :heavy_check_mark: +4  17 :zzz: ±0  0 :x: ±0 

Results for commit 7a3b2569. ± Comparison against base commit 0063c8ba.

This pull request removes 7 and adds 11 tests. Note that renamed tests count towards both. ``` com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check all param in config true() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore numbers in test(Path) com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore top level constants() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check value parameter in function with config() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check value parameter with config() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check value parameter() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ simple check() ``` ``` com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check all() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore companion object property declaration() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore constant declaration() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore enums() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore extension functions() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore hash code function() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore local variable declaration() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore pairs created using 'to'() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore property declaration() com.saveourtool.diktat.ruleset.chapter3.MagicNumberRuleWarnTest ‑ check ignore ranges() … ```

:recycle: This comment has been updated with latest results.