mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
test: add default case when no arguments provided to a rule (#1140)
This commit is contained in:
13
testdata/cognitive_complexity_default.go
vendored
Normal file
13
testdata/cognitive_complexity_default.go
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
package pkg
|
||||
|
||||
func l() { // MATCH /function l has cognitive complexity 8 (> max enabled 7)/
|
||||
for i := 1; i <= max; i++ {
|
||||
for j := 2; j < i; j++ {
|
||||
if (i%j == 0) || (i%j == 1) {
|
||||
continue
|
||||
}
|
||||
total += i
|
||||
}
|
||||
}
|
||||
return total && max
|
||||
}
|
||||
Reference in New Issue
Block a user