Clones are more problematic when members of a clone class scattered in different parts of a software system because this requires changes need to be made in different parts of the system. Thus, it is required to discover how clone fragments are distributed across subsystems/directories. Moreover, understanding cloning relationships among different subsystems can also reveal their dependencies. VisCad can render the hierarchical organization of a software system along with the distribution of clones using a hierarchical dependency graph.
Select a directory from the system navigation tree and right click on it to open a popup menu. Click on the Hierarchical Dependency Graph menu item.
Edge width can represent number clone classes/clone pairs distribued between a pair of directories. Nodes width and height can represent cohesion and coupling value. Click on the ok button when you are done.
Suppose we want to understand which directories in the system contain the external clones of the color directory. We select the color directory from the system navigation tree, open the popup menu and select the Hierarchical Dependency Graph.
With the default settings, we get a graph as shown in the above figure. From the figure we can understand that the color directory has external cloning relationship with the gui, undo and beans directories.
VisCad visualizes the graph by filtering those nodes that do not have any cloning relation with the selected directory.
The above figure shows the hierarchical dependency graph for the jhotdraw/draw directory. In this case, node's (represnting the directory) width and height represent the clone cohesion and coupling value. Node color value represent the external cloning relation level with the target directory.
In the picking mode, you can select individual node and move them. In the transforming mode, you can move the entire graph.
Right click on a node( represnting a directory) opens a popup menu. You can then select the target operation. The clone pairs( internal/external) will be viewed in a new tab using the clone pair browser component (see the next figure).