|
| 1 | +[](https://travis-ci.com/tushartushar/dj_Intellij) |
| 2 | + |
| 3 | +# IntelliJ plugin of DesigniteJava |
| 4 | +The plugin analyzes your Java projects and detects implementation, design, architecture, test and testability code smells. |
| 5 | +It also computes common code quality metrics to measure complexity, cohesion, and coupling. |
| 6 | +The plugin tags methods and classes within IntelliJ suffering from smells to motivate you to refactor the method or class. |
| 7 | +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. |
| 8 | +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 |
| 9 | +the project with statistical data. |
| 10 | +The plugin uses DesigniteJava to analyze Java source code. |
| 11 | + |
| 12 | +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. |
| 13 | + |
| 14 | +#### Build Instructions |
| 15 | +###### Prerequisites |
| 16 | +1. Gradle 7.5.1 |
| 17 | +2. Java 17 |
| 18 | +3. Change gradle configuration: |
| 19 | + 1. Open gradle folder in the project directory |
| 20 | + 2. Open wrapper folder |
| 21 | + 3. Open gradle-wrapper.properties |
| 22 | + 4. Update "distributionUrl" to distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip |
| 23 | + |
| 24 | +###### Dependencies |
| 25 | +1. 'org.mockito:mockito-inline:3.12.4' |
| 26 | + |
| 27 | + Library added to provide the mocking framework |
| 28 | +2. 'org.mockito:mockito-junit-jupiter:3.12.4' |
| 29 | + |
| 30 | + Library added to provide the ide mocking framework |
| 31 | +3. 'org.knowm.xchart:xchart:3.8.1' |
| 32 | + |
| 33 | + Library added to create graphs on UI |
| 34 | + |
| 35 | +###### Build |
| 36 | +- Run command “./gradlew shadowJar” |
| 37 | + |
| 38 | +###### Install plugin |
| 39 | +1. Open IntelliJ |
| 40 | +2. Open IntelliJ settings |
| 41 | +3. Go to plugins |
| 42 | +4. Click on the settings icon and select install plugin from the disk |
| 43 | +5. Go to the project directory --> build --> libs --> select the .jar file |
| 44 | + |
| 45 | +###### How to Run Plugin |
| 46 | +1. Go to Tools --> DesigniteJava > Analyze Code |
| 47 | +2. Wait for the processing to complete |
| 48 | +3. Restart IntelliJ |
| 49 | +4. On the bottom right side, you will find the DesigniteJava button click on that to see the code smells |
| 50 | +5. To see the UI, go to Tools --> DesigniteJava --> Analysis Report |
| 51 | + |
| 52 | +###### Milestones |
| 53 | +1. Detect test smells - DONE |
| 54 | +2. Detect Architecture smells - DONE |
| 55 | +3. Show the progress bar on the Taskbar - DONE |
| 56 | +4. Navigating to the code lines on click of links in the DesigniteJava Tool window - DONE |
| 57 | +5. UI to show project-level information using charts and tables – DONE |
| 58 | + |
| 59 | +###### Milestones added after the mid-term review |
| 60 | +1. Add testability smells - DONE |
| 61 | + |
| 62 | + |
| 63 | +## Features |
| 64 | + |
| 65 | +### 1. Project Level User-Interface: |
| 66 | +The statistical format taken in UI depicts the smell distribution over the entire project |
| 67 | +as well as the project level metrics. |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +### 2. Specific Snell User-Interface: |
| 72 | +The statistical format taken in UI depicts the smell distribution over the entire project of a |
| 73 | +particular smell level i.e. design, implementation etc. It shows the various smell types that |
| 74 | +occur in the project. |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +### 3. Test smells: |
| 79 | +The test smells specific to a class can be seen in the tool window and the line marker with clickable links. |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | +### 4. Architecture smells: |
| 84 | +The architecture smells specific to that package can be seen in the tool window and the line marker with clickable links. |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | +### 5. Testability smells: |
| 89 | +The testability smells specific to a class can be seen in the tool window and the line marker with clickable links. |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +### 6. Progress Bar: |
| 94 | +The video demonstrates the implementation of a progress bar in the project. |
| 95 | + |
| 96 | +[Click here to see demonstration of the Progress Bar](https://youtu.be/XpiTzPRpIfA) |
| 97 | + |
| 98 | +### 7. Method Links: |
| 99 | +The video demonstrates the functioning of method links added for test and implementation smells in Designite Tool window in the project. |
| 100 | + |
| 101 | +[Click here to see demonstration](https://youtu.be/MQ3TxMR_MQ0) |
| 102 | + |
| 103 | +### 8. Class Link: |
| 104 | +The video demonstrates the functioning of Class links added for design and testability smells in the project. |
| 105 | + |
| 106 | +[Click here to see demonstration](https://youtu.be/_Lbp1ES6VFE) |
| 107 | + |
| 108 | +### 9. Package Link : |
| 109 | +The video demonstrates the functioning of Package links added in Architecture smells in the project. |
| 110 | + |
| 111 | +[Click here to see demonstration](https://youtu.be/xtCmkN4FShg) |
| 112 | + |
| 113 | +## Smells |
| 114 | +Existing coding practice have been followed during the addition of new features in the project. |
| 115 | +This is why there are multiple smells. |
| 116 | + |
| 117 | +Also, the creation of a user-interface required us to add a number of characteristics like |
| 118 | +height, width, border etc to the elements. That has resulted in a large number of magic number code |
| 119 | +smells. |
| 120 | + |
| 121 | +The link to smells list and their justifications is added |
| 122 | +[here](src/main/resources/Reports/CodeSmellSummary.xlsx) |
| 123 | + |
| 124 | +## Contribution Statement and rating |
| 125 | +The link to contribution statement for the group [here](src/main/resources/Reports/group2.docx) |
| 126 | + |
| 127 | +### Link to Jira Board [Group: 2 Designite](https://group25308.atlassian.net/jira/software/projects/IIP/boards/1) |
| 128 | + |
| 129 | + |
| 130 | +### Test coverage |
| 131 | +- We were not able to achieve good test coverage as most of our project deals with file system and UI elements. |
0 commit comments