findbugs ant 代码审核工具

阅读更多

 

Findbugs 是一个静态分析工具,它检查类或者 JAR 文件,将字节码与一组缺陷模式进行对比以发现可能的问题。利用这个工具,就可以在不实际运行程序的情况对软件进行分析。它可以帮助改进代码的质量。

Findbugs提供了方便操作的可视化界面,同时也可以作为Eclipse的一个插件来使用,而我们使用得最多的还是作为Eclipse的插件来使用。

doCheck.bat

------------

@ant -f  fingbugs.xml 

---------

fingbugs.xml

---------------------------------

 

   

   

   

   

   

   

   

   

     

   

                projectName" home="${findbugs.home}" output="html" outputFile="projectName.html" jvmargs="-Xmx256m -Xmx256m" reportLevel="Low" excludeFilter="findbugs_exclude.xml">

  

               


 

 

 

 

 

 


 

 

 


 

 


 

                

                auditCode.path}/action/*.class" />

auditCode.path}/bean/*.class" />

auditCode.path}/delegate/*.class" />

auditCode.path}/form/*.class" />

auditCode.path}/helper/*.class" />

auditCode.path}/helper/ap/*.class" />

 

         

    

-------------------

过滤文件

findbugs_exclude.xml
内容如下例子: 

 
  
        
      
      
         
      
      
         
      
      
         
     
       
         
     
 
这样会过滤Value和Table,Cache等类

 

 

你可能感兴趣的:(findbugs,ant,code,audit)