krez01 / findbugs-idea

Automatically exported from code.google.com/p/findbugs-idea
0 stars 0 forks source link

Automatically compile sources when running FindBugs analysis #71

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is a feature request to enable automatic compilation of the source code 
when FindBugs analysis is executed in FindBugs-IDEA. It may be a configuration 
option, but IMO it makes sense to enable it by default.

Why compilation is needed? As we know, FindBugs runs against class files. As a 
developer working on the source code, I expect FindBugs-IDEA to report issues 
against source code I see in the editor. Otherwise there is a disconnect and 
potential source of confusion. FindBugs-IDEA may point to issues which are no 
longer present in the source code simply because developer hasn't triggered a 
compile.

There is also a productivity problem that developer has to run compile and then 
run FindBugs analysis (two actions instead of one). There is an option to run 
FindBugs analysis after compile, but always running FindBugs AFTER compilation 
is not a suitable option in many cases.

By the way, QAPlug-FindBugs plugin compiles sources by default.

Original issue reported on code.google.com by flush...@gmail.com on 28 May 2014 at 11:00

GoogleCodeExporter commented 9 years ago

Original comment by andre.pf...@gmail.com on 28 May 2014 at 11:06

GoogleCodeExporter commented 9 years ago
not a bad idea - but does this have any big performance impact if running fb on 
big sets of classes?

any other opinions?

Original comment by andre.pf...@gmail.com on 9 Jul 2014 at 3:10

GoogleCodeExporter commented 9 years ago
Well, I believe FindBug-IDEA should compile files which are about to be 
inspected. If FindBugs is about to analyze one file - compile only one. If 
there is a need to analyze all files - let it compile all. Similar rule for 
module inspection.

Original comment by flush...@gmail.com on 12 Jul 2014 at 1:56

GoogleCodeExporter commented 9 years ago
I have found many cases where the compilation could be made from the command 
line (Maven) but couldn't be made from IntelliJ. I am still able to open the 
project with the precompiled classes and scan the bytecode. Forcing the 
recompilation would in these cases break the project and not allow FindBugs to 
do the analysis.

Original comment by philippe...@gmail.com on 4 Jan 2015 at 2:19