FxCop reporting unreliable "new" issues count
I have this FxCop build configuration which quite often (but not always) will show a very high number of new issues added and removed from the report, but in fact nothing or very little has changed since the previous report run, for example:
Total problems found: 19920 (+15853 -15853), errors: 2897 (+1459 -1459)
As you can see it is showing 15853 added to the report and a further 15853 removed from the same report, and yes, they are the same issues. I cannot see what is causing this problem and maybe someone else has seen this before?
In other words, why would the FxCop build configuration think that these issues are not the same as the ones from the previous report?
Please sign in to leave a comment.
Alex, please check if builds were run on the same agent or not. Another possible reason is that you updated TeamCity between that builds. Also it will be very usefull to look at fxcop-result.xml files produced by builds.
I have checked a couple of fxcop-result and ideed the issue seems to be with incositent data in them, thanks for the tip.
Alex, please look at this blog post to learn how u could make FxCop analysis result in TeamCity more cositent.
I believe I found what is causing these incositencies. My assemblies can be built on different build agents, the working directories on these agents can be different, and I noticed that I see the behavior described above when two FxCop analysis runs obtain their assemblies from different agents . I can only assume it's because TeamCity's fxcop results parser is mistakinly identifying the source filex as being "different" because their file path is not the same.
For example:
<Message Id="De" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Status="Active" Created="2011-12-15 16:20:51Z" FixCategory="Breaking">
<Issue Name="Member" Certainty="85" Level="Error" Path="c:\TeamCity\BuildAgent\work\961c495d5e66994c\UserConfig\Dalc\UserConfigExtensions" File="UserExtensionData.cs" Line="59">Correct the casing of 'De' in member name 'UserExtensionData.DeSeraializeData(string)' by changing it to 'DE'.</Issue>
</Message>
vs
<Message Id="De" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Status="Active" Created="2011-12-15 12:43:36Z" FixCategory="Breaking">
<Issue Name="Member" Certainty="85" Level="Error" Path="c:\BuildAgent\work\961c495d5e66994c\UserConfig\Dalc\UserConfigExtensions" File="UserExtensionData.cs" Line="59">Correct the casing of 'De' in member name 'UserExtensionData.DeSeraializeData(string)' by changing it to 'DE'.</Issue>
</Message>
Alex, TeamCity converts absolute paths from FxCop report to relative paths (against checkout directory). So this should not be the reason.
I compared two fxcop results files, that's the only significant difference I have found.
Note that the path in the fxcop result files is from the build agent were the assembly has been built and that's on another machine, not the one that runs the FxCop analysis.