1.2. Basic Analysis

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:

  1. 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.

  2. Examine the detected issues on the Issues view.

  3. 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.

  4. Check the detected package cycles in the Cycle Groups view, open one of them in the Cycle view for closer inspection.

  5. 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.

  6. 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.

  7. 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.

  8. 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, they re-appear in the Issues view.

  9. 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.).

  10. 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.

  11. Specify an exclude filter on the Workspace view by right-clicking on the "Filter" node shown above the root directories. Experiment with the wildcards to exclude test related classes. Check that new issues appear in the Issues view.

  12. 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".

  13. 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 dependencies being shown in the representation views (Exploration view, Graph view).

  14. Create a new script by selecting the "Scripts" folder on the Files view and opening the context menu.

  15. Modify the default content to check for all types being excluded.

End of Step 1 (step1_crm-domain-example.sonargraph).

Related topics: