问题
I am looking for a pointer as to how to get statistics out of a merge xml file. The file structure looks like this ..
<CyclometricComplexity>
<module name="Srvr" type="unit" total="14" low="14" medium="0" high="0" ultra="0"/>
</CyclometricComplexity>
I have created a merge publisher to pick up this file, but cannot configure the statistics publisher to pick up values for total, low, medium, high and ultra.
Does anyone have an example they can point me at to help me out?
Thanks
回答1:
I think I found how to do this. First I needed to understand how XPath works! Then I changed my output tool to create a summary of the entire project, rather than trying to get CCNET to aggregate them together, so the out put now has total, low, medium, etc. for the entire project. Then I changed my statistics section to be as follows ...
<firstMatch name='Total Methods' generateGraph='true' xpath='//CyclometricComplexity/@total'/>
<firstMatch name='Low Complexity' generateGraph='true' xpath='//CyclometricComplexity/@low'/>
<firstMatch name='Medium Complexity' generateGraph='true' xpath='//CyclometricComplexity/@medium'/>
<firstMatch name='High Complexity' generateGraph='true' xpath='//CyclometricComplexity/@high'/>
<firstMatch name='Ultra Complexity' generateGraph='true' xpath='//CyclometricComplexity/@ultra'/>
The stats are now showing in the detailed statistics, and I need to now start asking questions about how to do bespoke graphs!
来源:https://stackoverflow.com/questions/839306/help-needed-configuring-cruisecontrol-net-statistics-merge