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

Function addFinding

background.js:443–464  ·  view source on GitHub ↗
(type, data)

Source from the content-addressed store, hash-verified

441}
442
443async function addFinding(type, data) {
444 const findings = await getFindings();
445
446 const exists = findings[type].some(f => {
447 if (type === 'params') return f.url === data.url;
448 if (type === 'headers') return f.url === data.url && f.header === data.header;
449 return f.path === data.path;
450 });
451
452 if (!exists) {
453 findings[type].push({ ...data, timestamp: Date.now() });
454 findings[type].sort((a, b) => {
455 const scores = { critical: 4, high: 3, medium: 2, low: 1 };
456 return (scores[b.severity] || 0) - (scores[a.severity] || 0);
457 });
458 await saveFindings(findings);
459
460 const colors = { critical: '#e74c3c', high: '#e67e22', medium: '#f1c40f', low: '#3498db' };
461 console.log(`%c[debugHunter] [${data.severity?.toUpperCase()}] ${type}: ${data.url || data.path}`,
462 `background: ${colors[data.severity] || '#27ae60'}; color: white; padding: 2px 6px; border-radius: 3px`);
463 }
464}
465
466async function removeFinding(type, identifier) {
467 const findings = await getFindings();

Callers 3

checkParamsFunction · 0.85
checkHeadersFunction · 0.85
checkPathsFunction · 0.85

Calls 2

saveFindingsFunction · 0.85
getFindingsFunction · 0.70

Tested by

no test coverage detected