Sample
Dorn/python/14
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 13.9Δ 38.7 |
| Scalabrino | 0.366 | 0–1; higher is more readable | 26.4Δ 26.3 |
| Dorn | 0.642 | 0–1; higher is more readable | 56.3Δ 3.6 |
| Mi | 0.353 | 0–1; higher is more readable | 34.8Δ 17.8 |
| LLOC | 12 | Logical lines; fewer is more readable | 53.6Δ 1.0 |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs | 84.5Δ 31.9 |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs | 73.8Δ 21.2 |
| BTTF | 0.404 | 0–1; higher is more readable | 24.5Δ 28.1 |
| Human | 3.38 | 1–5; original rating | 52.6 |
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. | 1730.592 | −57.11 |
| 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.465 | −6.697 |
Intercept 8.87 + feature contributions = -42.937 (log-odds).
Score = sigmoid(-42.937) = 0.
| Score | 0.366 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 73 | +0.373 |
| 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. | 77.968 | +0.363 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 28 | −0.222 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.115 | −0.174 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 26 | +0.162 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 29 | +0.01 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.405 | +0.001 |
Intercept 0.07 + feature contributions = 0.583 (log-odds).
Score = sigmoid(0.583) = 0.642.
| Score | 0.353 |
|---|
| Score | 12 |
|---|
Run 1
The code is well-structured with clear helper methods and appropriate comments grouping the PDF drawing functions and visitor pattern usage. The methods have descriptive names and docstrings explaining their purpose. Nesting is minimal, with only simple conditional swaps in _rectangle. Each method performs a single logical action, and the drawing object creation is reasonably formatted. However, readability is slightly reduced by the complex inline expression: 'self.line_width*(1+0.5*bool(thick))' in _line, which could be clarified with a conditional statement or variable. Additionally, the coordinate transformation 'self.height-y' appears repeatedly without explanation, making the intent less obvious to readers unfamiliar with PDF coordinate systems. The inline conditional swaps in _rectangle are concise but slightly less readable than block form. Overall, the code is clean and maintainable with minor opportunities for improved clarity.
Run 2
The code is highly readable. It has clear logical sections separated by comments, flat nesting with only simple guard-style conditionals, and concise helper methods with descriptive names. Each operation is clearly expressed, with one primary action per line. The use of helper methods like _num and _color abstracts repeated transformations cleanly. The coordinate swapping logic in _rectangle is compact but still understandable. Minor issues: the inline conditionals (if x1 > x2: x1, x2 = x2, x1) are slightly dense, and the thick parameter in _line uses a boolean in arithmetic which could be clearer. Overall, the code is well-structured, purposeful, and easy to follow.
Run 3
The code is generally readable with clear section separators, descriptive method names, and docstrings. The drawing helpers logically group related functionality, and each method performs a single coherent action. However, some issues reduce clarity: the `_line` method has a confusing `bool(thick)` expression embedded in a calculation, and the `style` parameter in `_rectangle` is unused. Coordinate transformation logic (height-y) is repeated without explanation, and the `_rectangle` method lacks the expected stroke/fill styling compared to `_line`. The one-line conditional swaps are compact but slightly reduce readability. Parameter naming is clear, but magic numbers like `0.2` lack context. Overall, the structure is logical and flat, but minor ambiguities and undocumented conventions prevent higher readability.
Run 1
Code Structure: Small, focused methods and section comments logically separate drawing helpers from the point visitor. Nesting: Minimal control-flow nesting makes the code easy to follow; nested constructor calls remain manageable. Clarity of intent: Method names, shape constructors, and docstrings clearly communicate drawing operations, although coordinate inversion, the thick-width formula, and the fixed point radius are unexplained. The unused style parameter adds ambiguity. Code length: Concise without substantial unnecessary code. Action granularity: Most lines express a single operation, but inline if statements combine conditions and assignments, reducing scanability. Reading flow: Consistent argument layouts and repeated drawing patterns support natural reading, though tight operator spacing and extra alignment spaces slightly weaken formatting.
Run 2
Code Structure: Small, focused methods and section comments organize drawing helpers and the point visitor logically. Nesting: Minimal control-flow nesting makes the code easy to scan; nested constructor calls remain manageable. Clarity of intent: Method names, docstrings, and drawing primitives clearly convey purpose, though coordinate inversion, the thickness formula, and the fixed point radius are unexplained. The unused style parameter is potentially confusing. Code length: Concise without substantial unnecessary code, although coordinate conversion is repeated. Action granularity: Most lines express a single operation, but inline if statements combine conditions and assignments, reducing readability. Reading flow: Consistent formatting and argument ordering create a natural flow, slightly weakened by compact arithmetic spacing and decorative section comments.
Run 3
Code Structure: Small, focused methods and section comments provide logical organization. Nesting: Minimal control-flow nesting makes the code easy to follow. Clarity of intent: Descriptive method names and drawing primitives clearly communicate purpose, though the unused style parameter, unexplained 0.2 radius, and compact thickness formula reduce clarity. Code length: Concise overall, with some repeated coordinate and color conversions. Action granularity: Most lines contain a single action, but inline conditional swaps combine checks and assignments, while some argument lines contain multiple conversions. Reading flow: Consistent method layouts and grouped drawing arguments support natural reading, although sparse spacing around arithmetic and repeated height-based coordinate transformations slightly hinder scanning.