Sample

Dorn/python/77

Human rating uses the original dataset scale.

DatasetDorn
Human3.34
Lines30

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
50.4Δ 1.4
Dorn0.7380–1; higher is more readable
70.2Δ 21.2
Mi0.640–1; higher is more readable
70.5Δ 21.4
LLOC20Logical lines; fewer is more readable
32.5Δ 16.6
DeepSeek V4 Pro14.670–20; mean of three runs
74.1Δ 25.1
GPT-6.1 Sol150–20; mean of three runs
52.8Δ 3.8
BTTF0.5840–1; higher is more readable
69.9Δ 20.9
Human3.341–5; original rating
49.0

Views

Download official ZIP ↗

Select the downloaded ZIP or its extracted folder. Files stay in your browser.

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.739.345−24.398
Source linesThe number of non-empty source lines.30+12
Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value.4.292−6.438

Intercept 8.87 + feature contributions = -9.967 (log-odds).
Score = sigmoid(-9.967) = 0.

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.72.871+0.371
Identifier layout (horizontal)How rapidly the visual pattern of identifier characters changes from left to right. It measures spatial frequency, not the meaning of the names.78+0.361
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.06+0.357
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.24−0.13
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.31−0.061
Indentation frequencyHow rapidly indentation changes from line to line.23+0.058
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.29.759+0.006

Intercept 0.07 + feature contributions = 1.033 (log-odds).
Score = sigmoid(1.033) = 0.738.

Score0.64
Score20
Run 1

The code is reasonably readable: it has clear helper functions, logical structure, and short, purposeful methods. Indentation is shallow and each line generally performs one action. However, readability is reduced by the unexplained 'level' logic, the unusual loop counter usage in `_resolve_name` (iterating from `level` down to 1), and a missing initial context for the first six lines (which appear to be a fragment). Variable names like `dot` are somewhat ambiguous. The `_import_module` function is straightforward, but the absence of full function context and use of `__import__` with `sys.modules` adds cognitive load.

Run 2

The code is generally structured logically, with helper functions separated and docstrings explaining purpose. However, readability is reduced by a few issues: the first function begins mid-logic with a raise statement, which obscures context. Variable names like 'dot' and 'x' are somewhat vague. The nested try/except and loop create moderate cognitive overhead. The reading flow is disrupted because the first function lacks its function signature, making it hard to understand input/output. Action granularity is mostly one action per line, but some lines combine multiple operations. Overall, the code is understandable but could be clearer with better naming, division of responsibilities, and less abrupt entry into the function logic.

Run 3

The code is generally readable with clear intent and logical structure, but it has some issues. The first function snippet is well-structured, with clear error messages and a straightforward loop. However, the second function has moderate nesting (up to 3 levels) and a loop that counts leading dots, which is a bit indirect but still understandable. Action granularity is mostly one action per line, and the reading flow is natural. The main readability drawback is the mixed context: the first snippet is incomplete without its function signature, making the overall code feel disjointed. Overall, it is concise and purposeful but could benefit from slightly flatter structure.

Run 1

Code Structure: Import resolution and module loading are separated into helpers, but the snippet begins mid-function, obscuring its context. Nesting: Mostly moderate, with a nested condition inside a loop and a try/except block; neither is excessively deep. Clarity of intent: The docstring, descriptive function names, and explicit error messages explain relative import handling well, although 'dot' and 'level' require some interpretation. Code length: Concise, with little unnecessary code. Action granularity: Each line generally performs one action, making individual steps easy to follow. Reading flow: The main function progresses naturally from validation through name resolution to importing and returning the module. The incomplete opening and legacy Python syntax slightly reduce accessibility.

Run 2

Code Structure: Relative-name resolution and module importing are logically separated, but the snippet begins mid-function, leaving its initial validation and context unclear. Nesting: Moderate nesting in loops, conditionals, and exception handling remains manageable. Clarity of intent: The docstring, descriptive errors, and mostly meaningful names explain the import behavior well; 'dot' and the unused loop variable 'x' are less intuitive. Code length: Concise overall, with no substantial unnecessary code. Action granularity: Each line generally performs one clear action. Reading flow: The import function progresses naturally from validation through name resolution to importing and returning the module, although the truncated opening interrupts comprehension.

Run 3

Code Structure: Import handling is logically separated from name resolution, but the snippet begins mid-function, obscuring context. Nesting: Moderate nesting in the relative-import branch and try/except loop is manageable. Clarity of intent: The docstring, descriptive function names, and explicit error messages explain the purpose well; 'dot' and 'x' are less descriptive. Code length: Concise overall, with no obvious unnecessary code. Action granularity: Each line generally performs one action, making operations easy to follow. Reading flow: Validation, relative-name resolution, import, and module retrieval form a natural sequence, although the truncated opening and legacy Python syntax slightly reduce accessibility.