Sample
Dorn/python/103
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.945 | 0–1; higher is more readable | 90.8Δ 8.9 |
| Scalabrino | 0.662 | 0–1; higher is more readable | 69.8Δ 30.0 |
| Dorn | 0.864 | 0–1; higher is more readable | 90.3Δ 9.5 |
| Mi | 0.517 | 0–1; higher is more readable | 54.9Δ 44.8 |
| LLOC | 6 | Logical lines; fewer is more readable | 72.8Δ 26.9 |
| DeepSeek V4 Pro | 14.67 | 0–20; mean of three runs | 74.1Δ 25.6 |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs | 66.0Δ 33.7 |
| BTTF | 0.576 | 0–1; higher is more readable | 67.4Δ 32.3 |
| Human | 4.3 | 1–5; original rating | 99.7 |
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) |
|---|---|---|
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 3.99 | −5.985 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 110.413 | −3.644 |
| Source linesThe number of non-empty source lines. | 9 | +3.6 |
Intercept 8.87 + feature contributions = 2.841 (log-odds).
Score = sigmoid(2.841) = 0.945.
| Score | 0.662 |
|---|
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. | 8 | +0.753 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.035 | +0.599 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 7 | −0.495 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 78 | +0.454 |
| 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. | 78 | +0.361 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 8.646 | −0.289 |
Intercept 0.07 + feature contributions = 1.852 (log-odds).
Score = sigmoid(1.852) = 0.864.
| Score | 0.517 |
|---|
| Score | 6 |
|---|
Run 1
The code is generally readable with clear function names and descriptive docstrings. Structure is flat with minimal nesting, and each action is on its own line. However, minor issues reduce clarity: the class-level instance deletion via `del class_.instance` requires knowledge of how the instance is stored internally, making intent slightly opaque. The blank line after the docstring in `hasInstance` and lack of a return statement (implicitly returning None) obscure the boolean expectation implied by the function name. Additionally, no error handling or return value confirmation exists for deletion. Overall, the code is concise and logical, but could benefit from an explicit `return False` or clearer instance storage access.
Run 2
The code is concise and readable. It has a flat structure with no nesting beyond a single conditional. Each function has a clear docstring explaining intent. Actions are separated per line, and the reading flow is natural. Minor deductions: the parameter name 'class_' is slightly awkward, and 'deleteInstance' performs two conceptually distinct actions (checking and deleting) though they are on separate lines. Overall, clarity is strong.
Run 3
The code is straightforward and mostly readable, but it has several significant issues. The primary problem is that it references 'class_.instance' without defining it anywhere in the shown snippet, making the intent ambiguous. Additionally, the code uses 'class_' as a parameter name, which is non-standard Python convention and suggests this is likely a metaclass or factory pattern that isn't clearly explained. The 'deleteInstance' function attempts to delete 'class_.instance' but doesn't set it to None or use a proper setter method, which could leave the class in an inconsistent state. The docstrings are helpful but don't compensate for the unclear implementation details. On the positive side, the code is flat (no nesting), concise, and each function has a single clear purpose. The action granularity is appropriate with one main operation per function. Overall, it's readable at a surface level but lacks the contextual information needed to truly understand how the instance management works.
Run 1
Code Structure: Two logically related methods are clearly separated, but hasInstance lacks an implementation. Nesting: Minimal, with only one conditional. Clarity of intent: Method names and docstrings clearly describe singleton instance management and testing use, although the incomplete hasInstance method leaves behavior uncertain. Code length: Concise without unnecessary statements. Action granularity: Each statement performs one action. Reading flow: Straightforward, though deleteInstance calls hasInstance before its definition, and the latter ends with only a docstring.
Run 2
Code Structure: Methods are clearly separated and logically related, but hasInstance lacks an implementation. Nesting: Minimal, with only one conditional level. Clarity of intent: Descriptive method names and docstrings communicate singleton management and testing purposes, though the missing implementation leaves behavior unclear. Code length: Concise, without unnecessary statements. Action granularity: Each executable line performs one action. Reading flow: Natural and easy to follow, although inconsistent docstring spacing and the incomplete second method reduce polish.
Run 3
Code Structure: Two logically related methods are clearly separated, but hasInstance lacks an implementation. Nesting: A single conditional keeps nesting shallow. Clarity of intent: Descriptive method names and docstrings clearly communicate singleton management and test cleanup, though the incomplete hasInstance method leaves its behavior uncertain. Code length: Concise, with no unnecessary statements. Action granularity: Each statement performs one action. Reading flow: Natural and easy to follow; inconsistent docstring spacing and the unfinished second method slightly disrupt readability.