Sample
Dorn/python/80
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 12.5Δ 48.2 |
| Scalabrino | 0.398 | 0–1; higher is more readable | 29.5Δ 31.3 |
| Dorn | 0.677 | 0–1; higher is more readable | 62.7Δ 1.9 |
| Mi | 0.434 | 0–1; higher is more readable | 43.2Δ 17.5 |
| LLOC | 26 | Logical lines; fewer is more readable | 18.8Δ 41.9 |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs | 79.9Δ 19.2 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 80.4Δ 19.6 |
| BTTF | 0.482 | 0–1; higher is more readable | 40.1Δ 20.6 |
| Human | 3.46 | 1–5; original rating | 60.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. | 2103.36 | −69.411 |
| 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.506 | −6.759 |
Intercept 8.87 + feature contributions = -47.3 (log-odds).
Score = sigmoid(-47.3) = 0.
| Score | 0.398 |
|---|
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. | 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.922 | +0.619 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 38 | +0.577 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 40 | −0.497 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 71.922 | +0.356 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.74 | +0.285 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.087 | +0.101 |
Intercept 0.07 + feature contributions = 0.742 (log-odds).
Score = sigmoid(0.742) = 0.677.
| Score | 0.434 |
|---|
| Score | 26 |
|---|
Run 1
The code is well-structured with clear section comments and consistent patterns. Functions are short and focused with minimal nesting. Intent is generally clear, though some logic like the '<-- next citation -->' sentinel and the conditional handling of adjacent citations could benefit from a brief explanation. Line length is mostly reasonable, but the docinfo_item method contains multiple string concatenations and method calls per line, slightly reducing readability. Action granularity is mostly one action per line, but string formatting lines are dense. Reading flow is natural, with visits and departures grouped logically. Overall, the code is readable but could improve clarity around sentinel values and break up dense formatting operations for better maintainability.
Run 2
The code is generally well-structured with clear section comments separating different parts of the HTML writer. Each method has a single responsibility (visiting or departing from document tree nodes), and the action granularity is appropriate — most lines perform one logical operation. The nesting depth is minimal, with only one conditional inside visit_citation. The reading flow is natural, following a consistent pattern across similar methods. However, there are some readability issues: the docstring-style comments are overly verbose for what they explain, and the visit_citation method's logic for handling adjacent citations uses a string sentinel ('<-- next citation -->') which is not immediately obvious without context. The conditional expression in visit_docinfo could be clearer. The method signatures vary slightly (depart_docinfo_item takes no node parameter while others do), which may cause minor confusion. The code is concise without being terse.
Run 3
The code is generally readable with logical sectioning via comments and clear method names. It uses a consistent pattern for visit/depart methods with flat nesting and one action per line for the most part. However, some lines are unnecessarily long (line 26, line 33), and there are hidden dependencies on external context like self.body, self.context, and helper methods that aren't explained. The string concatenation for HTML generation could be clearer, and the addition of non-material placeholder markers like '<-- next citation -->' in the body list obscures intent. The docstring-like comments are helpful but inconsistent in style. Overall structure and flow are decent but could be improved with extraction of HTML generation into constants or helper methods.
Run 1
Code Structure: Clearly separated citation and document-info sections, with consistently paired visit/depart methods. Nesting: Shallow conditionals keep control flow easy to follow. Clarity of intent: Descriptive method names and comments explain the HTML-generation purpose; however, the citation sentinel and implicit relationships between body, context, and backreferences require familiarity with the surrounding implementation. Code length: Methods are short and focused, with little unnecessary code, though trailing comments introduce a section not shown. Action granularity: Each statement generally performs one action; multiline formatting remains understandable. Reading flow: Logical grouping and consistent append operations support natural reading. Minor distractions include redundant parentheses, older string-formatting syntax, and extra blank lines.
Run 2
Code Structure: Clearly separated citation and document-info sections, with cohesive visitor/departure methods. Nesting: Shallow conditionals make control paths easy to follow. Clarity of intent: Descriptive method names and explanatory comments communicate HTML generation well, though the citation sentinel and context-stack behavior require framework knowledge. Code length: Methods are short and focused, with little unnecessary code; the trailing enumerated-list heading is incomplete in this excerpt. Action granularity: Statements generally perform one action each, and multiline formatting keeps longer expressions manageable. Reading flow: Paired visit/depart methods provide a natural sequence, but repeated raw HTML strings, older string-formatting syntax, and minor formatting inconsistencies slightly interrupt readability.
Run 3
Code Structure: Clearly separated citation and docinfo sections, with small, focused visitor methods. Nesting: Shallow conditionals keep control flow easy to follow. Clarity of intent: Descriptive method names and comments explain the HTML output, although the citation sentinel and context handling require knowledge of the surrounding visitor framework. Code length: Concise without significant unnecessary code; the trailing enumerated-list comments describe code not shown. Action granularity: Each statement performs one main action, with formatting expressions split reasonably across lines. Reading flow: Paired visit/depart methods provide a natural sequence. Minor distractions include inconsistent spacing, unnecessary parentheses, older string-formatting syntax, and the implicit assumption that self.body is nonempty.