Sample

Dorn/python/12

Human rating uses the original dataset scale.

DatasetDorn
Human3.94
Lines30

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
52.9Δ 36.5
Dorn0.8160–1; higher is more readable
79.4Δ 10.0
Mi0.3130–1; higher is more readable
29.8Δ 59.6
LLOC17Logical lines; fewer is more readable
41.2Δ 48.2
DeepSeek V4 Pro13.330–20; mean of three runs
61.0Δ 28.4
GPT-6.1 Sol150–20; mean of three runs
52.8Δ 36.6
BTTF0.5290–1; higher is more readable
53.2Δ 36.2
Human3.941–5; original rating
89.4

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.717.332−23.672
Source linesThe number of non-empty source lines.30+12
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.373−6.56

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

Feature contributions

FeatureValueContribution
(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.69.839+0.707
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.073+0.235
Indentation frequencyHow rapidly indentation changes from line to line.25+0.128
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.47.871−0.032
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.30−0.026
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.29.746+0.006

Intercept 0.07 + feature contributions = 1.486 (log-odds).
Score = sigmoid(1.486) = 0.816.

Score0.313
Score17
Run 1

The code is relatively clear but has some readability issues. The first line begins with an indentation error and a syntax mistake (`except Exception, e:` is Python 2 style and invalid in Python 3). This reduces clarity. The `Invoke` method has a clear docstring explaining its purpose, which helps intent. The method body is mostly flat and follows a logical flow: create event, post it, wait if sync, then raise or return. However, the use of `event.event.wait()` is confusing due to the repeated 'event' name, and the mixing of sync/async logic in one method adds some complexity. The `synchronized` decorator is concise but assumes understanding of `Invoke`'s behavior. Nesting is minimal, and action granularity is generally one action per line. Overall, the code is understandable if the reader knows the GUI threading context, but the syntax error and naming redundancy lower its readability score.

Run 2

The code lacks consistent indentation and contains a Python 2 exception syntax (`except Exception, e:`) which is invalid in Python 3, hurting clarity. The structure is somewhat logical but the snippet begins mid-method, making context unclear. Nesting is flat, which is good, and action granularity is mostly one action per line. Intent is partially clear from the docstrings, but errors in syntax and formatting reduce readability. The `Invoke` method is reasonably concise, though the control flow with sync/async handling and exception re-raising could be clearer. Overall, the code is functional but has noticeable readability issues.

Run 3

The code has a logical structure with clear intent, especially in the docstrings and function names like 'Invoke' and 'synchronized'. However, readability suffers due to two notable issues: first, there is a syntax error ('except Exception, e:' is Python 2 style and invalid in Python 3), which would break execution. Second, the first code block appears incomplete or out of context, starting mid-function with an indentation that makes it hard to follow without the surrounding class definition. The 'Invoke' method is reasonably concise but mixes argument forwarding, event posting, waiting, and error handling in a single block, somewhat reducing action granularity. The 'synchronized' decorator is simple and clear. Overall, the code is understandable but could be improved with better context, modern exception syntax, and minor structural separation.

Run 1

Code Structure: Invocation and synchronization responsibilities are separated into a method and decorator, but the snippet starts mid-block, obscuring the surrounding exception-handling structure. Nesting: Shallow conditionals and a single nested decorator wrapper keep complexity low. Clarity of intent: Descriptive names and docstrings explain GUI-thread dispatch, though the Invoke docstring omits the sync argument in its example, contains awkward wording, and the decorator docstring has a typo. Code length: Concise, with little unnecessary code. Action granularity: Each line generally performs one operation, making execution easy to trace. Reading flow: Event creation, posting, optional waiting, exception propagation, and result return follow a natural sequence. However, the incomplete opening and legacy Python exception syntax reduce readability for modern readers.

Run 2

Code Structure: The invocation method and synchronization decorator are logically separated, but the snippet starts mid-block, obscuring the exception-handling context. Nesting: Shallow nesting keeps the method and decorator easy to follow. Clarity of intent: Descriptive identifiers and docstrings explain GUI-thread dispatch and synchronous execution, although the Invoke docstring omits the required sync argument in its example and contains awkward phrasing. Code length: The implementation is concise, with little unnecessary code. Action granularity: Each statement performs a single clear operation. Reading flow: Event creation, posting, optional waiting, exception propagation, and result return form a natural sequence. The truncated opening, legacy exception syntax, and docstring typo slightly disrupt readability.

Run 3

Code Structure: Invoke and the decorator are logically separated, but the excerpt begins mid-block, obscuring the surrounding exception-handling structure. Nesting: Shallow conditionals and a simple nested wrapper are easy to follow. Clarity of intent: Descriptive event fields and docstrings explain GUI-thread invocation, although the Invoke docstring omits the sync argument in its example and the decorator docstring contains a typo. Code length: Concise, with little unnecessary code. Action granularity: Each statement performs a single clear action. Reading flow: Event creation, posting, optional waiting, exception propagation, and return follow a natural sequence. The incomplete opening and legacy exception syntax slightly interrupt readability.