Pattern: Use of magic number
Issue: -
Suggests using constant for magic numbers and string literals.
maxLitCount
: (string) maximum number of instances of a string literal that are tolerated before warn.allowStr
: (string) comma-separated list of allowed string literalsallowInts
: (string) comma-separated list of allowed integersallowFloats
: (string) comma-separated list of allowed floats
[rule.add-constant]
arguments = [{maxLitCount = "3",allowStrs ="\"\"",allowInts="0,1,2",allowFloats="0.0,0.,1.0,1.,2.0,2."}]