mozilla / rust-code-analysis

Library to analyze and collect metrics on source code
https://mozilla.github.io/rust-code-analysis/
262 stars 46 forks source link

rust-code-analysis-cli -m -p path/to/crate/src/lib.rs does nothing #1087

Open jayvdb opened 1 month ago

jayvdb commented 1 month ago

When I run rust-code-analysis-cli -m -p path/to/crate/src/lib.rs , nothing happens.

According to rust-code-analysis-book/src/commands/metrics.md this should do something.

I am using master with #1084 applied.

jayvdb commented 1 month ago

I have got as far with debugging as verifying that fn metrics in spaces.rs is processing the Rust code, but func_space is always false even when there are fns in the file, and the nodes including some of type function_item so it looks like it is finding the fns.

My initial feedback is that it would be nice if the CLI reported something like "No functions found in files analysed".

jayvdb commented 1 month ago

Ok, the reason why I am getting no results is https://github.com/mozilla/rust-code-analysis/pull/1084 . When I use https://github.com/mozilla/rust-code-analysis/pull/1086 , I get results.

Still, the CLI should give some sort of result if no fns were found.