Skip to content

Commit

Permalink
Replace special symbol (#100)
Browse files Browse the repository at this point in the history
* Remove duplicated methods

* Replace special symbols ('✔','✖') with text ('OK', 'X')
  • Loading branch information
fea-devteam authored Jul 25, 2022
1 parent 697cd09 commit aa653da
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/main/java/eu/assuremoss/utils/Statistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void createRepairedVulnSum(List<VulnerabilityEntry> vulnEntries, String p
for (String vulnType : vulnTypes) {
int foundVuln = Collections.frequency(allVulnTypes, vulnType);
int repairedVuln = countRepairedVuln(directory.listFiles(), vulnType);
String status = foundVuln == repairedVuln ? "" : "";
String status = foundVuln == repairedVuln ? "OK" : "X";
writer.write(String.format(" - %s %d/%d %s\n", status, repairedVuln, foundVuln, vulnType));
}

Expand Down Expand Up @@ -150,7 +150,7 @@ public void createVulnStatistic(List<VulnerabilityEntry> vulnEntries, String pat
writer.write(statisticsCSVHeader());
for (int i = 0; i < vulnEntries.size(); i++) {
VulnerabilityEntry vulnEntry = vulnEntries.get(i);
String status = isPatchGeneratedForVuln(directory.listFiles(), vulnEntry) ? "" : "";
String status = isPatchGeneratedForVuln(directory.listFiles(), vulnEntry) ? "OK" : "X";
writer.write(statisticsCSVFormat(i + 1, vulnEntry, status));
}

Expand Down
16 changes: 8 additions & 8 deletions src/test/results/expected/vuln_entries_result.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ID,Type,Status,Message,Generated,Filtered,Verified
1,EI_EXPOSE_REP2,,ok,2,2,2
2,EI_EXPOSE_REP2,,ok,2,2,2
3,EI_EXPOSE_REP2,,ok,2,2,2
4,EI_EXPOSE_REP2,,ok,2,2,2
5,MS_SHOULD_BE_FINAL,,ok,1,1,1
6,EI_EXPOSE_REP,,ok,2,2,2
7,EI_EXPOSE_REP2,,ok,3,2,2
8,NP_NULL_ON_SOME_PATH,,ok,1,1,1
1,EI_EXPOSE_REP2,OK,ok,2,2,2
2,EI_EXPOSE_REP2,OK,ok,2,2,2
3,EI_EXPOSE_REP2,OK,ok,2,2,2
4,EI_EXPOSE_REP2,OK,ok,2,2,2
5,MS_SHOULD_BE_FINAL,OK,ok,1,1,1
6,EI_EXPOSE_REP,OK,ok,2,2,2
7,EI_EXPOSE_REP2,OK,ok,3,2,2
8,NP_NULL_ON_SOME_PATH,OK,ok,1,1,1
8 changes: 4 additions & 4 deletions src/test/results/expected/vuln_found_result.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Detected 8 vulnerabilities
- 5/5 EI_EXPOSE_REP2
- 1/1 EI_EXPOSE_REP
- 1/1 NP_NULL_ON_SOME_PATH
- 1/1 MS_SHOULD_BE_FINAL
- OK 5/5 EI_EXPOSE_REP2
- OK 1/1 EI_EXPOSE_REP
- OK 1/1 NP_NULL_ON_SOME_PATH
- OK 1/1 MS_SHOULD_BE_FINAL

0 comments on commit aa653da

Please sign in to comment.