Sample

Dorn/python/5

Human rating uses the original dataset scale.

DatasetDorn
Human3.92
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
34.8Δ 53.2
Scalabrino0.5820–1; higher is more readable
57.4Δ 30.7
Dorn0.6070–1; higher is more readable
52.4Δ 35.7
Mi0.2630–1; higher is more readable
25.6Δ 62.4
LLOC37Logical lines; fewer is more readable
3.6Δ 84.4
DeepSeek V4 Pro140–20; mean of three runs
65.9Δ 22.1
GPT-6.1 Sol13.330–20; mean of three runs
34.7Δ 53.3
BTTF0.5330–1; higher is more readable
54.9Δ 33.1
Human3.921–5; original rating
88.0

Views

Download official ZIP ↗

Select the downloaded ZIP or its extracted folder. Files stay in your browser.

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.1299.669−42.889
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.227−6.34

Intercept 8.87 + feature contributions = -20.359 (log-odds).
Score = sigmoid(-20.359) = 0.

Score0.582

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.47+0.889
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.51−0.769
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.96.961+0.76
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.47−0.658
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.96.882−0.438
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.066+0.297
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.704+0.285

Intercept 0.07 + feature contributions = 0.435 (log-odds).
Score = sigmoid(0.435) = 0.607.

Score0.263
Score37
Run 1

The code is generally readable and structured logically with separate functions and reasonable naming. The main function flows sequentially from selection handling to document-wide counting. However, readability issues exist: inconsistent Python 2 syntax (print statement, comment style), a slightly convoluted wordsplit function that could be more concise, repeated error handling blocks, and some nesting in the try/except blocks. The error handling pattern (try/except with pass/exit) is repeated twice and could be extracted. The pluralization logic for 'textframes' adds minor clutter. Comments explain non-obvious decisions but the overall flow could be improved by consolidating the counting logic into a helper function. The code is not deeply nested and intent is mostly clear, but the mixed concerns of UI messages, error handling, and counting logic reduce readability.

Run 2

The code is generally readable but has several issues. The structure is logical with clear separation between the word-splitting function and main logic, though the main function is somewhat long. Nesting is moderate, with two levels of loops and try/except blocks. Intent is mostly clear—counting words in selected frames or the whole document—but some comments are unnecessary (e.g., '#plural', '# ignore the error'). Action granularity is good, with one action per line. Reading flow is natural. However, the code uses outdated Python 2 syntax (print statement, no parentheses), which reduces modern readability. The wordsplit function could be simplified with regex findall. Repeated try/except blocks add verbosity. The pass statements with comments are acceptable but could be cleaner with a helper function. Overall, readable but not exemplary.

Run 3

The code has a clear structure with separate functions and a logical main flow. Nesting is mostly shallow. However, several issues hurt readability: mixed language comments, an unnecessary try/except in 'wordsplit', a redundant 'pass' with a duplicate comment, and unclear variable names like 'x'. The use of semicolons and the broad 'from scribus import *' also reduce clarity. Positive aspects include concise function design and reasonable action separation.

Run 1

Code Structure: Imports, a word-splitting helper, and main logic provide reasonable organization, but counting logic is duplicated and main ends without displaying a result. Nesting: Selection handling and document traversal reach several indentation levels, making control flow harder to scan. Clarity of intent: Names such as wordsplit, sel_count, and getText communicate the word-counting purpose, although wildcard imports obscure dependencies and source is unused. Code length: Fairly compact, but repeated counting and exception handling could be consolidated. Action granularity: Most lines perform one action; the inline pluralization conditional and unnecessary semicolon reduce consistency. Reading flow: The selected-frames versus whole-document branches are logical, and comments explain exception handling, but inconsistent formatting, silent skips, and the missing invocation or output leave the overall flow feeling incomplete.

Run 2

Code Structure: Imports, a word-splitting helper, and main logic provide reasonable organization, but counting logic is duplicated between selection and document paths. Nesting: Several nested loops, try/except blocks, and conditionals make the main function harder to scan. Clarity of intent: Names and comments generally explain word counting and non-text-frame handling, although wildcard imports obscure API origins and the computed count and source are never displayed or returned. Code length: Mostly concise, with some avoidable duplication and a verbose split-and-filter helper. Action granularity: Most lines perform one action, but the inline pluralization conditional and unnecessary semicolon reduce consistency. Reading flow: The selected-objects versus whole-document branching is natural, but uneven formatting, a late import, and the missing main invocation and result handling leave the script feeling incomplete.

Run 3

Code Structure: Imports, a word-splitting helper, and main processing are logically separated, but selected-frame and whole-document paths duplicate counting logic. Nesting: Several layers of loops, try/except blocks, and conditionals make main harder to scan. Clarity of intent: Word counting and non-text-frame handling are understandable, though wildcard imports obscure API origins, x is vague, and source is unused in the shown code. Code length: Fairly concise, with some avoidable duplication and a verbose word-splitting implementation. Action granularity: Most lines contain one action, but the inline pluralization conditional compresses control flow. Reading flow: Generally natural, aided by comments, but inconsistent spacing, a stray semicolon, and the absence of a shown result or main invocation make the snippet feel incomplete.