MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / write_report

Function write_report

scripts/website/audit_source_urls.py:90–104  ·  view source on GitHub ↗
(findings: List[Finding], report_file: Path)

Source from the content-addressed store, hash-verified

88
89
90def write_report(findings: List[Finding], report_file: Path) -> None:
91 report_file.parent.mkdir(parents=True, exist_ok=True)
92 lines = []
93 lines.append(f"Total findings: {len(findings)}")
94 by_kind: dict[str, int] = {}
95 for f in findings:
96 by_kind[f.kind] = by_kind.get(f.kind, 0) + 1
97 for kind in sorted(by_kind):
98 lines.append(f"- {kind}: {by_kind[kind]}")
99 lines.append("")
100 for f in findings:
101 lines.append(
102 f"{f.kind} {f.file}:{f.line_no} :: {f.url} :: suggestion={f.suggestion}"
103 )
104 report_file.write_text("\n".join(lines) + "\n", encoding="utf-8")
105
106
107def main() -> int:

Callers 1

mainFunction · 0.85

Calls 4

appendMethod · 0.65
getMethod · 0.65
joinMethod · 0.65
mkdirMethod · 0.45

Tested by

no test coverage detected