Skip to content

Commit 4a580b2

Browse files
Update README.md
Added instructions on how to run analysis on Gradle projects. Added additional helpful text.
1 parent a9bc35f commit 4a580b2

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# RefactorFirst
22

3-
This tool for Java codebases will help you identify the God Classes you should refactor first.
4-
The graph generated in the report will look similar to this one:
3+
This tool for Java codebases will help you identify the God Classes and classes with High Coupling you should refactor first.
4+
It runs PMD's God Class Rule and Coupling Between Objects rule and scans your Git repository history.
5+
6+
The graphs generated in the report will look similar to this one:
57
![image info](./RefactorFirst_Sample_Report.png)
68

79
## There are several ways to run the analysis on your codebase:
@@ -50,8 +52,32 @@ Not supported as of Version 0.2.0 due to CVE-2020-13936
5052
</reporting>
5153
```
5254

55+
## But I'm using Gradle / my project layout isn't typical!
56+
I would like to create a Gradle plugin and (possibly) support non-conventional projects in the future, but in the meantime you can create a dummy POM file in the same directory as your .git directory:
57+
58+
```xml
59+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
60+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
61+
<modelVersion>4.0.0</modelVersion>
62+
63+
<groupId>com.mycompany.app</groupId>
64+
<artifactId>my-app</artifactId>
65+
<version>1.0-SNAPSHOT</version>
66+
</project>
67+
```
68+
and then (assuming Maven is installed) run
69+
70+
```bash
71+
mvn org.hjug.refactorfirst.plugin:refactor-first-maven-plugin:0.4.0:report
72+
```
73+
5374
## Viewing the Report
54-
Once the plugin finishes executing (it may take a while for a large / old codebase), open the file **target/site/refactor-first-report.html** in the root of the project. It will contain a graph similar to the one above, and a table that lists God classes in the recommended order that they should be refactored. The classes in the top left of the graph are the easiest to refactor while also having the biggest positive impact to team productivity.
75+
Once the plugin finishes executing (it may take a while for a large / old codebase), open the file **target/site/refactor-first-report.html** in the root of the project. It will contain a graph similar to the one above, and a table that lists God classes in the recommended order that they should be refactored. The classes in the top left of the graph are the easiest to refactor while also having the biggest positive impact to team productivity.
76+
If highly coupled classes are detected, a graph and table listing Highly Coupled Classes in will be generated.
77+
78+
## I have the report. Now What???
79+
Work with your Product Owner to prioritize the technical debt that has been identified. It may help to explain it as hidden negative value that is slowing team porductivity.
80+
If you have IntelliJ Ultimate, you can install the [Method Reference Diagram](https://plugins.jetbrains.com/plugin/7996-java-method-reference-diagram) plugin to help you determine how the identified God classes and Highly Coupled classes can be refactored.
5581

5682

5783
## Additional Details
@@ -67,6 +93,7 @@ There is still much to be done. Your feedback and collaboration would be greatl
6793
If you find this plugin useful, please star this repository and share with your friends & colleagues and on social media.
6894

6995
## Future Plans
96+
* Identify class cycles and prioritize them.
7097
* Add a Gradle plugin.
7198
* Incorporate Unit Test coverage metrics to quickly identify the safety of refactoring a God class.
7299
* Incorporate bug counts per God class to the Impact (Y-Axis) calculation.

0 commit comments

Comments
 (0)