terryyin / lizard

A simple code complexity analyser without caring about the C/C++ header files or Java imports, supports most of the popular languages.
Other
1.82k stars 248 forks source link

Failed do detect go func #304

Open yql70 opened 3 years ago

yql70 commented 3 years ago

lizard 1.17.7 If there is an anonymous function with a return value type in the testCCN function, it will cause the testCCN function to be undetected. Even when the latter function testC has a receiver argument, the testC function is not recognized too.

code:

func testCCN() {
    sort.SliceStable(Cells, func(i, j int) bool {
        return Cells[i].SortValue < Cells[j].SortValue
    })
    if true {
        println("")
    }
    if true {
        println("")
    }
}

func(v Vertex) testC()
{
    if true {
        println("")
    }
} 
 ~/Documents/install/lizard %python3 lizard.py test.go -l go
================================================
  NLOC    CCN   token  PARAM  length  location  
------------------------------------------------
       3      1     24      0       3 bool@2-4@test.go
1 file analyzed.