Sample
Dorn/python/42
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 22.8Δ 62.7 |
| Dorn | 0.857 | 0–1; higher is more readable | 87.5Δ 1.9 |
| Mi | 0.234 | 0–1; higher is more readable | 22.8Δ 62.7 |
| LLOC | 31 | Logical lines; fewer is more readable | 9.6Δ 75.9 |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs | 91.4Δ 5.8 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 80.4Δ 5.2 |
| BTTF | 0.607 | 0–1; higher is more readable | 74.7Δ 10.9 |
| Human | 3.83 | 1–5; original rating | 85.5 |
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. | 1530.742 | −50.514 |
| 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.247 | −6.37 |
Intercept 8.87 + feature contributions = -28.014 (log-odds).
Score = sigmoid(-28.014) = 0.
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 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 43 | +0.75 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 79 | +0.47 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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. | 79 | +0.319 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.8 | +0.286 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.07 | +0.266 |
Intercept 0.07 + feature contributions = 1.79 (log-odds).
Score = sigmoid(1.79) = 0.857.
| Score | 0.234 |
|---|
| Score | 31 |
|---|
Run 1
The code is well-structured with clear logical grouping: environment serialization, consistency checks, index creation, file set determination, output writing, and finishing. It maintains flat nesting with only two shallow levels (an if/else and loops). Intent is clear through descriptive method names like 'check_consistency', 'create_index', 'prepare_writing', and 'write_file'. Actions are appropriately granular, with one logical operation per line. Reading flow is natural and follows the build process sequence. The code is concise without sacrificing clarity—comments like '# global actions' and '# build all' provide useful context. The abstract methods at the end clearly indicate the template pattern. Minor deduction for the slightly complex filename set logic and lack of blank lines between some logical sections, but overall this is highly readable code that could be understood without extensive documentation.
Run 2
The code is generally well-structured with clear sectioning via comments and natural reading flow. It maintains flat nesting with only one level of indentation for branches and loops. Each line performs a single action, making the logic easy to follow. Intent is clear: pickle environment, check consistency, build index, prepare output, process files, and finish. The main weakness is some mild redundancy in the `filenames` branch — building a set, then immediately creating a separate `filenames_set` with added defaults, is slightly convoluted. The abstract method stubs with `raise NotImplementedError` are concise and appropriate. Overall, the code is quite readable, with minor room for improvement in variable naming and set construction logic.
Run 3
The code demonstrates good readability with a clear, logical structure. It follows a natural sequence: saving state, checking consistency, creating an index, writing output files, and finishing. Nesting is minimal, with only one level inside the if/else and for loops, keeping the flow flat and easy to follow. Intent is clear through descriptive method names like `check_consistency`, `create_index`, and `prepare_writing`. The code is concise, avoiding unnecessary verbosity while maintaining clarity. Most actions are on separate lines, enhancing readability, though a few lines combine operations (e.g., the nested loop for adding TOC files). Reading flow is natural and logical, with comments effectively marking sections. The only minor drawbacks are the slightly dense logic in the filenames collection block and the use of multiple statements on some lines, but overall the code is highly readable.
Run 1
Code Structure: Clearly separates global preparation, file selection, output writing, and finishing; abstract methods and the HTML builder follow logically. Nesting: Mostly shallow, with a manageable double loop inside the filenames conditional. Clarity of intent: Descriptive method names, progress messages, and section comments explain the workflow, though the hard-coded contents.rst and rebuild dependencies require context. Code length: Concise overall, with little unnecessary repetition. Action granularity: Each statement generally performs one action, making individual operations easy to follow. Reading flow: Execution proceeds naturally from preparation through writing to cleanup. The excerpt starts mid-method and ends at a partial class, limiting contextual readability, while the wrapped status_iterator call adds minor visual friction.
Run 2
Code Structure: Clearly organized into consistency checks, index creation, file selection, output writing, and finishing, with helpful phase comments and extension methods. Nesting: Mostly shallow, though the nested loops for dependent TOC files and the loop inside a context manager add moderate depth. Clarity of intent: Descriptive method and variable names make the build workflow easy to understand; the hard-coded 'contents.rst' and surrounding framework dependencies require some context. Code length: Concise, with little unnecessary repetition beyond progress messages. Action granularity: Each statement generally performs one clear action, and complex operations are delegated to methods. Reading flow: Execution proceeds naturally from preparation to completion, with whitespace separating phases. The excerpt starts mid-method and ends with a partial class, slightly limiting standalone readability.
Run 3
Code Structure: Logically organized into consistency checks, index creation, file selection, writing, and finishing, with clear method boundaries. Nesting: Mostly shallow, though the conditional containing nested loops adds modest complexity. Clarity of intent: Descriptive names and phase comments communicate the documentation-building workflow; the hard-coded 'contents.rst' dependency is less self-explanatory. Code length: Concise without significant redundancy; progress messages provide useful context. Action granularity: Each line generally performs one action, and intermediate variables keep operations understandable. Reading flow: Execution follows a natural sequential pipeline, with whitespace separating phases. The excerpt starts mid-method, which limits context, but the visible implementation remains easy to follow.