The plugin analyzes your Java projects and detects implementation, design, architecture, test and testability code smells. It also computes common code quality metrics to measure complexity, cohesion, and coupling. The plugin tags methods and classes within IntelliJ suffering from smells to motivate you to refactor the method or class. Also, the plugin shows a tool window that lists code quality information (i.e., smells and metrics) of the active file to keep an eye on the code quality. It also shows in-line code smells with the help of a marker. There is a UI tool window that reports the total number of smells in the project with statistical data. The plugin uses DesigniteJava to analyze Java source code.
Note: As we started on an existing project, we followed the existing coding practices and tried to extend the original project as much as possible.
- Gradle 7.5.1
- Java 17
- Change gradle configuration:
- Open gradle folder in the project directory
- Open wrapper folder
- Open gradle-wrapper.properties
- Update "distributionUrl" to distributionUrl=https://services.gradle.org/distributions/gradle-7.5.1-bin.zip
-
'org.mockito:mockito-inline:3.12.4'
Library added to provide the mocking framework
-
'org.mockito:mockito-junit-jupiter:3.12.4'
Library added to provide the ide mocking framework
-
'org.knowm.xchart:xchart:3.8.1'
Library added to create graphs on UI
- Run command “./gradlew shadowJar”
- Open IntelliJ
- Open IntelliJ settings
- Go to plugins
- Click on the settings icon and select install plugin from the disk
- Go to the project directory --> build --> libs --> select the .jar file
- Go to Tools --> DesigniteJava > Analyze Code
- Wait for the processing to complete
- Restart IntelliJ
- On the bottom right side, you will find the DesigniteJava button click on that to see the code smells
- To see the UI, go to Tools --> DesigniteJava --> Analysis Report
- Detect test smells - DONE
- Detect Architecture smells - DONE
- Show the progress bar on the Taskbar - DONE
- Navigating to the code lines on click of links in the DesigniteJava Tool window - DONE
- UI to show project-level information using charts and tables – DONE
- Add testability smells - DONE
The statistical format taken in UI depicts the smell distribution over the entire project as well as the project level metrics.
The statistical format taken in UI depicts the smell distribution over the entire project of a particular smell level i.e. design, implementation etc. It shows the various smell types that occur in the project.
The test smells specific to a class can be seen in the tool window and the line marker with clickable links.
The architecture smells specific to that package can be seen in the tool window and the line marker with clickable links.
The testability smells specific to a class can be seen in the tool window and the line marker with clickable links.
The video demonstrates the implementation of a progress bar in the project.
Click here to see demonstration of the Progress Bar
The video demonstrates the functioning of method links added for test and implementation smells in Designite Tool window in the project.
Click here to see demonstration
The video demonstrates the functioning of Class links added for design and testability smells in the project.
Click here to see demonstration
The video demonstrates the functioning of Package links added in Architecture smells in the project.
Click here to see demonstration
Existing coding practice have been followed during the addition of new features in the project. This is why there are multiple smells.
Also, the creation of a user-interface required us to add a number of characteristics like height, width, border etc to the elements. That has resulted in a large number of magic number code smells.
The link to smells list and their justifications is added here
The link to contribution statement for the group here
Link to Jira Board Group: 2 Designite
- We were not able to achieve good test coverage as most of our project deals with file system and UI elements.