Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run code analysis the same as Android Studio performs on commit?

enter image description here

How can I run code analysis the same as Android Studio performs on commit?

I tried to use Analyze - Inspect Code feature - but it shows completely different warnings that I see during code analysis on commit.

Of course, I tried Build - Make Project - it also shows different warnings and even different errors.

So, it looks like Android Studio has 3 different sets of warnings & errors. And I can't find how I can run the third of them without attempt to commit changes.

like image 210
Dmitry Avatar asked Sep 04 '18 03:09

Dmitry


2 Answers

think that this "Code Analysis" is the default Android Studio inspection (Analyze > Inspect Code), as explained here - different results might be the result of using different profiles. while you can also use FindBugs (also used in some Google libraries) or add JaCoCo plugin to Gradle projects, which is Java Code Coverage for test builds.

like image 60
Martin Zeitler Avatar answered Oct 27 '22 16:10

Martin Zeitler


Based of the fact that every other day Analyze - Inspect Code shows different warnings in the same code, I can suggest that Lint is malfunctioning and doesn't show all warnings. But on the pre-commit check it shows all warnings for changed files.

like image 33
Dmitry Avatar answered Oct 27 '22 15:10

Dmitry