Closed maclav3 closed 6 years ago
The current regex for gocyclo does not match methods, only functions. Here I propose a regex that matches the following:
gocyclo
Foo() (currently supported) (Foo).Bar() (*Foo).Bar() (foo *Foo).Bar()
Foo()
(Foo).Bar()
(*Foo).Bar()
(foo *Foo).Bar()
AFAIK, gocyclo doesn't generate the last example, but I included it just to be safe.
Also, I replaced the hardcoded 10, in case someone configures gocyclo with a different threshold.
10
Sorry, just realized that I should rather propose this for the maintenance branch. Will open another PR.
maintenance
The current regex for
gocyclo
does not match methods, only functions. Here I propose a regex that matches the following:Foo()
(currently supported)(Foo).Bar()
(*Foo).Bar()
(foo *Foo).Bar()
AFAIK, gocyclo doesn't generate the last example, but I included it just to be safe.
Also, I replaced the hardcoded
10
, in case someone configuresgocyclo
with a different threshold.