facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.89k stars 2.01k forks source link

What is the difference between Infer and Infer:Eradicate #1655

Closed zhaoyangyingmu closed 2 years ago

zhaoyangyingmu commented 2 years ago

I used these two tools to scan a variety of projects. But I found that their warning types are almost the same, though the number of the type varies. Eradicate produces much more warnings than Infer for the same type, like "ERADICATE_PARAMETER_NOT_NULLABLE". Thus I am very curious about the reason behind it. I know that Eradicate makes use of @Nullable annotation, so is it because Infer does not use the annotation?

jvillard commented 2 years ago

Eradicate checks that @Nullable annotations are used correctly and consistently, whereas other checkers like biabduction or pulse look for program paths where they think NULL can be dereferenced, regardless of @Nullable annotations. So, eradicate is more like a type system, whereas other analyses in infer typically do not rely on code annotations.