Sample
Dorn/python/53
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 14.2Δ 63.5 |
| Dorn | 0.625 | 0–1; higher is more readable | 54.3Δ 23.4 |
| Mi | 0.014 | 0–1; higher is more readable | 3.3Δ 74.4 |
| LLOC | 33 | Logical lines; fewer is more readable | 6.7Δ 71.0 |
| DeepSeek V4 Pro | 8 | 0–20; mean of three runs | 29.4Δ 48.3 |
| GPT-6.1 Sol | 12.67 | 0–20; mean of three runs | 27.3Δ 50.4 |
| BTTF | 0.53 | 0–1; higher is more readable | 53.8Δ 24.0 |
| Human | 3.72 | 1–5; original rating | 77.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) |
|---|---|---|
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 1967.274 | −64.92 |
| 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.484 | −6.725 |
Intercept 8.87 + feature contributions = -42.775 (log-odds).
Score = sigmoid(-42.775) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 130 | −1.841 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 129.98 | +1.293 |
| 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. | 40 | +0.646 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.427 |
| 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. | 49.794 | +0.286 |
Intercept 0.07 + feature contributions = 0.51 (log-odds).
Score = sigmoid(0.51) = 0.625.
| Score | 0.014 |
|---|
| Score | 33 |
|---|
Run 1
The code has several readability issues. Structure is weak: there's an obvious indentation error where the while loop and subsequent lines are over-indented, and the function definition appears disconnected from the preceding code. The while/else pattern with file validation is confusing and unconventional. Nesting is deep in main(), with multiple nested conditionals and try/except blocks spanning many lines. Intent is sometimes unclear due to missing function definitions (e.g., getColorsFromCsv, importColors) and inconsistent comment quality. Code length is moderate but made harder to parse by unnecessary else clauses after exit/return statements. Action granularity is generally acceptable—mostly one action per line—but the indentation problem undermines visual flow. Reading flow is disjointed: the initial over-indented block (likely part of importColors function) lacks its function header, and the abrupt transition into main() is jarring. While some descriptive comments and docstrings exist, structural errors and nesting prevent higher readability.
Run 2
The code has some logical organization with separate functions and comments, but readability suffers from inconsistent indentation (mixing tabs/spaces), deep nesting in main() with multiple if/else layers, and broad exception handling ('except:' without specific exceptions). The while-else construct is unusual and likely a bug, making intent unclear. Variable names like 'c', 'm', 'y', 'k' are concise but may lack context for non-print-savvy readers. Some lines combine multiple actions (e.g., progressSet and increment), reducing action granularity. Reading flow is disrupted by abrupt exits and mixed commenting style. Overall, the code works but requires effort to follow.
Run 3
The code has some positive aspects such as docstrings and comments in key places, and the main_wrapper structure is logical. However, several issues significantly reduce readability. The first code fragment starts mid-function with inconsistent indentation, which disrupts flow. There is deep nesting in main(), especially within the while-else and try-except blocks, making the logic harder to follow. Multiple actions are packed onto single lines (e.g., filename=scribus.fileDialog...), and some lines are excessively long. The use of `has_key` is outdated and less readable than modern Python alternatives. The while-else construct is unusual and potentially confusing. Error handling via a bare except hides details and makes debugging harder. Variable naming is mostly clear but not consistently descriptive (c, m, y, k). Overall, the code requires effort to understand due to nesting, line density, and unconventional constructs.
Run 1
Code Structure: main and main_wrapper separate importing from cleanup reasonably well, but the opening fragment lacks context. Nesting: unnecessary else branches after sys.exit(), a while-else, and nested try/if blocks complicate control flow. Clarity of intent: descriptive API calls and function names communicate the import workflow, although terse variables, a bare except, and a wrapper docstring that overstates its behavior reduce clarity. Code length: mostly compact, but repeated file-dialog calls, redundant branches, and lengthy comments add avoidable bulk. Action granularity: statements generally perform one action per line. Reading flow: the workflow is understandable, but inconsistent spacing, long lines, commented-out code, and excessive blank lines interrupt scanning.
Run 2
Code Structure: Separate main and wrapper functions organize importing and cleanup logically, though the opening fragment lacks context. Nesting: Unnecessary else branches after sys.exit() and a while-else construct create avoidable depth. Clarity of intent: Descriptive Scribus API calls, messages, and docstrings make the purpose clear; a bare except obscures failure causes, and the wrapper docstring describes behavior not fully shown. Code length: Mostly compact, but repeated file-dialog calls, redundant comments, and a lengthy wrapper docstring add clutter. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: The import sequence is understandable, but inconsistent spacing, long messageBox lines, commented-out code, and nested control flow interrupt smooth reading.
Run 3
Code Structure: Separate main and wrapper functions organize importing and cleanup logically, but the opening fragment lacks context. Nesting: Unnecessary else branches after sys.exit(), a while-else construct, and nested try/if blocks complicate the main function. Clarity of intent: Descriptive Scribus calls, messages, and docstrings explain the workflow, though generic names and a bare except obscure details. Code length: Mostly compact, but repeated file-dialog calls, redundant comments, and an overly detailed wrapper docstring add clutter. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: The workflow proceeds naturally from document validation to file selection, confirmation, import, and cleanup; inconsistent spacing, long lines, commented-out code, and excessive indentation interrupt that flow.