Sample

Dorn/python/44

Human rating uses the original dataset scale.

DatasetDorn
Human3.94
Lines49

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
55.2Δ 34.5
Dorn0.8290–1; higher is more readable
81.9Δ 7.8
Mi0.5550–1; higher is more readable
58.2Δ 31.5
LLOC19Logical lines; fewer is more readable
35.5Δ 54.2
DeepSeek V4 Pro150–20; mean of three runs
77.3Δ 12.4
GPT-6.1 Sol14.670–20; mean of three runs
47.1Δ 42.6
BTTF0.5710–1; higher is more readable
66.6Δ 23.1
Human3.941–5; original rating
89.7

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.911.383−30.076
Source linesThe number of non-empty source lines.49+19.6
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.56−6.84

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.50−0.734
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.021+0.734
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
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.77.98+0.362
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.67.08+0.278
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.48.835+0.273
Indentation frequencyHow rapidly indentation changes from line to line.27+0.197

Intercept 0.07 + feature contributions = 1.578 (log-odds).
Score = sigmoid(1.578) = 0.829.

Score0.555
Score19
Run 1

The code is generally clear and well-structured. The module docstring and class documentation are helpful, and the `Filter` transform has a clear purpose with explicit examples. Naming is descriptive. However, the code is incomplete (the `else` block is cut off), which slightly impacts the final readability score. The `apply` method is concise and has a flat structure, but the line assigning `component` is long, and the comment `# 'reader' or 'writer'` is somewhat redundant. Overall, it follows good practices but would benefit from a complete implementation and minor formatting improvements.

Run 2

The code demonstrates good documentation and clear intent, but contains a critical structural flaw - the code snippet appears incomplete, with an unclosed else block and class definition breaking the code structure. The docstring is well-written and explains the purpose clearly, which contributes to understanding. However, there's an inline comment ('# 'reader' or 'writer'') after code that could be on its own line, and the final else statement lacks proper indentation and completion. The class has a clear purpose and the apply() method is relatively flat with minimal nesting, but the incomplete structure is a major readability issue. Variable naming is generally clear, though 'format' shadows a built-in function which could cause confusion. Overall, while the intent is well-documented, the structural issues, incomplete code, and potential naming conflicts significantly reduce readability for someone trying to understand the full implementation.

Run 3

The code is well-structured and readable. It uses a clear class definition, a thorough docstring explaining purpose and usage, and logical organization of imports and constants. Nesting is minimal, with only one if/else block in `apply()`. Intent is clear from class name, attribute names, and comments. Code length is appropriate; the docstring is detailed but informative, not bloated. Action granularity is mostly one action per line, aiding readability. Reading flow is natural—imports, class definition, docstring, attributes, then method. Minor deductions: the comment on the `component_type` line could be more descriptive, and the `else` block is truncated, which may affect flow. Overall, highly readable for a Python module.

Run 1

Code Structure: The module, class, and method are logically organized, although the snippet ends with an incomplete else branch. Nesting: Minimal nesting makes the control flow easy to follow. Clarity of intent: The detailed docstring and descriptive variable names clearly explain component-based filtering; naming a variable 'format' shadows a built-in. Code length: The implementation is concise, but the documentation is lengthy relative to it, and several imports are unused in the shown code. Action granularity: Each statement performs one distinct action. Reading flow: The method naturally progresses from extracting pending-node details to looking up the component and conditionally replacing the node. However, the missing else body interrupts the flow and leaves the exclusion behavior undocumented in the implementation.

Run 2

Code Structure: Imports, class documentation, configuration, and method logic are logically organized, although several imports appear unused in this snippet. Nesting: The method is mostly flat, with only one conditional level. Clarity of intent: The detailed docstring and descriptive variable names clearly explain component-dependent filtering; however, the empty else branch leaves the implementation incomplete. Code length: Executable logic is concise, while the extensive documentation adds length but provides useful context. Action granularity: Each executable line performs one clear action. Reading flow: The method proceeds naturally from retrieving pending-node metadata to checking component support and replacing nodes, but stops abruptly at the unfinished else branch, obscuring the exclusion path and making the supplied code syntactically invalid.

Run 3

Code Structure: Imports, a focused class, and a single method are logically organized, but the empty else branch leaves the snippet incomplete. Nesting: Minimal nesting makes the method easy to follow. Clarity of intent: The detailed docstring clearly explains component-dependent filtering, and most variable names are descriptive; however, the exclusion behavior is missing, and 'format' shadows a built-in name. Code length: The implementation is concise, though the docstring is lengthy relative to it and several imports are unused in the shown snippet. Action granularity: Each executable line performs one clear action. Reading flow: Execution proceeds naturally from extracting pending-node details to checking component support and replacing nodes, but the unfinished else abruptly interrupts that flow.