Sample
Dorn/python/81
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 2.2Δ 35.7 |
| Scalabrino | 0.397 | 0–1; higher is more readable | 29.1Δ 8.8 |
| Dorn | 0.157 | 0–1; higher is more readable | 10.9Δ 27.0 |
| Mi | 0.223 | 0–1; higher is more readable | 22.0Δ 15.9 |
| LLOC | 42 | Logical lines; fewer is more readable | 0.1Δ 37.7 |
| DeepSeek V4 Pro | 11.67 | 0–20; mean of three runs | 51.4Δ 13.5 |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs | 73.8Δ 35.9 |
| BTTF | 0.289 | 0–1; higher is more readable | 14.8Δ 23.1 |
| Human | 3.13 | 1–5; original rating | 37.9 |
Views
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. | 3268.854 | −107.872 |
| 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.544 | −6.816 |
Intercept 8.87 + feature contributions = -85.819 (log-odds).
Score = sigmoid(-85.819) = 0.
| Score | 0.397 |
|---|
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. | 51 | −0.769 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 1 | −0.703 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.133 | −0.35 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.855 | +0.287 |
| 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. | 81.961 | +0.194 |
Intercept 0.07 + feature contributions = -1.678 (log-odds).
Score = sigmoid(-1.678) = 0.157.
| Score | 0.223 |
|---|
| Score | 42 |
|---|
Run 1
The code has a clear purpose: providing assertion mixins for testing task-related objects. It uses small classes and methods, which aids organization. However, readability suffers from several issues. The first line is an isolated assertion with inconsistent indentation, suggesting a truncated or misplaced snippet. Methods use semantically vague names like 'failUnless' and 'failIf' instead of more modern 'assertIn'/'assertNotIn' or 'assertTrue'/'assertFalse'. The 'assertTaskCopy' method is extremely long, performing many sequential assertions with a deep recursive call; this hurts action granularity and reading flow. Nesting is shallow overall, which is good, but the long method reduces clarity of intent. Code length is reasonable for the functionality but could be more concise with helper methods or data-driven checks. Overall, the logical structure is present, but clarity and natural reading flow are moderately impaired.
Run 2
The code is generally readable but has some issues. Structure is logical with clear mixin separation, though the first line appears orphaned context. Nesting is mostly flat except for if/loop blocks, which is good. Clarity of intent is strong due to descriptive method names and assertions, but the 'failUnless/failIf' style is outdated versus 'assertTrue/assertFalse'. Code length is reasonable but some methods like 'assertTaskCopy' are lengthy with repetitive assertions. Action granularity is mostly one action per line, though some long lines exist. Reading flow is natural and follows expected test patterns. Main drawbacks are the orphaned first line, outdated assertion naming, and slight repetition that could be extracted into helpers.
Run 3
The code consists of test assertion mixins but suffers from several readability issues. Structure is partially organized into classes, but there are stray lines and inconsistent spacing, making the start feel fragmented. Nesting is mostly shallow, which is good, but the assertTaskCopy method is excessively long, containing many assertions without grouping or helper extraction, reducing clarity. Clarity of intent is moderate: method names are descriptive but the repeated equality checks obscure the purpose of testing a 'copy'. Code length is unnecessarily long—dozens of near-identical assertions could be replaced with a loop or helper. Action granularity is mostly one assertion per line, which is positive, but some lines wrap awkwardly. Reading flow is disrupted by the abrupt start, blank lines between classes, and the monolithic recursive method, making it harder to follow than necessary.
Run 1
Code Structure: Cohesive mixins group related assertions logically, though the opening line lacks context. Nesting: Shallow loops and a single conditional keep the code easy to follow; recursion is explicit. Clarity of intent: Descriptive class and method names communicate testing purposes, although legacy failUnless/failIf assertions and abbreviated names slightly reduce clarity. Code length: Most methods are concise; assertTaskCopy contains a lengthy, repetitive checklist that could be grouped by property type. Action granularity: Each statement performs one assertion or control-flow action, making individual checks easy to inspect. Reading flow: Assertions progress naturally from properties to child and effort comparisons, but excessive blank lines, inconsistent whitespace, and the long ungrouped property sequence slightly interrupt readability.
Run 2
Code Structure: Mixins logically group related assertions, though the opening orphaned statement lacks context. Nesting: Mostly flat, with only shallow conditionals and loops; recursion remains easy to follow. Clarity of intent: Descriptive method names and explicit field comparisons make the testing purpose clear, although orig is abbreviated and copy shadows a common name. Code length: Generally concise, but assertTaskCopy contains a lengthy, repetitive sequence of assertions that could be grouped by purpose. Action granularity: Each line performs one assertion or control-flow action; the wrapped assertion is readable. Reading flow: Comparisons proceed predictably from task properties to child and effort copies, but excessive blank lines and inconsistent whitespace interrupt the flow.
Run 3
Code Structure: Related assertions are logically grouped into focused mixins, although the opening orphaned statement lacks context. Nesting: Shallow loops and a single conditional keep the code easy to follow; recursion is explicit. Clarity of intent: Descriptive class and method names communicate testing purposes clearly, though legacy failUnless/failIf calls and the parameter name copy slightly reduce clarity. Code length: Mostly concise, but assertTaskCopy contains a long, repetitive sequence of field comparisons. Action granularity: Each statement performs one assertion or control-flow action; the wrapped assertion remains readable. Reading flow: Comparisons progress naturally from task properties to child and effort copies, but excessive blank lines and inconsistent whitespace interrupt visual continuity.