Headway Software - The Structure GuysSitemap
About us
Contact us
Structure101 > Features > Limit complexity > Measure XS

Java complexity metric

Structure101 defines a software complexity metric called XS.  The principal of XS is very simple, but if you keep your XS close to zero, your structure will be considerably simpler (easier to develop, modify, extend, test, reuse, deploy, etc.) than the vast majority of code-bases in the world. 

A unique characteristic of the XS metric is that it can be applied to every item at every level of the hierarchy.  An XS value of 0 is good - it means that the code is not excessively complex (has not exceeded the set limit).

XS considers only two structural measures - "Fat" and "Tangle". 

Fat is the degree to which an item exceeds a size threshold and is applied at every level of the hierarchy.  Fat is measured as Cyclomatic Complexity at the method level, and the analogous measure of the number of edges in the dependency graph is used at all other levels.

Tangle is the degree to which package dependencies are cyclic and is applied only at the design level (i.e. to the contents of high-level packages).  Tangle is measured as the number of "wrong", or upward, dependencies as a percentage of all dependencies on a dependency graph. The Tangle metric is only measured at the package level where it does the most damage (see Bob Martin's Acyclic Dependency Principle (ADP))

Any excessive Fat and Tangle is multiplied by the amount of code in the item to give the XS value for that item.  In this way, problems higher in the hierarchy are "awarded" a higher XS value.  This is important because higher-level problems (such as architectural tangles) tend to cause more chaos that lower-level problems (however widespread low-level problems, such as high method CC, can add up to as big a problem as a tangle at the top level).  Relating XS to the amount of code also allows us to indicate the average amount of the code that is excessively complex at any level, and so a way to understand the relative complexity of different projects or parts of projects.

Figure: The Measurement perspective relates the amount of XS (red) to the amount of code in an item so that you can compare the size and complexity of the different areas of your code-base.
Full screenshot

drill down on areas of your code with the highest cumulative software complexity metric (XS)

Figure: A list of items that violate Fat and/or Tangle thresholds helps you prioritize problems and tackle them according to the impact they are having on your team productivity.
Full screenshot

sort a list of complex items based on the value of the software complexity metric (XS)

Figure: A pie chart shows you the relative contribution of problems to the overall XS value.  Selecting a slice of the pie filters the list to show just items with the selected problem.
Full screenshot

see which levels have the highest software complexity metric (XS)

Figure: The XS configuration can be modified to include/exclude specific scopes and to change the threshold values.
Full screenshot

set the software complexity metric threshold for each level




©Headway Software 1999-2008Legal