Skip to content

Commit 5381cae

Browse files
committed
Fix some output inconsistency, incorrect use of detected framework types
1 parent 2594212 commit 5381cae

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

src/com/denimgroup/threadfix/cli/endpoints/EndpointMain.java

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,6 @@ public static void main(String[] args) {
167167

168168
if (printFormat == SIMPLE_JSON || printFormat == FULL_JSON) {
169169
allEndpoints.addAll(generatedEndpoints);
170-
} else {
171-
int i = 0;
172-
for (Endpoint endpoint : generatedEndpoints) {
173-
printEndpointWithVariants(i++, 0, endpoint);
174-
}
175170
}
176171
} else {
177172
projectsMissingEndpoints.add(job.sourceCodePath.getAbsolutePath());
@@ -195,16 +190,20 @@ public static void main(String[] args) {
195190
compositeFrameworkTypes.add(defaultFramework);
196191
}
197192

198-
Collection<Endpoint> newEndpoints = listEndpoints(rootFolder, list(defaultFramework));
193+
println("Beginning endpoint detection for '" + rootFolder.getAbsolutePath() + "' with " + compositeFrameworkTypes.size() + " framework types");
194+
for (FrameworkType subType : compositeFrameworkTypes) {
195+
println("Using framework=" + subType);
196+
}
197+
198+
Collection<Endpoint> newEndpoints = listEndpoints(rootFolder, compositeFrameworkTypes);
199+
200+
println("Finished endpoint detection for '" + rootFolder.getAbsolutePath() + "'");
201+
println(PRINTLN_SEPARATOR);
202+
199203
if (!newEndpoints.isEmpty()) {
200204
++numProjectsWithEndpoints;
201205
if (printFormat == SIMPLE_JSON || printFormat == FULL_JSON) {
202206
allEndpoints.addAll(newEndpoints);
203-
} else {
204-
int i = 0;
205-
for (Endpoint endpoint : newEndpoints) {
206-
printEndpointWithVariants(i++, 0, endpoint);
207-
}
208207
}
209208
} else {
210209
projectsMissingEndpoints.add(rootFolder.getAbsolutePath());
@@ -238,10 +237,10 @@ public static void main(String[] args) {
238237
}
239238
} else {
240239
int i = 0;
241-
for (Endpoint endpoint : allEndpoints) {
242-
//println(endpoint.getCSVLine(printFormat));
243-
i += printEndpointWithVariants(i, 0, endpoint);
244-
}
240+
// for (Endpoint endpoint : allEndpoints) {
241+
// //println(endpoint.getCSVLine(printFormat));
242+
// i += printEndpointWithVariants(i, 0, endpoint);
243+
// }
245244
}
246245
}
247246

@@ -425,6 +424,11 @@ private static List<Endpoint> listEndpoints(File rootFile, Collection<FrameworkT
425424

426425
totalDetectedEndpoints += numEndpoints;
427426

427+
int i = 0;
428+
for (Endpoint endpoint : endpoints) {
429+
printEndpointWithVariants(i++, 0, endpoint);
430+
}
431+
428432
if (endpoints.isEmpty()) {
429433
println("No endpoints were found.");
430434

0 commit comments

Comments
 (0)