可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I'm looking at adding static code analysis to our Jenkins builds of a Java project (~500K lines of code).
Two possibilities are Analysis Collector or SONAR.
One advantage of SONAR looks to be it can show dead code and deprecated methods.
Recommendations?
回答1:
Sonar is not just a tool to integrate other tools in a unified environment. First with Sonar you can analyze not just Java source code but code developed in more than 20 languages. http://www.sonarsource.com/products/plugins/languages/
Then the star feature of Sonar is the differential views where you can see how the quality of your code is evolving over time. To be honest this can't be done by using these tools in separately. http://docs.codehaus.org/display/SONAR/Differential+Views
Furthermore you can create code reviews and integrate it with Jira (if you use it) and benefit from over 40 open source and commercial plugins that add more features into your Sonar installation.
So IMHO the two tools you mention can't be even compared! And I'd definitely suggest Sonar
回答2:
SONAR
In more words: I would recommend to separate building and reporting tasks. Different functions should be done by different systems (Like Separation_of_concerns principle). I had build failing a lot of times, just because I was configuring Analysis Collector reports. Secondly you can start SONAR analysis from local PC or any other server.