Sample
Dorn/python/59
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable | 58.5Δ 18.1 |
| Scalabrino | 0.583 | 0–1; higher is more readable | 58.1Δ 18.5 |
| Dorn | 0.542 | 0–1; higher is more readable | 46.5Δ 30.1 |
| Mi | 0.253 | 0–1; higher is more readable | 24.2Δ 52.4 |
| LLOC | 8 | Logical lines; fewer is more readable | 63.9Δ 12.7 |
| DeepSeek V4 Pro | 13.33 | 0–20; mean of three runs | 61.0Δ 15.6 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 80.4Δ 3.8 |
| BTTF | 0.454 | 0–1; higher is more readable | 33.1Δ 43.5 |
| Human | 3.69 | 1–5; original rating | 76.6 |
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. | 418.43 | −13.808 |
| 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.312 | −6.469 |
| Source linesThe number of non-empty source lines. | 10 | +4 |
Intercept 8.87 + feature contributions = -7.407 (log-odds).
Score = sigmoid(-7.407) = 0.001.
| Score | 0.583 |
|---|
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 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 9 | +0.718 |
| 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. | 69.909 | +0.704 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 9 | −0.426 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 9.648 | −0.275 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.119 | −0.216 |
Intercept 0.07 + feature contributions = 0.169 (log-odds).
Score = sigmoid(0.169) = 0.542.
| Score | 0.253 |
|---|
| Score | 8 |
|---|
Run 1
The code is reasonably readable with clear intent and minimal nesting. Each test method is short and focused on a single behavior, and line-level action granularity is good. However, the excerpt is incomplete, showing the tail of one test and the beginning of another, which slightly disrupts structure and reading flow. The use of failUnless instead of the more common assertTrue is a minor clarity issue for modern readers. Overall, the code is concise, flat, and easy to follow.
Run 2
The code is highly readable due to its flat structure, minimal nesting, and clear intent. Each test method is short and focused, with one action per line, making the logic easy to follow. The naming is descriptive and aligns with Python testing conventions. Minor drawbacks include the use of the deprecated `failUnless` method instead of `assertTrue`, and slight ambiguity in the first test regarding why `weeknumber()` returns `None` and `str(adate)` returns an empty string. Overall, the code is concise and well-organized.
Run 3
The code snippet is taken out of context, making it difficult to assess full intent. It suffers from several readability issues: the first test method has an incomplete indentation level (likely accidental), making the structure confusing. The second test merges multiple actions unnecessarily by creating a date, storing it, and then asserting equality with a singleton in one flow, reducing clarity. Test names are reasonably descriptive, but the code relies on assertions like `failUnless` and `assertEqual` without showing imports or class context. The third test is the most readable: simple and clearly checks singleton behavior. Overall, the snippet is short and not deeply nested, which is positive. However, the lack of surrounding context, broken indentation, and mixed action granularity hamper readability. It would benefit from consistent formatting, separation of setup/assert phases, and clearer expression of intent in the second test.
Run 1
Code Structure: Tests are logically separated into focused methods, though the opening assertions lack their enclosing context. Nesting: Minimal indentation and no nested control flow make the code easy to scan. Clarity of intent: Descriptive test names clearly communicate singleton and maximum-date behavior; the initial assertions are less clear without context. Code length: Concise, with no unnecessary logic. Action granularity: Each line performs a single assignment or assertion. Reading flow: Setup naturally precedes verification, and blank lines separate tests cleanly. Legacy assertion methods and camelCase naming slightly reduce modern Python readability.
Run 2
Code Structure: Clearly separated tests provide logical organization, though the opening assertions lack their surrounding method context. Nesting: Minimal indentation and no nested control flow make the code easy to scan. Clarity of intent: Descriptive test names explain maximum-date handling and singleton behavior, but 'adate' is vague and the maximum date's relationship to an infinite date requires domain knowledge. Code length: Concise, with no unnecessary statements. Action granularity: Each line performs one assignment or assertion. Reading flow: Setup followed by assertions reads naturally, although the incomplete opening fragment slightly disrupts continuity. Legacy 'failUnless' assertions are understandable but less immediately familiar than modern assertion methods.
Run 3
Code Structure: Tests are logically separated into focused methods, though the opening assertions lack their enclosing method context. Nesting: Minimal indentation with no nested control flow. Clarity of intent: Descriptive test names and straightforward assertions clearly communicate singleton and maximum-date behavior; legacy failUnless usage and the unexplained adate slightly reduce clarity. Code length: Concise, without unnecessary repetition. Action granularity: Each line performs one assignment or assertion. Reading flow: Blank lines separate tests naturally, and setup precedes verification, but the partial opening fragment interrupts the overall flow.