Sample
Dorn/python/90
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 26.5Δ 30.9 |
| Scalabrino | 0.528 | 0–1; higher is more readable | 46.9Δ 10.5 |
| Dorn | 0.696 | 0–1; higher is more readable | 64.9Δ 7.5 |
| Mi | 0.328 | 0–1; higher is more readable | 32.0Δ 25.3 |
| LLOC | 20 | Logical lines; fewer is more readable | 32.5Δ 24.9 |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs | 65.9Δ 8.5 |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs | 52.8Δ 4.6 |
| BTTF | 0.523 | 0–1; higher is more readable | 51.0Δ 6.4 |
| Human | 3.41 | 1–5; original rating | 57.4 |
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. | 1166.568 | −38.497 |
| Source linesThe number of non-empty source lines. | 29 | +11.6 |
| 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.454 | −6.681 |
Intercept 8.87 + feature contributions = -24.708 (log-odds).
Score = sigmoid(-24.708) = 0.
| Score | 0.528 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 77 | +0.438 |
| 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. | 77 | +0.404 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 26 | −0.176 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 25 | +0.128 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.101 | −0.038 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 29 | +0.01 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 28.756 | −0.008 |
Intercept 0.07 + feature contributions = 0.827 (log-odds).
Score = sigmoid(0.827) = 0.696.
| Score | 0.328 |
|---|
| Score | 20 |
|---|
Run 1
The code is moderately readable. The first method is fairly clear, with logical comments and one action per line, though variable naming is inconsistent (e.g., 'icone' vs 'icon'). The second method uses recursion but is written iteratively with a while loop, which adds unnecessary complexity and reduces intent clarity. Nesting is minimal overall, which is good. However, the fragment lacks surrounding class context, making the purpose of some operations slightly ambiguous. The comments help but are sparse. Code length is concise, but the second method's manual index management ('childNum') could be replaced with a for loop for improved readability and natural reading flow.
Run 2
The code is generally readable with clear intent and logical structure. The first block handles drag-and-drop setup with one action per line and good naming. The second block recursively translates items and uses a while loop with explicit child indexing, which works but is slightly less Pythonic than a for loop over range(childCount). Comments clarify intent for non-obvious operations. Minor inconsistencies in naming (icone vs icon, child_item vs childNum) slightly disrupt the flow. Overall, the code is straightforward and maintainable, though small improvements in naming consistency and loop choice could enhance readability.
Run 3
The code is moderately readable but has several issues. Structure is logical but inconsistent—comments explain some actions while others remain opaque (e.g., the magic number 1000 and SYMBOLS indexing). Nesting is acceptable but the while loop is more verbose than necessary; a for loop over range(childCount) would improve clarity. Intent is partially clear: the drag-and-drop setup and recursive translation are understandable, though variable naming like 'icone' (French) slightly breaks consistency. Code length is reasonable but could be more concise. Action granularity is mostly good—one operation per line in the first block—but the recursion loop mixes incrementing and recursive calls on adjacent lines. Reading flow suffers from missing context: 'drag' and 'SYMBOLS' are externally defined, and the vertical spacing between methods is inconsistent. Overall, the code shows structure but lacks polish in naming, comments, and loop idiomatics.
Run 1
Code Structure: Drag setup and translation methods are logically separated, although the snippet begins mid-method and lacks context. Nesting: Shallow overall, with a child-iteration loop inside one conditional. Clarity of intent: Method names and comments explain the main purposes, but the magic offset 1000, SYMBOLS lookup, and inconsistent names such as iconeSize obscure details. Child translation being conditional on parent data is not clearly justified. Code length: Mostly concise, though a direct iteration could replace the manual counter loop. Action granularity: Each line generally performs one action, making operations easy to follow. Reading flow: Drag configuration follows a natural sequence, and recursive translation is understandable; excess blank lines and inconsistent naming slightly interrupt the flow.
Run 2
Code Structure: Drag setup and translation are logically grouped into separate methods, though the snippet starts mid-method. Nesting: Limited nesting keeps the code approachable, including the recursive child traversal. Clarity of intent: Comments and Qt method names communicate the purpose, but the magic number 1000, SYMBOLS lookup, and names such as icone obscure details. Child translation being conditional on parent data is not explained. Code length: Mostly concise, although a for loop would simplify the manual while-loop counter. Action granularity: Each line generally performs one action, with only modest expression complexity. Reading flow: Operations follow a natural sequence, but inconsistent naming, extra blank lines, and the unused MainWindow parameter slightly disrupt readability.
Run 3
Code Structure: Drag setup and translation are grouped logically, but the snippet begins mid-method, limiting context. Nesting: Mostly shallow, with a manageable conditional and loop in retranslateItem. Clarity of intent: Method names and comments explain the main purposes, although the magic offset 1000, inconsistent names such as iconeSize, and unused MainWindow parameter reduce clarity. Code length: Generally concise, but the manual child counter could be replaced with a simpler for loop. Action granularity: Each line performs one main action, making operations easy to follow. Reading flow: Drag configuration proceeds naturally, followed by recursive translation and UI population. However, child translation occurs only when the parent has translation data, an implicit dependency that makes the recursion less immediately intuitive.