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.81k stars 246 forks source link

Lizard groups nearly 100 lines into one "function" in a Rust file #363

Open rjray opened 1 year ago

rjray commented 1 year ago

This is the file, at the current version: https://github.com/rjray/mscs-thesis-project/blob/811b319cd81d7901a248a5cebe840daeb63a2a75/src/Rust/aho_corasick/src/main.rs This should remain good even if I make further changes to the file. When I run the command lizard Rust/aho_corasick/src/main.rs, the resulting analysis counts lines 50-147 as a single function it calls iter. This starts inside an impl block for one struct, and completely subsumes a second struct/impl definition as well as two other functions.

503440692 commented 1 year ago

image There are syntax error in your source code. If the source code like following picture, the tool work fine: image

rjray commented 1 year ago

That is incorrect. The code as written is correct, this is valid Rust syntax. The change you suggest would actually break the code.

a1phyr commented 1 year ago

Is there any progress on this ?

rjray commented 1 year ago

Bumping for visibility. I used this tool for my MSCS thesis research last fall, but had to use a separate tool for CCN in Rust. I am continuing this research, and would really like to be able to use the same tool (this tool) for all languages in my study (C, C++, Rust, possibly Go and Java as well). Switching tools for one or two of the languages makes it harder to compare the CCN of the different languages.