Sample

Dorn/python/39

Human rating uses the original dataset scale.

DatasetDorn
Human4.18
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
41.8Δ 56.3
Dorn0.6620–1; higher is more readable
60.7Δ 37.3
Mi0.2840–1; higher is more readable
27.6Δ 70.5
LLOC27Logical lines; fewer is more readable
16.9Δ 81.2
DeepSeek V4 Pro16.330–20; mean of three runs
87.9Δ 10.2
GPT-6.1 Sol170–20; mean of three runs
80.4Δ 17.7
BTTF0.4660–1; higher is more readable
36.5Δ 61.6
Human4.181–5; original rating
98.1

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.1111.217−36.67
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.281−6.421

Intercept 8.87 + feature contributions = -14.222 (log-odds).
Score = sigmoid(-14.222) = 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.117.941−1.33
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.118+1.099
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.50−0.734
Indentation frequencyHow rapidly indentation changes from line to line.39+0.612
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.849+0.287
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.069+0.272

Intercept 0.07 + feature contributions = 0.673 (log-odds).
Score = sigmoid(0.673) = 0.662.

Score0.284
Score27
Run 1

The code is highly readable with clear structure and intent. It uses logical class organization, shallow nesting, and small focused methods that each handle a single responsibility. Naming is descriptive, and the docstring for findMenu adds helpful context. Minor deductions: the createMenu method appends to a list and adds to the menubar in one line each, which is fine, but the class relies on external globals (ScripterNG, QMenu, QApplication) that are not imported or explained, reducing self-containment. Also, the iter_menus method is somewhat redundant with actionForMenu's loop, but overall the reading flow is natural and the code length is appropriate for its purpose.

Run 2

The code is generally readable with clear class purpose and docstrings. Structure is logical, with methods separated by blank lines and one action per line. Nesting is shallow, with no deeply indented blocks. Intent is evident from method names like createMenu and findMenu. However, readability is slightly reduced by missing type hints, inconsistent spacing, and an incomplete docstring in createMenu. The import of QMenu and QApplication is implicit, which could confuse readers. The empty line after the class docstring and before __init__ is awkward. Overall, the code is concise and maintainable, but minor inconsistencies prevent it from being highly readable.

Run 3

The code is generally readable with clear class structure and logical organization. It has a single class with focused methods, each handling one responsibility. Nesting is minimal, with only one level in loops and conditionals. Intent is clearly expressed through method names and docstrings. However, there are some minor issues: the findMenu method's docstring format is inconsistent with the rest, and the code length could be slightly reduced by combining iter_menus and actionForMenu logic. The actionForMenu method duplicates the iteration pattern already present in iter_menus, suggesting a missed opportunity for reuse. The QApplication.translate call is complex and might benefit from a comment explaining why translation is needed. Overall, the code is readable and maintainable, with clear separation of concerns and good naming conventions.

Run 1

Code Structure: The class is logically organized into initialization and small menu-management methods. Nesting: Loops contain only single conditionals, keeping nesting shallow. Clarity of intent: Method names and the class docstring communicate purpose, though the variable 'm', mixed naming conventions, and externally defined ScripterNG, QMenu, and QApplication reduce clarity. Code length: Methods are concise; extra blank lines and a relatively lengthy findMenu docstring add minor visual overhead. Action granularity: Each statement performs one clear operation, with no crowded multi-action lines. Reading flow: Initialization followed by creation, iteration, lookup, and action retrieval provides a natural progression. Implicit None returns in lookup methods are understandable but slightly less explicit.

Run 2

Code Structure: The class is logically organized into small methods for creating, iterating, finding, and accessing menus. Nesting: Loop-and-condition nesting is shallow and easy to follow. Clarity of intent: Method names and docstrings communicate purpose, though the variable 'm', mixed naming conventions, and externally defined QMenu, QApplication, and ScripterNG reduce clarity. Code length: The implementation is concise, with some excessive blank lines and a relatively verbose findMenu docstring. Action granularity: Each line generally performs one clear action. Reading flow: Initialization followed by focused menu operations provides a natural progression; consistent formatting and explicit documentation of implicit None returns would improve readability.

Run 3

Code Structure: The class is logically organized into small methods for creating, iterating, finding, and retrieving menu actions. Nesting: Loops and conditionals are shallow and easy to follow. Clarity of intent: Method names and docstrings generally communicate purpose, though the variable 'm', mixed naming conventions, and externally defined ScripterNG, QMenu, and QApplication reduce clarity. Code length: The implementation is concise, but excessive blank lines and a lengthy documentation URL add visual noise. Action granularity: Each line performs a single clear operation. Reading flow: Execution within each method is natural and straightforward; explicit returns for unsuccessful searches and more consistent formatting would make behavior easier to scan.