Skip to content

Commit 5c99f0d

Browse files
committed
fix: deterministic author order, proper None check, optional debt text (PR #1232)
1 parent 694fd9d commit 5c99f0d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

analysis/complexity_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def to_dict(self) -> dict:
6060
"max_complexity": self.max_complexity,
6161
"avg_complexity": round(self.avg_complexity, 2),
6262
"maintainability_index": round(self.maintainability_index, 2)
63-
if self.maintainability_index
63+
if self.maintainability_index is not None
6464
else None,
6565
"functions": [f.to_dict() for f in self.functions],
6666
}

analysis/debt_indicators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ def to_dict(self) -> dict:
7070

7171
# Debt marker patterns
7272
DEBT_PATTERNS = [
73-
(r"#\s*(TODO|FIXME|HACK|XXX|BUG|REFACTOR|OPTIMIZE|REVIEW)[:\s](.+)$", "python"),
73+
(r"#\s*(TODO|FIXME|HACK|XXX|BUG|REFACTOR|OPTIMIZE|REVIEW)[:\s](.*)$", "python"),
7474
(
75-
r"//\s*(TODO|FIXME|HACK|XXX|BUG|REFACTOR|OPTIMIZE|REVIEW)[:\s](.+)$",
75+
r"//\s*(TODO|FIXME|HACK|XXX|BUG|REFACTOR|OPTIMIZE|REVIEW)[:\s](.*)$",
7676
"typescript",
7777
),
7878
(
79-
r"/\*\s*(TODO|FIXME|HACK|XXX|BUG|REFACTOR|OPTIMIZE|REVIEW)[:\s](.+?)\*/",
79+
r"/\*\s*(TODO|FIXME|HACK|XXX|BUG|REFACTOR|OPTIMIZE|REVIEW)[:\s](.*?)\*/",
8080
"typescript",
8181
),
8282
]

analysis/git_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def calculate_bus_factor(file_stats: Dict[str, FileStats]) -> dict:
326326

327327
# Files with low bus factor (knowledge silos)
328328
knowledge_silos = [
329-
{"path": stats.path, "sole_author": list(stats.authors)[0]}
329+
{"path": stats.path, "sole_author": sorted(stats.authors)[0]}
330330
for stats in file_stats.values()
331331
if stats.author_count == 1 and stats.change_count >= 3
332332
]

0 commit comments

Comments
 (0)