CyVis
Graphical Interface
Contents
i. Tool bar
ii. Chart Panel
iii. Metrics Table
1. Starting
the application:
After extracting the zip file to the desired location,
double click on the cyvis.jar file to run the application. This will launch the
application. If in the rare case, you seem to be having a problem with this,
there is always the cyvis.bat you could run from the ‘bin’
folder.
2. Creating
and saving a project:
Click on the FileàNew Project to create a new Project. This brings a screen as shown below.
3. Viewing
metrics and what exactly do they mean.
Once the metrics has been extracted you are presented with a screen as shown below:
The screen is divided into two basic components.
By default the tree structure shows you all the packages in your project. Each of these packages when expanded will display the classes and interfaces it contains.
This panel is further subdivided into
Let us first
have a look at the Chart Panel and revisit the toolbar later for better
understanding.
Chart Panel
This is where the metrics are visualised. What do the charts mean or what can you infer by looking at them?
The charting is done in three levels
1. Project View: As soon as the metrics are extracted the chart panel will display many blocks like this-
Each of these blocks represents a separate package in your project. The package name will be displayed at the top of each chart. Each package chart consists of numerous vertical bars, representing a Class or an Interface in that package.
By clicking on any of these blocks you will be taken to the Package View for that package.
2. Package View: Package view will show all the classes and Interfaces in a particular package. The difference between this view and the Project view is that here you look at only one package whereas in the project view you can look at all the packages. In addition to that, when you move the mouse over any specific vertical bar, a tool tip pops up with the metrics of that particular class/Interface as shown below.
You may also click on the vertical bars to see a particular Class/Interface in detail (which brings up the Class View). The classes are arranged based on their size with the biggest class placed in the left hand side and the smaller ones in the right.
3. Class View: The class view will show one vertical bar representing the class/interface selected as shown in the diagram below.
This vertical bar is divided into many smaller rectangles, each representing a method in that class/interface. These smaller rectangles vary in size indicating their size with respect to other methods. The most complex method is at the top and the least at the bottom.
Colouring and Metrics:
The colouring of the methods in each of the views is done according to their Cyclomatic Complexity. By default any method with a Cyclomatic Complexity less that or equal to three is coloured green, anything beyond that and less than seven is coloured yellow and everything else is red.
Interfaces are coloured grey, and empty interfaces are white.
You can change these defaults (colours and cyclomatic complexity ranges) in the preferences dialog.
Metric Table
The table just below the chart panel displays the metrics for that particular view.
Toolbar
4. Changing
Preferences
To change the Cyclomatic Complexity, Chart Colouring and the directory where report should generated in click MetricsàPreferences in the menu bar. Doing so shows the following:
Shown are the defaults. The report directory by default is the directory where the project is saved (the *.cys file) which can be changed if you choose to. The Metrics section allows you to change the range of cyclomatic complexity and the colour that represents them. Clicking on the colours launches a colour palette.
Remember to save any changes you have made, so that they get applied. Restore Defaults restores the default for you.
5. Editing
Projects
When you click FileàEdit Project, CyVis can take different actions based on whether a project is currently open or not.
If a project is already open, CyVis displays the edit dialog with all the information of the current project. You can add/remove files; change the workspace or even the project name. Once you have finished editing save the project like you generally do.
On the other hand if a project is not currently open, CyVis pops up an open dialog. Select the project file (*.cys) which you want to modify. Once you have selected your project, CyVis opens the edit menu.
6.
Generating reports
Two types of reports are possible, HTML and TXT formats. The reports can be generated by either clicking MetricsàGenerate HTML Report or MetricsàGenerate TXT Report.
You may also choose to do an XML Dump by clicking on MetricàGenerate XML Dump.
The report and the dump files are automatically generated at the report directory. The report directory is the same as the project directory unless changed via preferences dialog.