Skip to content

Commit

Permalink
Changing the summary with regard to new result collection
Browse files Browse the repository at this point in the history
  • Loading branch information
Ark2307 committed Jan 14, 2025
1 parent 21a1ab2 commit b23ebd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,14 @@ public void run() {
countIssuesMap.put(Severity.LOW.toString(), 0);

// update summaries accordingly with issues ignored

// TODO: fix this smartly
Map<ObjectId,String> mapSummaryToResultId = TestingRunResultDao.instance.mapSummaryIdToTestingResultHexId(testingRunResultHexIdsMap.keySet());
// currently we change the summaries from result page only
// so only 1 result comes at a time
// Map<String,String> testingRunResultHexIdsMap has only 1 result.

Map<ObjectId,String> mapSummaryToResultId = VulnerableTestingRunResultDao.instance.mapSummaryIdToTestingResultHexId(testingRunResultHexIdsMap.keySet());
if(mapSummaryToResultId.isEmpty()){
mapSummaryToResultId = TestingRunResultDao.instance.mapSummaryIdToTestingResultHexId(testingRunResultHexIdsMap.keySet());
}
Map<ObjectId,Map<String,Integer>> summaryWiseCountMap = new HashMap<>();

for(ObjectId summaryId: mapSummaryToResultId.keySet()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,7 @@ public Map<ObjectId,String> mapSummaryIdToTestingResultHexId(Set<String> testing
.map(ObjectId::new)
.collect(Collectors.toList());

// doing only for 1000 results at a time
objectIdList = objectIdList.subList(0, 1000);

List<TestingRunResult> runResults = instance.findAll(Filters.in(Constants.ID, objectIdList), Projections.include(TestingRunResult.TEST_RUN_RESULT_SUMMARY_ID));
List<TestingRunResult> runResults = this.findAll(Filters.in(Constants.ID, objectIdList), Projections.include(TestingRunResult.TEST_RUN_RESULT_SUMMARY_ID));
for(TestingRunResult runResult: runResults){
finalMap.put(runResult.getTestRunResultSummaryId(), runResult.getHexId());
}
Expand Down

0 comments on commit b23ebd6

Please sign in to comment.