Compare two fxcop results

馋奶兔 提交于 2019-12-07 06:03:58

问题


I'm going to analysis two different versions of the same dll with fxcop. I would like to display only the differences between these two reports. Does anyone know if this is possible ?

Thanks for your time.


回答1:


Yes, it's possible, but there are no built-in tools available for this. One fairly simple approach would be to use a diff tool to compare the two reports. If the result is too noisy for you, another approach would be to roll your own tool to compare the XML of the two reports.




回答2:


Are you using UI or the command line?

With the command line tool, you have a number of options. One of them is to import an old report to be used as a baseline. Then set the fxcop project to report only new errors: Report Status="Active, Absent" NewOnly="True"

The command line will be something like this: fxcopcmd.exe /i:OldVersionReport.xml /out:NewVersionReport.xml /p:FXCopProject.fxcop /f:mydll.dll

The new report will have only new active error and also a list of missing i.e. fixed errors from the old version.

While this will work for the most part, you need to understand that the difference will not be 100% acurate. FXCop does its best to match old report to the new version of the DLL, but sometimes it fails. For example, if you fixed a particular violation somewhere in code, but added the same type of violation in another place, FXCop will most likely miss this and show no difference.




回答3:


For FxCop VS 2010 , all you need is to have /saveMessagesToReport:Absent along with the older generated FxCop file /import:"OldFile.xml" specified . Just an eg.

     fxcopcmd.exe /import:"c:\Old.xml" /summary "/file:c:\*.dll" 
     /saveMessagesToReport:Absent /out:"c:\Output.xml"


来源:https://stackoverflow.com/questions/2635663/compare-two-fxcop-results

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!