Structure101 Studio defines a framework to measure excess complexity in a code-base in such a way that we can relate the excess complexity of items at different levels of composition, and compare the total amount of excess complexity contained by different projects, subsystems, packages, etc.

The measurement of XS is best understood in the following steps:

  1. First measure the complexity of every item in the code-base hierarchy (i.e. every method, type, file, folder).
  2. Thresholds define when an item is considered excessively-complex.
  3. The degree of excessive complexity is calculated by normalizing the complexity values with respect to the thresholds. This gives an excessive complexity value for every item in the code-base.
  4. The degree of excessive complexity is related to the size of each item so that excessive complexity at lower (e.g. method) levels can meaningfully be related to items at higher levels. This gives a nominal excessively-complex lines of code for every item at every level.
  5. Finally, in order to compare the overall complexity of projects, subsystems, packages/components etc., the total amount of excessively-complex lines of code contained by each item is summed up. This facilitates the drill-down on areas of relative over-complexity within a company or project.

 

A whitepaper explaining our XS framework in detail is available here.