Structure101 surfaces a number of measures (and the items that contribute to those measures) to help you to manage and control the structural improvement of your code-base.
Some measures directly relate to the source code itself, where others indicate where the code has deviated from your specs.
Structure Spec
If a Structure Spec has been defined for your project (this is done in Studio), these measures indicate to what degree your code deviates from the spec.
- Spec dependency violations: The number of code-level references that violate spec layering or visibility constraints.
- Spec item violations: These are items that were found in the code, in a scope that is included in the spec, but for which there is no corresponding item in the spec.
- Spec coverage: Measured as a percentage, this indicates the depth to which your spec covers the code. You don't want too much code uncontrolled (dependencies unspecified). This will start as 0, and increase toward 100% as you put more and more guardrails into your Spec.
Structural over-complexity
These measures look at code that is not in your Structure Spec. They are objectively problematic, and make your project code harder to understand and maintain.
They comprise 2 simple concepts.
Fat is too much stuff at any point of the source code composition. The solution for Fat is generally to move some of the contained items out of the Fat item into a new item (or sub-item).
Tangles occur when code containers are cyclically dependent.
- package feedback dependencies: This is the sum total of all code-level dependencies that are in the "minimum feedback set" of a package tangle.
- Tangled package:packages whose sub-packages are cyclically dependent.
- Fat packages:packages that contain too much.
- Fat classes:classes that contain too much.
- Fat functions/methods: Functions with too many possible execution paths.
- Biggest class tangle: This looks for cyclic dependencies between classes (without consideration for how they are organized into packages, and this is the biggest such tangle, measured as the number of classes it includes.
Architecture Diagrams
If you have defined any Architecture Diagrams for your project, then this is useful for ensuring compliance.
- Architecture diagram violations: Code-level dependencies that violate the layering or visibility constraints defined in all diagrams.