Skip to content

Features

Md-Rakib-Hossain-(Misu) edited this page Feb 17, 2022 · 7 revisions

Graph Manipulation

Interacting With the Graph

The graph supports single clicks on node and edges, as well as multi-select. In order to multi-select pres CTRL or CMD and either click on an element or drag over the area containing the elements which you wish to select. Keep in mind that when selecting the area, the elements must be completely inside of it in order to be selected.

Layout Options

The menu contains five different options, these are as follows:

  • Circle - Nodes are placed in a circle
  • Grid - Grid of nodes
  • Random - Random placement of the nodes
  • Dougnut - Circle layout which places the selected nodes inside of the circle so that relations can be more easily observed
  • Fcose - Force-Directed Graph which depicts the classes with high number of connections by placing them closer together; this is useful for visualising coupling by adjusting the node density in an area. It is worth noting that computing this layout is expensive, hence possibly taking noticeable time for larger projects (roughly >250 classes)

Metrics

Metrics in the graph are divided into normalised and non-normalised. The represent the actual state of the coupling, and the overall coupling computed by combining all values. We call these groups of metrics non-normalised and normalised, respectively.

Non-Normalised Metrics

There are four dependency types between classes, namely: packages, attributes, constructors, and methods. As these are the main options for inter-class communication, it was deemed useful to represent the precise number of these occurrences. Moreover, as each class can invoke and be invoked by other classes, we distinguish three possible groups of invocations per class: 1) incoming, where the class is referenced form another class, 2) outgoing when a class references another class, and 3) bidirectional which is the sum of incoming and outgoing invocations. When these three types of invocations are combined with the four dependency types, which are tracked, we obtain twelve different non-normalised metrics representing simply the number of invocations. These allow having a precise breakdown of the class coupling.

Normalised Metrics

The normalised metrics are computed based on the individual values of the non-normalised metrics. In the UI, this gives a general overview of the degree of coupling. The Overall Coupling metric is computed using the following formula:

C = 1 - 1 / (d_i - 2 * c_i + d_o + 2 * c_o + g_d + 2 * g_c + w + r)

were, for the value of the coupling for the class C, the d_i and d_o are incoming and outgoing data parameters, c_i and c_o are input and output control parameters (methods and constructors), and w and r represent the number of packages imported by the class and the number of imports of the class in question respectively. For our purposes, we have omitted the global data and control parameters g_d and g_c as they are irrelevant for Java.

Representation Options

The menu allows for four options which adjust the representation of the information in the graph:

  • Hide Edges Bellow Weight - Hides the edges with a weight bellow the provided threshold value. Moreover, the graph is updated with a new threshold when you click on something else so that the threshold input loses focus.
  • Hide Nodes Without Edges - Hides the nodes without any corresponding edges. In the case that some edges were hidden before this was enabled, and are subsequently displayed again, the corresponding nodes will be displayed as well, as they will now have a corresponding edge.
  • Show Edge Weights - Displays the weights (value of the selected metric) as a label in the middle of the edge.
  • Colour code Edges Based on Weight - Colours the edges based on the weight value starting with green and ending at red. This option fits teh values into twelve buckets. First one is green for the value zero, following ten are equally split on the interval [0..1] for the normalised, or [0..10] for the non-normalised, and finally the last red is for the value 1, or for the value 10 and above in the two mentioned cases correspondingly. Moreover, the legend for the colour values is provided bellow when this option is selected.

Scaling

As it is not easy and error-proof to automatically set the spacing between the nodes, there exists a slider to Adjust Spacing Factor which adjusts the space between the nodes.

Querying

Finally, classes (nodes) can be queried independently, or entire packages can be searched for which the result is colour coded classes based on the packages they pertain to. By default, the querying by package will display only the direct containing classes of the package, but if the See classes from offsprings checkbox is selected, this will also include the containing classes of all offspring packages of the queried package.

Reset Buttons

For the resetting of the view, there exist two buttons:

  • Reset Layout - Resets the layout to the default state, or places the nodes inside in the case of the doughnut layout
  • Fit to View - Fits all of the elements of the graph to the view by zooming out, thus not affecting the arrangement of the elements.

Side-Menu Information

The side menu bolds the snapshot at which the user is currently. There exist the possibility for querying based on the owner/organization name, as well for refreshing the structure of the tree inside it.

Element Insight

This component provides insight into the selected nodes and edges. It also supports multiple entries being selected at the same time, either because of a multi-select or a query.