Details
Description
Original thread for the ML: http://sonarqube.15.x6.nabble.com/squid-S109-Magic-Numbers-ignore-2-td5035346.html
The rule S109 deprecates rules MagicNumber from CheckStyle and AvoidLiteralsInIfCondition from PMD. However, the current implementation is too sensitive regarding Checkstyle's version and not enough strict regarding PMD's version.
Authorized values by implementation:
- Java plugin S109: -1, 0, 1
- CheckStyle MagicNumber: -1, 0, 1, 2
- PMD AvoidLiteralsInIfCondition: -1, 0
In order to stay coherent, a parameter allowing to manage authorized values should be added to the rule, with default value being -1,0,1
Attachments
Issue Links
- implements
-
RSPEC-109 Magic numbers should not be used
- Active
- relates to
-
SONARJAVA-1235 S109 should not consider as magic number final (but not static) fields with initialization
-
- Closed
-