golangci-lint/test/testdata/gocyclo.go

18 lines
486 B
Go
Raw Normal View History

//args: -Egocyclo
//config: linters-settings.gocyclo.min-complexity=20
2018-05-06 15:24:45 +03:00
package testdata
func GocycloBigComplexity(s string) { // ERROR "cyclomatic complexity .* of func .* is high .*"
if s == "1" || s == "2" || s == "3" || s == "4" || s == "5" || s == "6" || s == "7" {
2018-05-06 15:24:45 +03:00
return
}
if s == "1" || s == "2" || s == "3" || s == "4" || s == "5" || s == "6" || s == "7" {
2018-05-06 15:24:45 +03:00
return
}
if s == "1" || s == "2" || s == "3" || s == "4" || s == "5" || s == "6" || s == "7" {
2018-05-06 15:24:45 +03:00
return
}
}