Sample
Dorn/python/78
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 13.6Δ 41.8 |
| Dorn | 0.746 | 0–1; higher is more readable | 70.8Δ 15.3 |
| Mi | 0.467 | 0–1; higher is more readable | 48.7Δ 6.7 |
| LLOC | 17 | Logical lines; fewer is more readable | 41.2Δ 14.2 |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs | 79.9Δ 24.5 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 80.4Δ 24.9 |
| BTTF | 0.555 | 0–1; higher is more readable | 62.1Δ 6.7 |
| Human | 3.4 | 1–5; original rating | 55.4 |
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. | 1984.795 | −65.498 |
| Source linesThe number of non-empty source lines. | 48 | +19.2 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 5.057 | −7.586 |
Intercept 8.87 + feature contributions = -45.014 (log-odds).
Score = sigmoid(-45.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. | 49 | −0.699 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.03 | +0.648 |
| 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. | 74.959 | +0.49 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 70.469 | +0.333 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 47.895 | +0.26 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 25 | −0.153 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 25 | +0.128 |
Intercept 0.07 + feature contributions = 1.077 (log-odds).
Score = sigmoid(1.077) = 0.746.
| Score | 0.467 |
|---|
| Score | 17 |
|---|
Run 1
The code is generally well-structured and readable. It follows clear class inheritance with logical organization. Nesting is minimal. The intent of methods is clear from their names and docstrings, though 'get_chassis' returning an empty string is ambiguous. Code length is concise and appropriate. Action granularity is good with one primary action per line. Reading flow is natural. Minor issues: the 'assert(self.router)' syntax is unusual (parentheses not typical for assert statements), and the import paths use older Python style. Overall, the code is clean, maintainable, and easy to understand with only small areas for improvement.
Run 2
The code is generally clear and well-structured. It follows standard Python class organization with clear inheritance, concise methods, and flat nesting. The use of docstrings and comments enhances intent clarity, and action granularity is mostly one action per line. However, there are minor readability issues: `get_chassis` has an unnecessary assert and an empty return, which introduces ambiguity about purpose. The repeated calls to parent constructors and `create_config` could be slightly simplified, but overall the code is concise, readable, and maintainable for its purpose.
Run 3
The code is generally readable with a clear class structure, logical organization, and minimal nesting. Good practices include module and class docstrings, consistent naming, and simple method decomposition. However, clarity of intent suffers in `get_chassis`, which is misleadingly named and has an unused `assert`. The `create_router` method hides non-obvious side effects (modifying config dict after creation) without explaining why. Multiple actions occur per line in some places (e.g., indexing and assignment). Overall, the code is understandable but could be improved with clearer method naming and more explanatory comments.
Run 1
Code Structure: Imports and a small class with focused methods are logically organized. Nesting: Only one conditional is used, keeping the code flat and easy to follow. Clarity of intent: Class and method names communicate the router platform and lifecycle, and the slot-assignment comment helps. However, get_chassis returns an unexplained empty string, and whether modifying config updates the router is unclear. Code length: The implementation is concise, although the lengthy license header dominates the snippet. Action granularity: Each statement performs a single action, with no compressed multi-operation lines. Reading flow: Initialization, model lookup, and router creation follow a natural sequence. Extra blank lines, unnecessary parentheses, and minimal method documentation slightly reduce polish.
Run 2
Code Structure: Imports and a small class with clearly separated methods provide logical organization. Nesting: Only one conditional is present, keeping the code nearly flat. Clarity of intent: Descriptive names, short docstrings, and the slot-assignment comment communicate the router specialization, though get_chassis returning an empty string is unexplained and create_config's effects are implicit. Code length: The implementation is concise; the lengthy license header and excess blank lines add visual overhead. Action granularity: Each statement performs a single action, making individual operations easy to follow. Reading flow: Initialization, chassis retrieval, and router creation form a natural sequence, although explicit parent-class initialization and minor formatting inconsistencies slightly interrupt readability.
Run 3
Code Structure: A small, logically organized class separates initialization, chassis retrieval, and router creation. Nesting: Almost entirely flat, with only one simple conditional. Clarity of intent: Descriptive class and method names and the slot-assignment comment help, but returning an empty chassis string and modifying a locally created configuration without showing its application leave some behavior unclear. Code length: The implementation is concise; the lengthy license header and extra blank lines add visual overhead without complicating the logic. Action granularity: Each statement performs one clear action. Reading flow: Imports, class declaration, initialization, and methods follow a natural order. Minor inconsistencies in docstring formatting and unnecessary parentheses slightly reduce polish.