Sample
Dorn/python/100
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 43.2Δ 19.2 |
| Scalabrino | 0.427 | 0–1; higher is more readable | 32.6Δ 8.6 |
| Dorn | 0.811 | 0–1; higher is more readable | 78.8Δ 54.9 |
| Mi | 0.37 | 0–1; higher is more readable | 35.9Δ 12.0 |
| LLOC | 16 | Logical lines; fewer is more readable | 43.7Δ 19.8 |
| DeepSeek V4 Pro | 12.33 | 0–20; mean of three runs | 55.8Δ 31.9 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 80.4Δ 56.4 |
| BTTF | 0.547 | 0–1; higher is more readable | 57.9Δ 34.0 |
| Human | 2.87 | 1–5; original rating | 24.0 |
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. | 839.581 | −27.706 |
| 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.539 | −6.809 |
Intercept 8.87 + feature contributions = -13.645 (log-odds).
Score = sigmoid(-13.645) = 0.
| Score | 0.427 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 93.968 | +0.712 |
| 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. | 93.968 | −0.315 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.069 | +0.272 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 28 | +0.231 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 27 | +0.08 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.832 | +0.007 |
Intercept 0.07 + feature contributions = 1.456 (log-odds).
Score = sigmoid(1.456) = 0.811.
| Score | 0.37 |
|---|
| Score | 16 |
|---|
Run 1
The code uses reasonable class naming conventions and breaks down test functionality into mixins, which aids organization. However, several readability issues exist. The line continuation backslash in the first class definition is awkward and unnecessary with parentheses. Multiple comments disabling pylint warnings suggest the code is fighting against accessibility concerns (accessing protected members). The method `assertCurrentSortColumn` combines fetching a private method result and asserting in one flow, which slightly obscures intent. While nesting is shallow and action granularity is generally one per line, the overall structure has some duplication with two very similar 'UnderTest' classes. The reading flow is interrupted by inline comments and unusual formatting choices. The code is functional but would benefit from cleaner line breaks, fewer private-member accesses, and better separation of setup from assertion logic.
Run 2
The code is reasonably readable but has some style inconsistencies and formatting quirks that reduce clarity. The structure is logical, using mixins for test reuse, but the class definitions span multiple lines with awkward line continuations and inline pylint disables that add noise. Nesting is minimal and flat, which is good. Intent is mostly clear—testing sortable column behavior—but the empty class bodies and underscore-prefixed method access suggest internal API usage that could confuse readers. Action granularity is appropriate, with one operation per line inside methods. However, the code length feels slightly inflated due to line-breaking style and duplicate class names for testing. Reading flow is natural overall, though the backslash line continuations and mixed indentation reduce readability. The test methods are concise and well-named, but the helper method's direct access to a private method with a pylint disable comment distracts. Overall, it is understandable but would benefit from cleaner formatting and reduced reliance on private member access.
Run 3
The code is structured into logical test classes and mixins, but readability is hindered by inconsistent indentation, trailing whitespace, and inline pylint comments that add noise. Nesting is flat, and intent is mostly clear, though the access to a protected method (_currentSortColumn) with pylint disable comments suggests a design smell. Action granularity is reasonable, with one action per line in most methods, but line continuations in class definitions disrupt the reading flow. Code length is concise, but the awkward line breaks and excessive whitespace make the overall structure feel disorganized. The test methods are simple and clear, but the mixin composition may confuse readers unfamiliar with the testing pattern. Overall, the code is functional but lacks polish in formatting and structure, which reduces its readability.
Run 1
Code Structure: Classes clearly separate test controls, shared assertions, and test cases, though related definitions could be grouped more consistently. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive class and method names communicate the sorting behavior being tested; external dependencies require some context. Code length: Concise, with little unnecessary code, although excess blank lines add visual noise. Action granularity: Each statement performs one clear action. Reading flow: Tests progress naturally from the default sort column to changing it, but inconsistent indentation, an unnecessary line-continuation backslash, long lines, and inline pylint comments slightly disrupt readability.
Run 2
Code Structure: Test controls, shared assertions, and test cases are logically separated, although defining CtrlWithColumnsUnderTest last slightly weakens organization. Nesting: Very shallow, with simple class and method bodies. Clarity of intent: Descriptive class and method names make the sorting tests easy to understand; external base classes and private members require some context. Code length: Concise, with little unnecessary code, though excess blank lines add visual noise. Action granularity: Each statement performs a single clear action. Reading flow: Tests naturally progress from checking the default sort column to changing it, but inconsistent continuation indentation, an unnecessary backslash, and inline pylint suppression comments interrupt the flow.
Run 3
Code Structure: Classes clearly separate test helpers, reusable assertions, and control creation, though the dependency on CtrlWithColumnsTestCase is not shown. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive class and method names clearly communicate sortable-column testing; private member access and framework-specific inheritance require some context. Code length: Concise overall, with minor excess whitespace and an unnecessary explicit line-continuation backslash. Action granularity: Each statement performs one clear action. Reading flow: Tests progress naturally from the default sort column to changing it, but inconsistent indentation of wrapped lines, long declarations, and inline pylint directives slightly interrupt readability.