Moose demo: painting System Complexity

In this demo, you can see an example of building the System Complexity view for a group of classes using the scripting capabilities of Moose. System Complexity is a visualization that displays hierarchies of classes and for each class it shows a rectangle enriched with three metrics:

  • the height is given by the number of methods in the class,
  • the width is provided by the number of attributes in the class, and
  • the color denotes the number of lines of code in the class (the darker the more lines of code).

This simple visualization is especially useful to provide a first insight into the structure of the system and the distribution of code through the system.

The demo shows how we can build it from scratch by using the Moose engine, called Mondrian, for scripting visualizations.

The code for the visualization is:

view shape rectangle
  height: #numberOfMethods;
  width: #numberOfAttributes;
  linearFillColor: #numberOfLinesOfCode within: classGroup.
view nodes: classGroup.
view edgesFrom: #superclass.
view treeLayout
Posted by Tudor Girba at 6 July 2011, 7:48 pm with tags moose, demo, tooling link
|