Codemr: For Intellij Idea
Codemr: For Intellij Idea
Codemr: For Intellij Idea
User Guide
v2018
Installation 2
Overview 3
Report Generation 24
Manual install:
● Download CodeMR plugin to your local file system from CodeMR website or from
IntelliJ Plugin repository site.
● Select IntelliJ File Menu→Settings→Plugins→Install Plugin from disk
You can specify a name for the model and also select basic options for the model extraction.
Once the tool finishes analyzing the software code, it will create a model file from the project
and open this model in the CodeMR model editor.
Overview
Overview Tab in the model editor gives general information about the extracted project such
as total lines of code, number of classes, number of packages number of problematic
classes, and number of highly problematic classes. Also, percentages of metric levels for the
selected metric are illustrated in a pie chart proportional to the code size of classes in this
level.
The following legends are commonly used to indicate the metric levels throughout different
CodeMR charts and graphs.:
Graph List
Graph list shows the list of all graphs created for the project. You can add, delete and copy
graph from graph list with toolbar buttons
In the working set edit dialog, give a name to the working set and select packages and
classes that you would like to add to the working set.
Working set list toolbar buttons are as follows:
Metric Distribution
Metric Distribution Tab shows percentages of metric levels for the each metric in a pie
charts. Slices of pie charts are proportional to the code size of classes for the corresponding
level.
Metric Chart are available in the the CodeMR metrics tool window and insides several views
in model editor.
Package Structure
Package structure shows project’s packages and encapsulated classes in a hierarchical way
with circle pack layout. It has the following properties:
● Size of each circle is proportional to the size of the represented software entity.
● Color of each circle represents the level for the selected metric.
● If Metric Chart option is selected when you hover the class you can see its metrics in
CodeMR Metric Chart.
● It is zoomable, you can change the zoom level by clicking the circles.
Package Dependency
Package Dependency view arranges the packages radially, drawing thick curves between
nodes. The thickness of the curve encodes the frequency of relations between two
CodeMR for IntelliJ IDEA - User Guide v2018
12
packages. If a chord is tapered, there are more relations from a given package than to it.
You can see the number of relation in the tool tip if you hover the chord between packages.
Project Outline
Outline view shows quality attributes and metrics of software elements in a structured tree
table. You can sort elements by column of different metrics and quality attributes and see the
most problematic elements quickly and jump to source code of selected element.
Outline View
Outline View is available inside the CodeMR main tool window. It is basically the same with
the project outline view in model editor. However it shows only the displayed classes in the
active graph editor. Additionally it has the following functionalities
Graph Relations
After drawing a graph you can still change the edge display options from the graph relation
views.
Label Queries
After that you can choose a grouping option to display a more modular graph and easy to
understand graph.
Modularization
You can modularize big graphs to see relations between modules and also inside the
modules. You can modularize graph by different algorithms:
● Project: classes of the same Eclipse Project (or Java Module in IntelliJ) are grouped
in the same module
● Package: classes of the same package are grouped in the same module.
● Clean: no group for all classes.
● Authoritative: grouping are manually given by the user.
● Fast Community: Graph automatically grouped by fast community modularization
algorithm.
by selecting working sets and clicking generate report button in the working set toolbar
of model editor.
Reports are generated for the whole project and also for each working set. You can navigate
between working sets via “working sets” menu on the top-right corner of the page.
HTMl report consists of four parts. The Dashboard, Detailed Metric List, Metric explanations,
and Graphs.
Dashboard part is very similar model editor in the IntelliJ IDE. it contains, general
information, distribution of quality and metric attributes, and also, sunburst, package
structure, treemap and package dependency charts.
Detailed metric tables part list classes and their metric values in different tables according to
their quality level.
By clicking the graph you can see and edit graphs in HTML form.
LCOM3 varies between 0 and 2. Values 1..2 are considered alarming. In a normal class
whose methods access the class's own variables, LCOM3 varies between 0 (high cohesion)
and 1 (no cohesion). When LCOM3=0, each method accesses all variables. This indicates
the highest possible cohesion. LCOM3=1 indicates extreme lack of cohesion. In this case,
the class should be split.
When there are variables that are not accessed by any of the class's methods, 1 < LCOM3
<= 2. This happens if the variables are dead or they are only accessed outside the class.
Both cases represent a design flaw. The class is a candidate for rewriting as a module.
Alternatively, the class variables should be encapsulated with accessor methods or
properties. There may also be some dead variables to remove. If there are no more than one
method in a class, LCOM3 is undefined. If there are no variables in a class, LCOM3 is
undefined. An undefined LCOM3 is displayed as zero
[http://www.aivosto.com/project/help/pm-oo-cohesion.html]
LCAM Lack of Cohesion Among Methods(1-CAM)
Related Quality Attributes: Cohesion
CAM metric is the measure of cohesion based on parameter types of methods. LCAM =
1-CAM
Number of Fields
Related Quality Attributes: Size
The number of fields (attributes) in a class
Number of Methods
Related Quality Attributes: Size
The number of methods in a class.
Number of Static Fields
Related Quality Attributes: Size
The number of static fields in a class.
Number of Static Methods
Related Quality Attributes: Size
The number of static methods in a class.
Specialization Index
Related Quality Attributes: Complexity
Defined as NORM * DIT / NOM. The Specialization Index metric measures the extent to
which subclasses override their ancestors classes. This index is the ratio between the
number of overridden methods and total number of methods in a Class, weighted by the