MCPcopy Index your code
hub / github.com/devploit/debugHunter / updateBadge

Function updateBadge

background.js:486–498  ·  view source on GitHub ↗
(findings)

Source from the content-addressed store, hash-verified

484}
485
486function updateBadge(findings) {
487 const total = findings.params.length + findings.headers.length + findings.paths.length;
488 const all = [...findings.params, ...findings.headers, ...findings.paths];
489 const hasCritical = all.some(f => f.severity === 'critical');
490 const hasHigh = all.some(f => f.severity === 'high');
491
492 let color = '#3498db';
493 if (hasCritical) color = '#e74c3c';
494 else if (hasHigh) color = '#e67e22';
495
496 chrome.action.setBadgeText({ text: total > 0 ? total.toString() : '' });
497 chrome.action.setBadgeBackgroundColor({ color });
498}
499
500// ============================================================================
501// SCAN STATUS

Callers 2

saveFindingsFunction · 0.85
background.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected