Sample
Dorn/python/108
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable | 60.7Δ 38.2 |
| Dorn | 0.78 | 0–1; higher is more readable | 75.5Δ 23.4 |
| Mi | 0.408 | 0–1; higher is more readable | 39.8Δ 59.1 |
| LLOC | 19 | Logical lines; fewer is more readable | 35.5Δ 63.4 |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs | 69.9Δ 29.0 |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs | 61.6Δ 37.3 |
| BTTF | 0.618 | 0–1; higher is more readable | 77.9Δ 21.0 |
| Human | 4.2 | 1–5; original rating | 98.9 |
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. | 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
| Feature | Value | Contribution (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.
| Score | 0.408 |
|---|
| Score | 19 |
|---|
Run 1
The code is generally readable with clear structure: imports are separated, functions are small and focused, and the main guard is included. The use of docstring and comments is helpful, and error handling is explicit. However, there are a few readability issues: the code is incomplete (missing the call to main()), the use of `global timer` is slightly awkward, and the logic for setting up the Qt timer is somewhat scattered. Nesting is minimal and action granularity is mostly one action per line. The explanation in the docstring is a bit verbose but informative. Overall, the code is clear and easy to follow, but it would benefit from a final call to `main()` and perhaps encapsulating the timer logic into a single function to improve flow.
Run 2
The code is well-structured with clear sections: module docstring, imports, error handling, function definitions, and the main entry point. The docstring effectively explains a subtle timer lifecycle issue. Error handling is explicit and user-friendly. However, several issues reduce readability: the code uses Python 2 syntax (except ImportError, err), which may confuse modern readers. The script truncates immediately after the if __name__ == '__main__': block with no main() call, making intent unclear. The try/except blocks are slightly repetitive. Magic numbers like 5*1000 could be named constants. The global timer declaration adds complexity. Function definitions are clear and concise, with one action per line mostly maintained. Overall, the code is decent but incomplete and dated.
Run 3
The code has a clear modular structure with separate functions for the timer callback and main logic, plus useful error handling for missing dependencies. The docstring provides helpful context. However, several aspects reduce readability: the code is incomplete (missing main() call), uses Python 2-specific syntax (except ImportError,err and print statement), and the timer creation involves multiple actions on one line with the connect call using an older signal API. The global timer variable is only briefly mentioned in the docstring rather than being clearly evident in the code itself. Nesting is minimal and the flow is logical, but the incomplete state and outdated syntax make the code harder to follow for modern readers. The code would benefit from more explicit comments about the global scope issue and simpler PyQt timer usage patterns.
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 docstring and messages clearly explain the timer demonstration and lifetime concern; however, 'msg' is vague, and the global timer introduces implicit state. Code length: Appropriately concise, with a somewhat lengthy but helpful dependency-error message. Action granularity: Statements generally perform one action per line, and multiline calls are readable. Reading flow: The sequence from dependency checks to callback and setup is natural, but the unfinished entry point interrupts that flow and leaves main() uninvoked. Legacy Python and Qt syntax may also make reading less familiar to modern developers.
Run 2
Code Structure: Imports, dependency checks, callback, and setup are logically separated, but the final entry-point guard has no body, leaving the script visibly incomplete. Nesting: Shallow try/except blocks and simple functions make the code easy to scan. Clarity of intent: The introductory documentation and dialog messages clearly explain the timer demo; however, msg is a vague callback name, and global timer introduces implicit state. Code length: Appropriate for a small demonstration, though repeated dialog titles and lengthy dependency guidance add some bulk. Action granularity: Statements generally perform one action per line, with readable multiline argument formatting. Reading flow: The progression from dependency checks to callback and timer setup is natural, but the empty final guard interrupts the flow and leaves it unclear how main is invoked.
Run 3
Code Structure: Imports, dependency checks, callback, and setup function are logically organized, 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 demo; however, the generic callback name 'msg', global timer state, and positional True argument require some interpretation. Code length: Compact overall, with a somewhat lengthy but useful dependency-error message. Action granularity: Each statement performs a single clear action, and multiline calls are readable. Reading flow: The progression from dependency checks to callback and timer setup is natural, though the unfinished final guard interrupts it. Legacy Python and Qt syntax may be less familiar to modern readers.