Skip to content

Commit

Permalink
Merge pull request #1329 from akto-api-security/hotfix/fix_total_coun…
Browse files Browse the repository at this point in the history
…t_in_group

overwrite total APIs count if All APIs group is present
  • Loading branch information
notshivansh authored Aug 6, 2024
2 parents 2a048ef + a251364 commit 568287f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,19 @@ const transform = {
getCountInfo: (collectionsArr, coverageObject) => {
let urlsCount = 0 ;
let coverageCount = 0 ;
let allAPIsGroupActive = false;
collectionsArr.forEach((x) =>{
if (x.hasOwnProperty('type') && x.type === 'API_GROUP') {
if (x.id === 111111121) {
urlsCount = x.urlsCount;
allAPIsGroupActive = true;
}
return
}

urlsCount += x.urlsCount;
if(!allAPIsGroupActive){
urlsCount += x.urlsCount;
}
coverageCount += coverageObject[x.id] || 0 ;
})
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,19 @@ const transform = {
let sensitiveInRes = 0;
let totalTested = 0 ;

let allAPIsGroupActive = false;
collectionsData?.forEach((c) =>{
if (c.hasOwnProperty('type') && c.type === 'API_GROUP') {
if(c.id===111111121){
totalUrl = c.urlsCount;
allAPIsGroupActive = true;
}
return
}

if(!allAPIsGroupActive){
totalUrl += c.urlsCount ;
}
totalTested += c.testedEndpoints;
})

Expand Down

0 comments on commit 568287f

Please sign in to comment.