Sample
Dorn/python/8
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 18.1Δ 35.1 |
| Scalabrino | 0.41 | 0–1; higher is more readable | 31.0Δ 22.2 |
| Dorn | 0.899 | 0–1; higher is more readable | 94.2Δ 40.9 |
| Mi | 0.471 | 0–1; higher is more readable | 49.6Δ 3.6 |
| LLOC | 39 | Logical lines; fewer is more readable | 2.1Δ 51.1 |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs | 69.9Δ 16.7 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 80.4Δ 27.2 |
| BTTF | 0.565 | 0–1; higher is more readable | 64.6Δ 11.4 |
| Human | 3.38 | 1–5; original rating | 53.2 |
Views
Select the downloaded ZIP or its extracted folder. Files stay in your browser.
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 1789.644 | −59.058 |
| Source linesThe number of non-empty source lines. | 50 | +20 |
| 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.673 | −7.01 |
Intercept 8.87 + feature contributions = -37.198 (log-odds).
Score = sigmoid(-37.198) = 0.
| Score | 0.41 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 48 | +0.923 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 51 | −0.769 |
| 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. | 71.902 | +0.62 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 71.941 | +0.356 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.065 | +0.306 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.89 | +0.288 |
Intercept 0.07 + feature contributions = 2.191 (log-odds).
Score = sigmoid(2.191) = 0.899.
| Score | 0.471 |
|---|
| Score | 39 |
|---|
Run 1
The code is generally well-structured with clear imports, sensible helper classes, and a logical organization. It uses flat inheritance (no deep nesting), and each action is mostly on its own line, which improves readability. Class and method naming (relpath_to, collect_env_warnings) indicates clear intent, although the trailing underscore in 'relpath_to' is slightly unusual. The context manager class correctly separates concerns and has minimal nesting. However, the code relies on Python 2 syntax ('cPickle', 'cStringIO', 'print >>'), which may confuse modern readers unfamiliar with legacy patterns. The 'relpath_to' class could be a function, but as a callable object it is acceptable. The 'collect_env_warnings' class is concise but the '__exit__' method does not handle exceptions explicitly. Overall, the code is readable and maintainable, but loses points for outdated syntax and minor ambiguity in helper class purpose.
Run 2
The code has a clear overall structure with imports, constants, and helper classes, but suffers from several readability issues. The `relpath_to` and `collect_env_warnings` classes use non-idiomatic lowercase naming (they look like functions but are classes), which obscures intent. Context manager methods (`__enter__`, `__exit__`) are not self-documenting and hide the warning collection logic. The code uses legacy Python 2 constructs (`cPickle`, `cStringIO`, `print >>`) which may confuse modern readers. While action granularity is mostly one action per line and nesting is flat, the helper classes lack docstrings or comments explaining their purpose and usage. The import of `roles` and `directives` for side effects could be clearer with a comment explaining why only the module import is needed. Overall, experienced Python developers could parse this code, but it violates modern Python conventions and requires additional context to understand fully.
Run 3
The code is generally readable with clear imports, logical organization, and reasonable structure. Imports are grouped standard library, third-party, and local, which aids navigation. Helper classes are short and have clear single purposes. Naming is descriptive (e.g., ENV_PICKLE_FILENAME, relpath_to, collect_env_warnings). There is minimal nesting and one primary action per line. However, a few aspects reduce clarity: the module-level comment '# side effect: registers roles and directives' is helpful but terse; the classes lack docstrings explaining their behavior; and the relpath_to class uses a two-argument __call__ with a boolean flag, which slightly obscures intent. The print statement syntax indicates legacy Python, which may confuse some readers. Overall flow is natural and code length is appropriate, but documentation gaps and minor ambiguities prevent a higher score.
Run 1
Code Structure: Imports, constants, and two focused helper classes are logically organized. Nesting: Control flow is shallow, with only simple conditionals. Clarity of intent: Relative URI calculation and warning collection are understandable; the side-effect import comment is useful, though lowercase class names and implicit context-manager behavior reduce clarity slightly. Code length: Helpers are concise, but many imports and constants are unused within the shown excerpt, adding visual overhead. Action granularity: Each line generally performs one action. Reading flow: Methods follow a natural sequence, but missing blank lines between methods and legacy Python syntax make scanning somewhat less comfortable.
Run 2
Code Structure: Imports, constants, and helper classes are logically grouped, though several imports are unused in this excerpt. Nesting: Methods are shallow, with only simple conditional blocks. Clarity of intent: Descriptive names and the side-effect comment make the purpose mostly clear, although lowercase class names and legacy Python syntax reduce familiarity. Code length: The helpers are concise without unnecessary repetition. Action granularity: Each statement performs one primary action, making operations easy to follow. Reading flow: Initialization precedes callable or context-manager behavior naturally; missing blank lines between methods slightly weaken visual separation.
Run 3
Code Structure: Imports, constants, and two focused helper classes are logically organized, although several imports and constants are unused in this snippet. Nesting: Control flow is shallow, with only simple conditionals. Clarity of intent: Descriptive method calls and the registration comment explain most behavior; class names are informative but unconventional, and context-manager warning handling requires some familiarity with the surrounding API. Code length: The implementation is compact without unnecessary repetition. Action granularity: Each statement performs a single clear action, with no compressed multi-statement lines. Reading flow: Execution follows a natural sequence, especially when collecting and restoring warning output. Missing blank lines between methods and legacy Python syntax slightly reduce visual readability and accessibility.