Treemap – Revealing the Distribution of Smells

Sept. 23, 2016

Tags: Visualization , Architecture smells , Design smells , Code smells , Implementation smells , Treemap , Smell distribution



You know there are smells spread all over your code base. However, which of the modules (or components) have more smells than others? What is the distribution of smells in your code base? To know this, you may carry out design smell analysis and then compute manually the distribution of smells. As you can guess, figuring out the distribution of smells within your code base manually is not really trivial; it may take a lot of your time and you may loose the motivation to do so. In such a situation, Treemap is extremely useful.

Designite offers treemap visualization of your code base. Treemap shows two aspects – “size” and “smell density” of a component/class. Designite analyzes the selected code base and computes size and smell density for each class. In the treemap, each rectangle with dark-red color outline represents a namespace in the analyzed code base. The size of the rectangle depends on the size of the namespace relative to the analyzed code base. Such rectangles have many smaller filled rectangles (representing classes). Again, the size of a filled rectangle depends on the relative size of the class. The color filled in the rectangle shows the smell density. A class with low smell density is shown by green color; the temperature of the rectangle increases with the smell density i.e. a class with very high smell density is shown by dark red color.

The treemap shown by Designite is user-friendly. It reveals the details of the class (namespace, class, and smell density) based on the location of mouse pointer. Therefore, if you wish to know the class identity of a class which is looking really bad, you just need to point your mouse pointer over the rectangle.

treemap


Moreover, Designite allows you to customize the analysis and the treemap by changing the thresholds. These thresholds decide the color of each class shown as a rectangle. Further, you may decide whether you are interested in only design smells, implementation smells, or both. Even further, you may customize the treemap by reducing the scope; it can be done by selecting a specific project from the drop-down list.