Sample
Dorn/python/43
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 9.7Δ 0.6 |
| Scalabrino | 0.38 | 0–1; higher is more readable | 27.9Δ 17.6 |
| Dorn | 0.192 | 0–1; higher is more readable | 15.6Δ 5.3 |
| Mi | 0.23 | 0–1; higher is more readable | 22.3Δ 12.0 |
| LLOC | 41 | Logical lines; fewer is more readable | 0.7Δ 9.6 |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs | 69.9Δ 59.6 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 93.5Δ 83.1 |
| BTTF | 0.554 | 0–1; higher is more readable | 61.8Δ 51.5 |
| Human | 2.42 | 1–5; original rating | 10.3 |
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. | 2442.72 | −80.61 |
| 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.453 | −6.679 |
Intercept 8.87 + feature contributions = -58.419 (log-odds).
Score = sigmoid(-58.419) = 0.
| Score | 0.38 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 45 | +0.819 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 50 | −0.727 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 48 | −0.663 |
| 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. | 95.961 | −0.399 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 48.536 | +0.269 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.097 | −0 |
Intercept 0.07 + feature contributions = -1.436 (log-odds).
Score = sigmoid(-1.436) = 0.192.
| Score | 0.23 |
|---|
| Score | 41 |
|---|
Run 1
The code shows moderate readability. Structure is logical with clear test method separation, but nesting and action granularity vary. Lines like `self.composite2.addChild(grandChild)` mix setup actions with test scenarios. Intent is mostly clear from descriptive method names, though some names are lengthy. Code length is concise but verbosity in assertions and event construction reduces clarity. Reading flow is natural but inconsistent—some tests use helper methods (`registerObserver`, `assertEqualLists`) while others inline repetitive setup. Duplicate patterns (e.g., building composite hierarchies) could be extracted to improve readability. Overall, understandable but would benefit from more consistent helper usage and breaking multi-action lines into clearer steps.
Run 2
The code is moderately readable with clear test method names and consistent structure. Each test follows a predictable arrange-act-assert pattern, aiding comprehension. However, there is significant duplication in setup logic across tests, which adds length and obscures intent. Some method names are quite long, and lines occasionally contain multiple actions (e.g., registering observers and appending items in the same block), reducing action granularity. The nesting is flat, which is good, but the lack of explanatory comments or helper methods makes it harder to quickly grasp the relationships between composites and collections. Overall, the code is understandable for someone familiar with the domain, but could be improved by extracting common setup steps and clarifying the purpose of each assertion.
Run 3
The code is generally clear and well-structured for a test class. Each test method has a single, focused purpose. Action granularity is good—most lines perform one logical operation. Nesting is minimal, and the reading flow follows the natural setup-action-assert pattern. Method names are highly descriptive, significantly aiding clarity of intent. However, there is some repetition in the setup logic (e.g., creating composites and adding children), which slightly impacts conciseness and could be extracted into helper methods. Overall, the code is readable and maintainable.
Run 1
Code Structure: Tests are logically separated into focused methods covering related removal and notification behaviors. Nesting: All methods are flat, with no nested control flow. Clarity of intent: Descriptive test names and explicit assertions communicate expected behavior, although generic fixture names such as composite2 require some interpretation. Code length: Each test is concise; repeated setup adds modest duplication but keeps tests self-contained. Action granularity: Each statement performs one clear action, with sensible continuation lines for longer expressions. Reading flow: Setup, operation, and assertion generally follow a natural sequence. Very long method names, inconsistent naming styles, and the legacy failIf assertion slightly reduce readability.
Run 2
Code Structure: Tests are logically separated by behavior, with consistent setup, action, and assertion phases. Nesting: All tests are flat, making execution easy to follow. Clarity of intent: Descriptive test names and explicit assertions communicate expected behavior, although generic fixture names such as composite2 and implicit fixture setup require some context. Code length: Each test is short and focused; repeated setup adds minor verbosity but keeps tests self-contained. Action granularity: Each statement performs one primary action, with no compressed multi-statement lines. Reading flow: Operations follow a natural chronological sequence, and whitespace separates tests clearly. Long method names, a lengthy final assertion, and slightly uneven continuation indentation modestly reduce readability.
Run 3
Code Structure: Well-organized, focused test methods each cover a specific behavior. Nesting: Flat execution with no nested control flow makes the tests easy to scan. Clarity of intent: Descriptive method names and explicit assertions communicate expected behavior, although generic fixture names such as composite2 and implicit setup require some context. Code length: Tests are concise; repeated setup adds minor duplication but keeps each scenario self-contained. Action granularity: Each statement performs one main operation, with clear separation between setup, the tested action, and assertions. Reading flow: Steps follow a natural sequence, and spacing separates tests effectively. Very long method names and the final assertion's lengthy expression slightly reduce readability.