Headway Software - The Structure GuysSitemap
About us
Contact us
Structure101 > Features > Limit complexity > Summary reports > Project Summary: Ant (tips)

Java complexity metrics report

Project Summary: ant

Created:21 December 2005 17:56 by Structure101
Project file:f:\Seaview projects\ant-antlr.java.hsp
Classpath:See Appendix 1
Granularity:"Detail" - includes inner classes, methods and fields
Externals:"Hide" - referenced items are not included
Hierarchy:"Package"
Notes and tips:On

Tip:
  • This summary has been generated with "Show notes and tips" enabled - these are shown with a yellow background, like this one. You can switch them off via the drop-down menu in the Overview perspective (or with the -notips switch from the command line).
  • The Collaboration perspective is great for tracking down your dependency on third party libraries. Set "Show externals" in the project properties and then select the library item in the right-hand tree - anything that doesn't use it will be grayed out in the left-hand tree.

Size

Jars (and/or classpath directories):30
Packages (that contain classes):120
Classes (outer):1,455
Classes (all):1,877
Classes (external):0
 
NI (Number of bytecode Instructions):454K
LOC (Non Comment Non Blank Lines Of Code):~195K

Note:
  • Though less commonly used than LOC, NI is an excellent, style-independent, relative measure of code size.
  • The value for LOC is estimated from the NI.

Flat Tangles

Level#Nodes#Tangles#Tangled nodesBiggestDegree
Jar300000%
Leaf package1205422022%
Outer class1,455514091069%

Note:
  • "Flat" tangles are detected and measured from the flat dependency graphs of all items at a specific level. These are independent of the "Design" levels which are created by the higher-level packaging and are measured and reported in the "Excessive Structural Complexity (XS)" section below.
  • Tangles at the Jar or Package-level are highly disruptive.
  • The bigger the tangle, the more problems it is likely to cause.
  • Larger tangles at the class level are likely to cross package boundaries and so may also indicate a problem.
  • The degree is calculated so as to give a higher value for larger tangles - that is, one large tangle will give a higher degree than the same number of items involved in several smaller tangles.
Tip:
  • The Composition perspective is ideal for finding tangles - select "Design Tangles" in the notables pane, bottom-left of the perspective.
  • To view and analyze jar-level tangles, select the Jar hierarchy from the Model menu.
  • To view and analyze leaf package-level tangles, select the Flat Package hierarchy from the Model menu.
  • Class-level tangles are not immediately visible in Structure101. They are not considered to be a problem unless they are large and/or cross package boundaries, in which case they will be visible and detected at the higher levels.

Excessive Structural Complexity (XS)

Configuration:Structural Integrity
Cumulative XS:295,553
Average XS:65%

Note:
  • The XS Configuration is a set of thresholds for "Fat" and "Tangles" at different levels of composition.
  • Fat indicates "too much stuff" in one place and is measurable at every level of composition - Design, Package, Class and Method.
  • Cyclomatic Complexity is used as a measure of Fat at the method level - the number of dependencies in the child dependency graph is used at the other levels.
  • Tangles are measured only at the Design level, i.e. cyclic dependencies between packages.
  • Both Fat and Tangles are measured as the percentage by which the threshold is exceeded. This percentage is multiplied by the size of the item so that the Average XS can be read as a percentage of the code-base.
  • Read more about the concepts behind XS.
Tip:
  • Always use the Package hierarchy from the Model menu when working with XS.
  • Use the Measurement perspective to obtain detailed information on the XS in your project.
  • Change the metrics and thresholds used to calculate XS by putting the XS Configuration into "Edit mode" from the drop down menu, bottom-left, in the Measurement perspective. Save the changes as a new named configuration.

XS breakout by metric (and scope)

Metric (and scope)Threshold#OffendersOffenses (%)XS contribution
Tangled (design)013 of 3438%67%
Fat (design)600 of 340%0%
Fat (leaf package)1203 of 1202%6%
Fat (class)12033 of 1,8772%14%
Fat (method)15238 of 17,2771%13%
Total 100%

Note:
  • The Metric (and scope) column contains all the metrics that are enabled in the selected XS Configuration (named in the previous section).
  • The "Threshold" is taken from the selected XS Configuration
  • The "#Offenders" indicates the number of items that exceed the threshold.
  • The "Offenders (%)" indicates the number of items that exceed the threshold as a percentage of the total number of items at that level.
  • The "XS contribution" indicates the degree to which design tangles and fat at each level contribute to the total amount of XS in the project.
Tip:
  • Use the Measurement perspective to obtain detailed information on the XS in your project.

Tangled (design): Top 5 (of 13)

ItemValue
root36%
org.apache.tools.ant.taskdefs.optional.extension33%
org.apache.tools.ant.types.selectors29%
org.apache.tools.ant.taskdefs.optional.jsp16%
org.apache.tools.ant.types15%

Note:
  • The "design" level items are high-level packages (i.e. packages that contain sub-packages). Tangles are only measured at this level.
  • The value is calculated as the number of dependencies that go bottom-up as a percentage of all the dependencies on the child graph for the item.
Tip:
  • To view and analyze these tangles, drill down to the item in the Composition perspective with the Package hierarchy selected from the Model menu.
  • The complete list is available in the Measurement perspective. Make sure you are at the root of the "Drill-down" in the top-left, and then select the Tangled (design) slice of the pie. The "Items with XS" will contain all the items that exceed the threshold at this level.

Fat (design)

No items exceed the threshold for Fat at the design level.


