Sample
Dorn/python/37
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 22.0Δ 24.8 |
| Scalabrino | 0.438 | 0–1; higher is more readable | 34.9Δ 11.9 |
| Dorn | 0.324 | 0–1; higher is more readable | 25.1Δ 21.7 |
| Mi | 0.073 | 0–1; higher is more readable | 9.5Δ 37.3 |
| LLOC | 21 | Logical lines; fewer is more readable | 29.7Δ 17.1 |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs | 93.5Δ 46.7 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 93.5Δ 46.7 |
| BTTF | 0.436 | 0–1; higher is more readable | 29.5Δ 17.3 |
| Human | 3.31 | 1–5; original rating | 46.8 |
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. | 1291.092 | −42.606 |
| 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.588 | −6.882 |
Intercept 8.87 + feature contributions = -28.618 (log-odds).
Score = sigmoid(-28.618) = 0.
| Score | 0.438 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| 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. | 101.968 | −0.654 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 26 | +0.162 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.089 | +0.075 |
| 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.728 | +0.006 |
Intercept 0.07 + feature contributions = -0.738 (log-odds).
Score = sigmoid(-0.738) = 0.324.
| Score | 0.073 |
|---|
| Score | 21 |
|---|
Run 1
The code is well-structured and highly readable. Each method has a single clear purpose, following the Arrange-Act-Assert pattern in tests. Nesting is flat with no conditional or loop complexity. The helper method 'assertIcon' effectively reduces duplication, though its parameter list and chained calls add slight cognitive load. Line lengths are mostly reasonable, though a few exceed 80 characters. Action granularity is good—each line performs one logical operation. Naming is descriptive and consistent, making intent clear. Minor improvements could include breaking up longer assertions and simplifying the helper method's signature, but overall the code is clean, maintainable, and easy to follow.
Run 2
The code is generally readable with clear intent and logical organization. The setUp and tearDown methods are straightforward, and the helper method assertIcon reduces duplication. Test methods are concise and follow a clear naming convention. Nesting is minimal and the reading flow is natural. Minor issues: long method signatures and line breaks in setUp and assertIcon slightly interrupt flow, and assertIcon compare arguments across lines with alignment that could be more consistent. Overall, the code is understandable and well-structured for a test class.
Run 3
The code is well-structured and readable. It uses clear class and method names, follows a logical setup/teardown pattern, and has a concise helper method (assertIcon) that reduces duplication. Nesting is minimal, and each test method focuses on a single scenario. Most lines perform a single action, aiding comprehension. Minor deductions: the imports are not shown (which would improve context), and some lines are split awkwardly due to line length, but overall the intent is immediately clear and the reading flow is natural.
Run 1
Code Structure: Setup, teardown, a reusable assertion helper, and focused tests are logically organized. Nesting: Minimal nesting makes execution easy to follow. Clarity of intent: Descriptive test names clearly identify attachment types and expected behavior; however, the nonexistent-file test relies on an implicit filesystem assumption. Code length: Concise, with the helper avoiding duplicated assertions. Action granularity: Each statement performs a distinct action, although the helper combines lookup, method invocation, and indexing in one assertion. Reading flow: The lifecycle methods naturally precede the helper and test cases. Minor drawbacks include inconsistent continuation formatting and a long assertion expression.
Run 2
Code Structure: Clearly separates setup, cleanup, a reusable assertion helper, and focused test cases. Nesting: Flat method bodies with no nested control flow make scanning easy. Clarity of intent: Descriptive test names and attachment types communicate what each test verifies; icon identifiers and the injected exists callback are understandable, though the helper's indexed expression requires closer reading. Code length: Concise, with little duplication thanks to assertIcon. Action granularity: Each statement performs one primary action, with only the assertion combining lookup and comparison. Reading flow: Lifecycle methods followed by the helper and related tests provide a natural progression. Minor readability drawbacks include inconsistent continuation indentation and one long assertion expression.
Run 3
Code Structure: Clearly organized into setup, teardown, a shared assertion helper, and focused tests. Nesting: Minimal nesting makes each method easy to scan. Clarity of intent: Descriptive test names and attachment variables communicate the scenarios well, though 'whatever' is an uninformative fixture value. Code length: Concise, with the assertion helper avoiding duplication. Action granularity: Each statement performs one main action; the helper's chained indexing expression is slightly dense. Reading flow: Lifecycle methods precede the helper and tests in a natural order. Minor readability drawbacks include inconsistent continuation indentation, a long assertion line, and the unexplained ordering of cleanup operations.