MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / formatScanReport

Function formatScanReport

src/skills/security-scan.ts:172–181  ·  view source on GitHub ↗
(result: ScanResult, skillName: string)

Source from the content-addressed store, hash-verified

170
171/** Format a scan result for the CLI. Returns null when clean. */
172export function formatScanReport(result: ScanResult, skillName: string): string | null {
173 if (result.severity === 'clean') return null;
174 const head = result.severity === 'dangerous'
175 ? `\u26d4 Skill "${skillName}" failed the security scan (${result.findings.length} finding(s)):`
176 : `\u26a0\ufe0f Skill "${skillName}" has ${result.findings.length} suspicious finding(s):`;
177 const lines = result.findings.map(f =>
178 ` [${f.severity}] ${f.rule}: ${f.detail}\n ↳ ${f.evidence}`,
179 );
180 return [head, ...lines].join('\n');
181}

Callers 3

buildSkillCommandFunction · 0.85
copyIntoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected