Sample

Dorn/python/63

Human rating uses the original dataset scale.

DatasetDorn
Human4.08
Lines48

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0010–1; higher is more readable
60.7Δ 33.1
Dorn0.780–1; higher is more readable
75.5Δ 18.4
Mi0.4080–1; higher is more readable
39.8Δ 54.0
LLOC19Logical lines; fewer is more readable
35.5Δ 58.4
DeepSeek V4 Pro14.670–20; mean of three runs
74.1Δ 19.8
GPT-6.1 Sol160–20; mean of three runs
66.0Δ 27.9
BTTF0.6180–1; higher is more readable
77.9Δ 16.0
Human4.081–5; original rating
93.9

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.849.407−28.03
Source linesThe number of non-empty source lines.48+19.2
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.488−6.732

Intercept 8.87 + feature contributions = -6.693 (log-odds).
Score = sigmoid(-6.693) = 0.001.

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.49−0.699
Indentation frequencyHow rapidly indentation changes from line to line.38+0.577
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.73+0.573
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.039+0.562
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.38−0.451
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.73+0.373
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.47.892+0.26

Intercept 0.07 + feature contributions = 1.266 (log-odds).
Score = sigmoid(1.266) = 0.78.

Score0.408
Score19
Run 1

The code is well-structured with clear sections: imports, error handling, function definitions, and a main guard. Nesting is minimal, and intent is clear through descriptive function names and comments. The length is concise, with each action generally on its own line. The reading flow is natural, moving logically from setup to execution. Minor issues include the use of Python 2 syntax (e.g., 'except ImportError, err') and the lack of a trailing 'main()' call before the `if __name__ == '__main__':` block, which appears incomplete. The comment about timer scope is helpful but slightly verbose. Overall, highly readable with only minor modernization and completeness concerns.

Run 2

The code is generally readable, with a clear modular structure, straightforward function definitions, and minimal nesting. The module docstring clearly explains the script's purpose and a notable caveat about timer references. Import error handling is separated into distinct try/except blocks, improving clarity and error messaging. Function and variable names are descriptive. The main execution flow is logical. Minor drawbacks include a missing call to main() under the __main__ guard, which would break the script as shown. Additionally, the use of Python 2-style 'except ImportError,err' syntax and print statements dates the code, potentially confusing for users of modern Python. Action granularity is good, with one main action per line inside functions. Overall, the code is concise and understandable but would benefit from Python 3 conventions and a fixed entry point call.

Run 3

The code is clearly structured with reasonable separation of concerns (imports, error handling, functions) and has a helpful docstring. Nesting is minimal. However, the script is incomplete: the final `if __name__ == '__main__':` block lacks the call to `main()`, making the intent unclear and defeating the purpose of the demo. Error handling is repetitive in the second try/except. The code uses Python 2 syntax (`except ImportError, err`), which may confuse readers expecting Python 3. Some lines are long, especially the `messageBox` calls. The global `timer` variable is explained but may still be confusing. The variable naming is acceptable but not particularly descriptive. Overall, the structure is solid but the omission of the `main()` invocation and outdated Python syntax reduce readability.

Run 1

Code Structure: Imports, dependency checks, callback, and timer setup are logically separated, but the final entry-point guard has no body, leaving the script incomplete. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The introductory docstring and dialog text clearly explain the timer demo and its lifetime; however, 'msg' is vague, and the global timer introduces implicit state. Code length: Appropriately short, with a somewhat lengthy but useful dependency-error message. Action granularity: Each statement performs one clear action, and multiline calls are formatted consistently. Reading flow: The progression from dependency checks to callback and setup is natural, but the unfinished entry point interrupts the execution narrative. Legacy Python and Qt syntax may also be less familiar to modern readers.

Run 2

Code Structure: Imports, dependency checks, callback, and setup function are logically separated, but the empty entry-point guard leaves the script visibly incomplete. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring and user-facing messages clearly explain the timer demonstration; however, the generic callback name 'msg', global timer state, and unexplained True argument reduce clarity slightly. Code length: Compact and appropriate for a demonstration, with a useful explanatory docstring. Action granularity: Each statement performs a distinct action, and multiline message calls remain readable. Reading flow: Progresses naturally from dependency checks to callback and timer setup, but ends abruptly without calling main(). Legacy Python and Qt syntax may be less familiar to modern readers.

Run 3

Code Structure: Imports, dependency checks, callback, and timer setup are logically separated, but the empty entry-point block leaves the script visibly incomplete. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The introductory docstring and dialog messages explain the timer demonstration well; however, the generic callback name 'msg', global timer state, and positional True argument reduce explicitness. Code length: The script is concise, with a somewhat lengthy but helpful dependency-error message. Action granularity: Each statement generally performs one action, and multiline calls remain clearly formatted. Reading flow: Execution progresses naturally from dependency checks to function definitions, but the missing main() call disrupts the ending. Legacy Python and Qt syntax may also be less familiar to modern readers.