fzipp / gocyclo

Calculate cyclomatic complexities of functions in Go source code.
BSD 3-Clause "New" or "Revised" License
1.33k stars 81 forks source link

function literals not separately counted #16

Open paulbuis opened 7 years ago

paulbuis commented 7 years ago

It would be nice if function literals were assigned a complexity separate from the function declaration they were nested inside. This will require giving the nested function literals pseudo-names. E.g., the second function literal nested inside func Foo, might given pseudo name like "Foo.funcLit#2". It might also require using a map[string]stat rather than a []stat and indexing the map with a concatenation of package path with the function name.

fzipp commented 2 years ago

I agree that they should be counted separately. If someone wants to provide a PR I will review it.