Sample

Dorn/python/113

Human rating uses the original dataset scale.

DatasetDorn
Human3.76
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
10.3Δ 71.3
Scalabrino0.5290–1; higher is more readable
48.1Δ 33.6
Dorn0.6660–1; higher is more readable
61.8Δ 19.8
Mi0.2450–1; higher is more readable
23.7Δ 57.9
LLOC35Logical lines; fewer is more readable
4.5Δ 77.2
DeepSeek V4 Pro140–20; mean of three runs
65.9Δ 15.7
GPT-6.1 Sol170–20; mean of three runs
80.4Δ 1.3
BTTF0.5390–1; higher is more readable
56.5Δ 25.1
Human3.761–5; original rating
81.6

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.2267.309−74.821
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.368−6.551

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

Score0.529

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.51−0.769
Indentation frequencyHow rapidly indentation changes from line to line.39+0.612
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.43−0.566
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.75.98+0.421
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.98+0.32
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.064+0.317
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.775+0.286

Intercept 0.07 + feature contributions = 0.69 (log-odds).
Score = sigmoid(0.69) = 0.666.

Score0.245
Score35
Run 1

The code is generally readable, with clear method names and a logical flow. However, there are several issues that reduce its clarity and maintainability. The opening fragment is context-dependent and begins with indentation and a partial assignment, making it hard to understand in isolation. The `DoResize` method has early returns that improve readability, but the multiple guard clauses are only partially explained. The `DistributeWidthAcrossColumns` method's logic is concise but the comment is a bit long and could be more direct. The use of `float` and inline list comprehension within `sum` is slightly dense. The `GetResizeColumn` method is straightforward, but the `SetResizeColumn` method includes a pylint disable comment that hints at a design issue. Overall, the code is functional and mostly clear, but would benefit from more explicit context, clearer comments in some areas, and a more consistent explanation of guard conditions.

Run 2

The code is reasonably structured with clear method names and straightforward logic, but there are readability concerns. The indentation of the first two lines is inconsistent and suggests code was pasted out of context. Several methods contain multiple early returns which, while flat, can interrupt reading flow. The `DistributeWidthAcrossColumns` method uses list comprehension and a float conversion that slightly obscures intent. Action granularity is mostly one action per line, though a few lines combine operations. The use of comments is helpful but sparse, especially around the magic number `32` in `DoResize`. Overall, the code is understandable but could benefit from minor formatting cleanup and more descriptive comments.

Run 3

The code is moderately readable with clear method names and comments explaining edge cases. However, it has several issues: the first block appears disconnected from its method context, line continuations with backslashes are awkward, and some methods contain multiple actions per line. The DistributeWidthAcrossColumns method has unclear logic due to a potential division by zero when totalWidth is 0. Nesting depth is low, which is good, but the reading flow is disrupted by the fragmented opening code and inconsistent formatting. The intent of ResizeColumn behavior is reasonably clear, but the overall structure could benefit from better segmentation and cleanup of the initial orphaned lines.

Run 1

Code Structure: Methods logically separate event handling, resizing, width distribution, and property access, though the excerpt begins mid-block. Nesting: Early returns keep resizing logic flat; other branches and loops are shallow. Clarity of intent: Descriptive method and variable names, plus helpful comments, explain the resizing behavior. The literal height threshold of 32 and sentinel value of -1 could be clearer as named constants. Code length: Generally concise, with a slightly redundant else after return. Action granularity: Statements mostly perform one action per line, making changes easy to follow. Reading flow: The progression from event handling to resizing calculations is natural, but uneven continuation indentation, manual line wrapping, and the truncated opening mildly interrupt readability.

Run 2

Code Structure: Responsibilities are logically separated into resize handling, width distribution, and accessors, though the opening fragment lacks context. Nesting: Early returns keep resizing logic flat; remaining conditionals and loops are shallow. Clarity of intent: Descriptive method and variable names, plus useful comments, explain the resizing behavior. The height threshold of 32 and external state require some interpretation. Code length: Generally concise, with a slightly redundant else after a return. Action granularity: Statements mostly perform one action per line, making updates easy to follow. Reading flow: Methods follow a coherent progression, but awkward line continuations, uneven indentation, and mixed naming conventions slightly disrupt scanning.

Run 3

Code Structure: Resizing, width distribution, and column access are separated into focused methods, though the opening fragment lacks context. Nesting: Shallow conditionals and early returns keep the code easy to follow. Clarity of intent: Descriptive method and variable names, along with comments explaining safeguards and proportional resizing, communicate purpose well; the height threshold of 32 is not fully explained. Code length: Mostly concise, with a slightly redundant else after a return. Action granularity: Each statement performs a single clear action. Reading flow: Control flow progresses naturally from validation to calculation and updates, but awkward continuation indentation, mixed naming conventions, and reliance on properties defined elsewhere slightly impede reading.