Answer prose round 1: allow a bare :line in the history's format, date the shortened paths, say slots for top k, list the notes in --help, say no run could be scored, plainer item 85, 73 and 77 text, and the tools' path line

This commit is contained in:
2026-10-08 23:11:36 +02:00
parent a69cfd2624
commit 5cc37dd861
7 changed files with 25 additions and 22 deletions
+2 -2
View File
@@ -82,9 +82,9 @@ def cognitive(function: ast.FunctionDef | ast.AsyncFunctionDef) -> int:
return inside(function.body, 0, function.name)
# One case per node type, as the white paper's table has one row per structure: split, the rules would scatter.
# One case per node type, as the white paper gives one rule per structure.
def score(node: ast.AST, nesting: int, name: str) -> int:
"""The cognitive complexity node adds at depth nesting, its children included; name is the function's own, a call to it counting as recursion."""
"""The cognitive complexity `node` adds, its children included, at nesting depth `nesting`; a call to `name`, the function's own, counts as recursion."""
if isinstance(node, ast.If):
return 1 + nesting + branches(node, nesting, name)
if isinstance(node, ast.For | ast.AsyncFor | ast.While):