The following steps describe the first analysis of a code base based on the existing dependencies, detected cyclic dependencies, detected duplicate blocks and further metrics:
-
Select packages in the Navigation View and open them via the context menu in the Graph view and Exploration view to see/examine their existing dependencies. Experiment with the different options for creating the representations. Experiment also with the options provided on the opened views to focus on different dependency types, etc.
-
Examine the detected issues on the Issues view.
-
Customize the duplicate code analyzer via the menu "System" -> "Configure..." -> "Duplicate Code" and specify a smaller minimum block length (e.g. 20 lines), so that duplicates are detected. Use the Duplicate Blocks view to open a side-by-side diff for closer inspection.
-
Check the detected package cycles in the Cycle Groups view, open one of them in the Cycle view for closer inspection.
-
Right-click anywhere on the white area in the Cycle view to show the cyclic elements in the Exploration view for further investigation.
-
Right-click anywhere on the white area in the Cycle view to open the Cycle Breakup view. Compute a break-up set for the cycle.
-
Right-click on the proposed dependency to remove and create a new "Delete Refactoring" via the context menu. The created task is now visible in the Tasks and Refactorings views.
-
Create a resolution for another issue in the Issues view. Check the filter options of the view in the top right corner to show only issues of a certain category.
-
Switch the Virtual Model on the application's tool bar (top right of the application) and select the "Parser" model in the combo box. Since the resolutions are specific to the Virtual Model, the issues re-appear in the Issues view.
-
Select the Metrics view and examine the values for the system. Use the combo box at the top-left of the view to examine metric values on other levels (Java Package, Source File, Routine, etc.). Multi-select metrics and see if you can detect a correlation. Define a threshold and check the value distribution on the histogram and pie charts.
-
Check where JUnit is used: Open the Exploration view for the JUnit package that is contained in the "External [Java]" node in the Navigation view.
-
Specify an exclude filter on the Workspace view by right-clicking on one of the "Filter" nodes shown above the root directories. Check the context help (F1) and the related chapter in the user manual to get more information about the different filter types. Experiment with the wildcards and filter types to exclude test related classes. Check that the number of issues in the Issues view changes. Use the filter that keeps the test related classes in the Sonargraph model but marks them as "excluded".
-
Irrelevant issues can be either ignored or filtered. Click on the little downwards-pointing white triangle in the top-right corner of the Issues view and open the filter dialog. Deselect the issue type "Dependency To Excluded Internal Component".
-
Ctrl+H opens the search dialog. Enter **test* to identify test classes (they should all be marked as excluded).
Note: If all internal types are filtered out with references to JUnit, there will be no more dependencies being shown in the representation views (Exploration view, Graph view) to these external types.
-
Create a new script by selecting the "Scripts" folder on the Files view and opening the context menu.
-
Modify the default content to check for all types being excluded.
End of Step 1 (step1_crm-domain-example.sonargraph).
Related topics: