Skip to content

Commit

Permalink
feat: using vul array length instead of count
Browse files Browse the repository at this point in the history
  • Loading branch information
TangoBeeAkto committed Dec 21, 2024
1 parent 0fac255 commit edcf798
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const VulnerabilityReport = () => {
const [totalApisTested, setTotalApisTested] = useState(0)
const [subCategoryMap, setSubCategoryMap] = useState({})

const issuesLimit = 500

const pdfRef = useRef()
const params = useParams()
const testingRunSummaryId = params.summaryId
Expand Down Expand Up @@ -107,8 +109,8 @@ const VulnerabilityReport = () => {
testingRunCountsFromDB = resp.testingRunResults.length
})
resultsCount += 50
if(resultsCount >= 500) {
func.setToast(true, false, "Displaying the vulnerability report with only first 500 issues.")
if(vulnerableTestingRunResults.length >= issuesLimit) {
func.setToast(true, false, "Displaying the vulnerability report with only first " + issuesLimit + " issues.")
break
}

Expand All @@ -127,13 +129,23 @@ const VulnerabilityReport = () => {
//sampleDataVsCurlMap = { ...sampleDataVsCurlMap, ...resp.sampleDataVsCurlMap }
})
resultsCount += 50
if(vulnerableTestingRunResults.length >= issuesLimit) {
func.setToast(true, false, "Displaying the vulnerability report with only first " + issuesLimit + " issues.")
break
}
if (testingRunCountsFromDB < 50 || resultsCount >= 1000) {
//EOF: break as no further documents exists
break
}
}
}

if(vulnerableTestingRunResults.length > issuesLimit) {
while(vulnerableTestingRunResults.length !== issuesLimit) {
vulnerableTestingRunResults.pop()
}
}

const localCategoryMap = LocalStore.getState().categoryMap
const localSubCategoryMap = LocalStore.getState().subCategoryMap
let shouldFetchSubcategoriesAndCategories = false
Expand Down

0 comments on commit edcf798

Please sign in to comment.