lockbud icon indicating copy to clipboard operation
lockbud copied to clipboard

Suggestion on the Panic checker

Open karlls12321 opened this issue 10 months ago • 1 comments

Description

When using lockbud for code analysis, I find that the rule for checking panic is a little simple (use keyword matching), resulting in a large number of false positives.

In my codebase, when the panic checker is enabled, the number of warnings reaches 37915, and most of them are false positives after inspect some warnings. However, when I disable the panic check, the number of warnings is only 134. Panic is a common language feature used in Rust, therefore, it is not quite appropriate to detect this type of defect directly through matching.

With so many false positives, the panic checker becomes more of a hindrance rather than a help. Developers have to spend lot of time to check these warnings to find the actual problems, which greatly reduces the efficiency of the code review process.

Suggested Solutions

Redesign the panic checker to make it more accurate. Or, consider remove the panic checker.

karlls12321 avatar Mar 03 '25 02:03 karlls12321

The panic checker is just a Panic Location Finder for now. Its function is limited without any SMT solver involved. Do not enable it if you find it annoying. Future work may add more rules and SMT solvers to find the true panics.

Chain-Fox avatar Mar 04 '25 00:03 Chain-Fox