@@ -92,6 +92,8 @@ public void execute(
92
92
boolean analyzeCycles ,
93
93
boolean showDetails ,
94
94
boolean minifyHtml ,
95
+ boolean excludeTests ,
96
+ String testSourceDirectory ,
95
97
String projectName ,
96
98
String projectVersion ,
97
99
File baseDir ,
@@ -107,8 +109,15 @@ public void execute(
107
109
stringBuilder .append (printTitle (projectName , projectVersion ));
108
110
stringBuilder .append (printHead ());
109
111
stringBuilder .append ("</head>" );
110
- stringBuilder .append (
111
- generateReport (showDetails , projectName , projectVersion , baseDir , edgeAnalysisCount , analyzeCycles ));
112
+ stringBuilder .append (generateReport (
113
+ showDetails ,
114
+ edgeAnalysisCount ,
115
+ analyzeCycles ,
116
+ excludeTests ,
117
+ testSourceDirectory ,
118
+ projectName ,
119
+ projectVersion ,
120
+ baseDir ));
112
121
113
122
stringBuilder .append (printProjectFooter ());
114
123
stringBuilder .append (THE_END );
@@ -125,23 +134,41 @@ public void execute(
125
134
126
135
public StringBuilder generateReport (
127
136
boolean showDetails ,
137
+ int edgeAnalysisCount ,
138
+ boolean analyzeCycles ,
139
+ boolean excludeTests ,
140
+ String testSourceDirectory ,
128
141
String projectName ,
129
142
String projectVersion ,
130
- File baseDir ,
131
- int edgeAnalysisCount ,
132
- boolean analyzeCycles ) {
133
- return generateReport (showDetails , projectName , projectVersion , baseDir , 200 , edgeAnalysisCount , analyzeCycles );
143
+ File baseDir ) {
144
+ return generateReport (
145
+ showDetails ,
146
+ edgeAnalysisCount ,
147
+ analyzeCycles ,
148
+ excludeTests ,
149
+ testSourceDirectory ,
150
+ projectName ,
151
+ projectVersion ,
152
+ baseDir ,
153
+ 200 );
134
154
}
135
155
136
156
// pixels param is for SVG image pixel padding
137
157
public StringBuilder generateReport (
138
158
boolean showDetails ,
159
+ int edgeAnalysisCount ,
160
+ boolean analyzeCycles ,
161
+ boolean excludeTests ,
162
+ String testSourceDirectory ,
139
163
String projectName ,
140
164
String projectVersion ,
141
165
File baseDir ,
142
- int pixels ,
143
- int edgeAnalysisCount ,
144
- boolean analyzeCycles ) {
166
+ int pixels ) {
167
+
168
+ if (testSourceDirectory == null || testSourceDirectory .isEmpty ()) {
169
+ testSourceDirectory = "src" + File .separator + "test" ;
170
+ }
171
+
145
172
this .pixels = pixels ;
146
173
StringBuilder stringBuilder = new StringBuilder ();
147
174
stringBuilder .append (printOpenBodyTag ());
@@ -204,9 +231,9 @@ public StringBuilder generateReport(
204
231
List <RankedCycle > rankedCycles = List .of ();
205
232
if (analyzeCycles ) {
206
233
log .info ("Analyzing Cycles" );
207
- rankedCycles = cycleRanker .performCycleAnalysis ();
234
+ rankedCycles = cycleRanker .performCycleAnalysis (excludeTests , testSourceDirectory );
208
235
} else {
209
- cycleRanker .generateClassReferencesGraph ();
236
+ cycleRanker .generateClassReferencesGraph (excludeTests , testSourceDirectory );
210
237
}
211
238
212
239
classGraph = cycleRanker .getClassReferencesGraph ();
0 commit comments