Sample
Dorn/python/50
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable | 59.9Δ 17.5 |
| Scalabrino | 0.501 | 0–1; higher is more readable | 42.2Δ 0.1 |
| Dorn | 0.774 | 0–1; higher is more readable | 73.8Δ 31.5 |
| Mi | 0.504 | 0–1; higher is more readable | 52.1Δ 9.7 |
| LLOC | 7 | Logical lines; fewer is more readable | 67.7Δ 25.3 |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs | 65.9Δ 23.5 |
| GPT-6.1 Sol | 16.33 | 0–20; mean of three runs | 70.8Δ 28.4 |
| BTTF | 0.505 | 0–1; higher is more readable | 46.2Δ 3.9 |
| Human | 3.23 | 1–5; original rating | 42.3 |
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. | 401.128 | −13.237 |
| 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.283 | −6.425 |
| Source linesThe number of non-empty source lines. | 10 | +4 |
Intercept 8.87 + feature contributions = -6.792 (log-odds).
Score = sigmoid(-6.792) = 0.001.
| Score | 0.501 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 11 | +0.647 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 79 | +0.47 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 9 | −0.426 |
| 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.909 | +0.323 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 9.863 | −0.272 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 9 | +0.214 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.076 | +0.202 |
Intercept 0.07 + feature contributions = 1.228 (log-odds).
Score = sigmoid(1.228) = 0.774.
| Score | 0.504 |
|---|
| Score | 7 |
|---|
Run 1
The code is fairly readable but has some issues. The structure is logical but the list comprehension with a line continuation backslash hurts readability. Exception handling for AttributeError is appropriate. Variable names are clear ('children', 'item', 'recursive'). The lambda sort is concise but slightly cryptic. Action granularity is good—one operation per line. The trailing backslash continuation is unnecessary since the brackets already allow line breaks, making the code feel cluttered. The method names are descriptive but the second function is a simple pass-through with a pylint disable that feels like dead code. Overall, the intent is clear but the implementation could be cleaner without the backslash continuation and with better handling of the AttributeError context.
Run 2
The code is moderately readable. The list comprehension is logically structured and uses flat nesting, with clear intent to filter and sort children. However, the backslash line continuation disrupts reading flow and could be avoided with parentheses. Action granularity is mostly one action per line, but the comprehension packs filtering and sorting into a compact block. The try/except is simple and handles an AttributeError, but the method name and exception context are slightly ambiguous. The foreground_color method is clear, though the pylint disable comment adds minor clutter. Overall, the code is concise and functional but could benefit from improved formatting and clarity.
Run 3
The code is reasonably readable with clear intent and concise expressions, but suffers from minor structural issues. The list comprehension is efficient but slightly dense, spanning multiple lines with a line continuation and conditional filtering. The single-line try-except is compact but somewhat cluttered. The `foreground_color` method is clear but overrides a parameter with a hardcoded value, obscuring intent. Overall structure is logical, but readability could improve with better formatting, avoiding unnecessary line continuations, and clearer parameter handling.
Run 1
Code Structure: logically groups child filtering, sorting, and returning, followed by a separate color accessor. Nesting: shallow, with only a try/except and a comprehension. Clarity of intent: descriptive names make the main operations clear, though catching AttributeError broadly can obscure why an empty list is returned. Code length: concise, but the explicit line-continuation backslash is unnecessary inside brackets. Action granularity: each statement performs a distinct operation; the comprehension combines iteration and filtering idiomatically. Reading flow: filtering, sorting, and returning form a natural sequence. The missing enclosing function header and unused depth parameter slightly reduce clarity.
Run 2
Code Structure: The filtering, sorting, and return form a logical sequence, followed by a small, focused method; however, the first method's header is missing. Nesting: Shallow nesting keeps the snippet easy to scan. Clarity of intent: Method and variable names clearly communicate child selection and color retrieval, though catching AttributeError broadly can obscure failures. Code length: Concise overall, with an unnecessary explicit line-continuation backslash inside brackets. Action granularity: Each statement performs one primary action. Reading flow: The sequence is natural, but the truncated opening, continuation formatting, and inline pylint directive slightly interrupt readability.
Run 3
Code Structure: The filtering, sorting, and return steps are logically organized, and color retrieval is separated into its own method. Nesting: Shallow try/except nesting and a simple comprehension keep the code easy to follow. Clarity of intent: Method names and operations communicate their purpose, though the missing enclosing method signature limits context, and catching any AttributeError may obscure unexpected failures. Code length: Concise overall; the explicit line-continuation backslash is unnecessary inside brackets. Action granularity: Each main operation occupies its own line, while the comprehension reasonably combines iteration and filtering. Reading flow: Execution proceeds naturally from selection to sorting to return, followed by a straightforward fallback. Mixed naming conventions, an unused depth parameter, and the inline lint suppression add minor friction.