-
New Feature
-
Resolution: Unresolved
-
Major
-
None
The .NET equivalent of Crap4J is Crap4Net (http://crap4net.codeplex.com/).
I'd like to extend the Hudson Crap4J plugin so it can also display results from Crap4Net. Below is an example XML report generated by Crap4Net.
What is the best way to proceed?
(a) Transform the Crap4Net XML to be the same as the Crap4J xml?
(b) Extend Hudson Crap4J so it can import the Crap4Net format?
Thanks!
David
-------Example Crap4Net report----------
<?xml version="1.0" encoding="utf-8"?>
<CrapReport>
<Section Name="Methods">
<Method Type="JsonSchemaUtilities" Name="BuildEnumSchema" Crap="7" />
<Method Type="JsonSchemaUtilities" Name="BuildTypeSchema" Crap="10.17" />
<Method Type="JsonSchemaUtilities" Name="BuildPropertyBase" Crap="9" />
<Method Type="JsonSchemaUtilities" Name="GetXmlDocs" Crap="2.16" />
<Method Type="JsonSchemaUtilities" Name="GetMemberNode" Crap="1" />
<Method Type="JsonSchemaUtilities" Name="GetMemberNodes" Crap="1" />
<Method Type="JsonSchemaUtilities" Name="ApplyTypedValue" Crap="14.57" />
<Method Type="JsonSchemaUtilities" Name="ApplyDescription" Crap="2" />
<Method Type="JsonSchemaUtilities" Name="ApplyPropertyAttribute" Crap="9.4" />
<Method Type="JsonSchemaUtilities" Name="BuildPropertySchema" Crap="8" />
<Method Type="JsonSchemaUtilities" Name="BuildParameterSchema" Crap="90" />
<Method Type="JsonSchemaUtilities" Name="BuildSMDBase" Crap="2" />
<Method Type="JsonSchemaUtilities" Name="BuildServiceMapping" Crap="380" />
<Method Type="SchemaHandler" Name="ProcessRequest" Crap="56" />
<Method Type="SchemaHandler" Name="get_IsReusable" Crap="2" />
<Method Type="SchemaHandler" Name=".ctor" Crap="2" />
<Method Type="SmdHandler" Name="ProcessRequest" Crap="20" />
<Method Type="SmdHandler" Name="get_IsReusable" Crap="2" />
<Method Type="SmdHandler" Name=".ctor" Crap="2" />
</Section>
</CrapReport>
Hi David,
this is an excellent idea. Judging from your example XML, the crap4j XML report contains a lot more information (see example snippet below).
So i don't think it's the best way to transform the Crap4Net XML (and make up a lot of information).
In fact, extending the crap4j plugin data model shouldn't be that hard and you/we only need to make up the parts that are really needed.
If you like, I would assist your effort with some guidance for the existing code and the hudson development details, if necessary. Time's a bit short for me, but weekends should be fine.
Example XML for crap4j:
<crap_result>
<some tags here/>
<stats>
...
</stats>
<methods>
<method>
<package>
com.schneide.display
</package>
<className>
ControlCode
</className>
<methodName>
<init>
</methodName>
<methodSignature>
(Ljava/lang/String;)V
</methodSignature>
<fullMethod>
public void <init>(java.lang.String)
</fullMethod>
<crap>
1.00
</crap>
<complexity>
1
</complexity>
<coverage>
100.00
</coverage>
<crapLoad>
0
</crapLoad>
</method>
<method>
<package>
com.schneide.display
</package>
<className>
DisplayFactory
</className>
<methodName>
createDisplayFor
</methodName>
<methodSignature>
(Lcom/schneide/display/data/EFirmwareVersion;ILcom/schneide/display/model/IStreamPair;)Lcom/schneide/display/Display;
</methodSignature>
<fullMethod>
public static com.schneide.display.Display createDisplayFor(com.schneide.display.data.EFirmwareVersion, int, com.schneide.display.model.IStreamPair)
</fullMethod>
<crap>
1.00
</crap>
<complexity>
1
</complexity>
<coverage>
100.00
</coverage>
<crapLoad>
0
</crapLoad>
</method>
</methods>
</crap_result>