Note:
  • The "design" level items are high-level packages (i.e. packages that contain sub-packages).
  • The value is calculated as the number of dependencies in the child graph for the item, i.e. the dependency graph of the sub-packages of the measured package.
Tip:
  • To view and analyze these Fat items, drill down to the item in the Composition perspective with the Package hierarchy selected from the Model menu.
  • Use the "Auto-partition" button on the Dependency Graph to help make sense of big graphs.
  • The complete list is available in the Measurement perspective. Make sure you are at the root of the "Drill-down" in the top-left, and then select the Fat (design) slice of the pie. The "Items with XS" will contain all the items that exceed the threshold at this level.

Fat (leaf package): 3

ItemValue
org.apache.xerces.dom281
org.apache.html.dom137
org.apache.tools.ant121

Note:
  • The "leaf package" level items are packages that contain classes.
  • The value is calculated as the number of dependencies in the child graph for the item, i.e. the dependency graph of the classes in the measured package
Tip:
  • To view and analyze these Fat items, drill down to the item in the Composition perspective.
  • Use the "Auto-partition" button on the Dependency Graph to help make sense of big graphs.
  • The complete list is available in the Measurement perspective. Make sure you are at the root of the "Drill-down" in the top-left, and then select the Fat (leaf package) slice of the pie. The "Items with XS" will contain all the items that exceed the threshold at this level.

Fat (class): Top 5 (of 33)

ItemValue
org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl439
org.apache.xerces.impl.xs.XMLSchemaValidator439
org.apache.xerces.impl.dtd.DTDGrammar375
org.apache.xerces.xinclude.XIncludeHandler338
org.apache.tools.ant.taskdefs.optional.ide.VAJAntToolGUI294

Note:
  • The value is calculated as the number of dependencies in the child graph for the item, i.e. the dependency graph of the methods and fields in the class.
  • This is not available if the Granularity for the project is "Overview".
Tip:
  • To view and analyze these Fat items, drill down to the item in the Composition perspective.
  • Use the "Auto-partition" button on the Dependency Graph to help make sense of big graphs.
  • The complete list is available in the Measurement perspective. Make sure you are at the root of the "Drill-down" in the top-left, and then select the Fat (class) slice of the pie. The "Items with XS" will contain all the items that exceed the threshold at this level.

Fat (method): Top 5 (of 238)

ItemValue
org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets(XSFacets, short, short, short, ValidationContext):void107
org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Context, Op, int, int, int):int106
org.apache.xerces.impl.xpath.regex.RegularExpression.matchCharArray(Context, Op, int, int, int):int106
org.apache.xerces.impl.xpath.regex.RegularExpression.matchCharacterIterator(Context, Op, int, int, int):int106
org.apache.xerces.impl.xpath.XPath$Scanner.scanExpr(SymbolTable, Tokens, String, int, int):boolean84

Note:
  • The value is calculated as the Cyclomatic Complexity (McCabe's metric) of the method.
  • The value is calculated from the bytecode and so may differ from the value that would be calculated from the corresponding source code in some (rare) cases.
  • This is not available if the Granularity for the project is "Overview".
Tip:
  • To view and analyze these Fat items, drill down to the class that contains the method in any perspective.
  • Click on the "Show source" button on the main toolbar to view the source.
  • The complete list is available in the Measurement perspective. Make sure you are at the root of the "Drill-down" in the top-left, and then select the Fat (method) slice of the pie. The "Items with XS" will contain all the items that exceed the threshold at this level.

Items with highest XS - Top 10 (of 287)

TypeItemSizeXSTangledFat
Rootroot454,021165,656 36% 2
Packageorg.apache.xerces.dom29,68417,007  281
Packageorg.apache.xerces.impl130,3688,083 6% 17
Packageorg.apache.tools.ant207,6816,778 3% 35
Classorg.apache.xerces.impl.dv.xs.XSSimpleTypeDecl7,0875,149  439
Packageorg.apache.xerces198,1054,957 3% 31
Classorg.apache.xerces.impl.xs.XMLSchemaValidator6,4094,657  439
Classorg.apache.xerces.impl.dtd.DTDGrammar5,2943,599  375
Packageorg.apache.tools.ant.taskdefs152,5113,073 2% 12
Packageorg.apache.tools.ant.types19,2462,799 15% 4

Note:
  • XS is related to the value and the size of the item so that bigger items (usually higher in the hierarchy) score higher. Since excessive structural complexity on bigger items (e.g. packages) will tend to disrupt development activities more than on smaller items (e.g. methods), you should consider fixing these first.
  • Values in red exceed threshold.
Tip:
  • The complete list is available in the Measurement perspective - make sure you are at the root of the "Drill-down" in the top-left, and do not select any items in the pie.
  • You can integrate the generation of this summary into your build process. See help for details.

Appendix 1 - Project Classpath

f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-antlr.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-apache-bsf.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-apache-resolver.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-commons-logging.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-commons-net.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-icontract.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-jai.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-jakarta-bcel.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-jakarta-log4j.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-jakarta-oro.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-jakarta-regexp.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-javamail.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-jdepend.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-jmf.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-jsch.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-junit.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-launcher.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-netrexx.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-nodeps.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-starteam.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-stylebook.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-swing.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-trax.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-vaj.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-weblogic.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-xalan1.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-xalan2.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant-xslp.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\ant.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\xercesImpl.jar
f:\Demos\Open Source\apache-ant-1.6.1\lib\xml-apis.jar

 


Powered by Structure101 for Java Build 47 (http://www.headwaysoftware.com/products/structure101)




©Headway Software 1999-2008Legal