Sample
Dorn/python/102
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 40.1Δ 42.6 |
| Scalabrino | 0.642 | 0–1; higher is more readable | 67.4Δ 15.3 |
| Dorn | 0.878 | 0–1; higher is more readable | 91.9Δ 9.2 |
| Mi | 0.571 | 0–1; higher is more readable | 60.2Δ 22.6 |
| LLOC | 21 | Logical lines; fewer is more readable | 29.7Δ 53.1 |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs | 69.9Δ 12.8 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 80.4Δ 2.4 |
| BTTF | 0.576 | 0–1; higher is more readable | 67.1Δ 15.6 |
| Human | 3.8 | 1–5; original rating | 82.7 |
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. | 906.266 | −29.907 |
| 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.4 | −6.6 |
Intercept 8.87 + feature contributions = -15.636 (log-odds).
Score = sigmoid(-15.636) = 0.
| Score | 0.642 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 64.903 | +0.916 |
| 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. | 65 | +0.244 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.083 | +0.138 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 25 | +0.128 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 27 | +0.08 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.015 | −0.004 |
Intercept 0.07 + feature contributions = 1.97 (log-odds).
Score = sigmoid(1.97) = 0.878.
| Score | 0.571 |
|---|
| Score | 21 |
|---|
Run 1
The code is generally readable and follows consistent patterns. Each handler function has a clear, single responsibility and uses flat, minimal nesting. Function names clearly indicate intent, and most lines perform one logical action. However, the first line 'return result' appears to be an orphaned fragment, likely a copy-paste error, which disrupts reading flow. The list comprehensions in handleTable and handleTr are concise but split across two lines in a way that feels awkward and slightly hurts readability. Overall structure is logical and predictable, but the unexplained initial line and fragmented comprehensions prevent a higher score.
Run 2
The code is generally readable, with each handler following a consistent, predictable pattern: create an object, process children, assign, and return. Function names clearly indicate intent. Most functions are short and flat, with only minor nesting in list comprehensions. The use of inline comments in handleTable and handleTr clarifies otherwise non-obvious filtering logic. However, the first line 'return result' is out of context and breaks reading flow. The list comprehensions are broken across two lines in a way that slightly disrupts natural reading. There is also repetition across handlers that could be abstracted, though this does not severely harm readability. Overall, the code is approachable but has minor structural and flow inconsistencies.
Run 3
The code is mostly clear and consistent, with each handler following a predictable pattern: create a node, process children, return the result. However, there are some minor issues. The first line, 'return result', appears to be a stray or misplaced statement from a different function, which breaks the logical structure and could confuse readers. The list comprehensions in handleTable and handleTr are split across two lines in an awkward way, slightly disrupting reading flow, though the inline comments are helpful. Action granularity is generally good, with one main action per line, but the comprehensions pack multiple operations into one. Overall, the code is readable but could be improved by fixing the stray return and formatting the comprehensions more naturally.
Run 1
Code Structure: Small, consistently organized handlers separate responsibilities clearly, though the opening orphaned return suggests an incomplete excerpt. Nesting: Flat functions and simple comprehensions keep nesting minimal. Clarity of intent: Descriptive handler names and filtering comments make the purpose clear; abbreviated names such as TrDitem and x are less expressive. Code length: Concise overall, with some repeated construction and child-processing logic. Action granularity: Each statement performs one clear step. Reading flow: The consistent create-process-return pattern is easy to follow, but awkward comprehension line breaks and missing spacing around == slightly disrupt readability.
Run 2
Code Structure: Small, logically separated handlers provide clear organization, though the leading standalone return suggests an incomplete excerpt. Nesting: Functions are flat, with simple comprehensions rather than nested control flow. Clarity of intent: Descriptive handler names and filtering comments make the purpose clear; abbreviated names such as TrDitem require some domain knowledge. Code length: Each handler is concise, although repeated construction and child-processing patterns introduce minor duplication. Action granularity: Statements generally perform one action per line; comprehensions combine processing and filtering without becoming difficult to understand. Reading flow: Consistent handler patterns make the code easy to scan, but unconventional comprehension wrapping and missing spaces around the equality operator slightly disrupt readability.
Run 3
Code Structure: Small, logically separated handlers follow a consistent pattern, though the initial orphaned return suggests an incomplete excerpt. Nesting: Functions are flat, with simple comprehensions and no deeply nested control flow. Clarity of intent: Descriptive handler names and filtering comments make the purpose clear; abbreviated names such as TrDitem depend on HTML familiarity. Code length: Functions are concise, although repeated construction and child-processing logic adds minor duplication. Action granularity: Each statement performs one clear action; comprehensions combine processing and filtering idiomatically. Reading flow: The repeated pattern makes the code easy to scan, but inconsistent comprehension formatting and missing spaces around the equality operator slightly reduce readability.