migration: prove standalone maintenance and correct visual evidence
This commit is contained in:
@@ -75,6 +75,14 @@ def css_layers(html: str) -> list[str]:
|
||||
return re.findall(r'<link[^>]+rel="stylesheet"[^>]+href="([^"]+)"', html)
|
||||
|
||||
|
||||
def source_metrics(path: Path) -> dict[str, int]:
|
||||
text = path.read_text(encoding="utf-8")
|
||||
return {
|
||||
"bytes": len(text.encode("utf-8")),
|
||||
"lines": len(text.splitlines()),
|
||||
}
|
||||
|
||||
|
||||
def code_hotspots() -> list[dict[str, Any]]:
|
||||
candidates = [
|
||||
"backend/application.py",
|
||||
@@ -99,13 +107,7 @@ def code_hotspots() -> list[dict[str, Any]]:
|
||||
path = ROOT / name
|
||||
if not path.is_file():
|
||||
continue
|
||||
rows.append(
|
||||
{
|
||||
"path": name,
|
||||
"bytes": path.stat().st_size,
|
||||
"lines": len(path.read_text(encoding="utf-8").splitlines()),
|
||||
}
|
||||
)
|
||||
rows.append({"path": name, **source_metrics(path)})
|
||||
return sorted(rows, key=lambda item: item["bytes"], reverse=True)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user