Sample
Dorn/python/107
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.963 | 0–1; higher is more readable | 91.9Δ 18.7 |
| Scalabrino | 0.563 | 0–1; higher is more readable | 52.7Δ 20.5 |
| Dorn | 0.839 | 0–1; higher is more readable | 83.3Δ 10.0 |
| Mi | 0.349 | 0–1; higher is more readable | 34.5Δ 38.7 |
| LLOC | 8 | Logical lines; fewer is more readable | 63.9Δ 9.3 |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs | 95.5Δ 22.3 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 93.5Δ 20.2 |
| BTTF | 0.689 | 0–1; higher is more readable | 90.8Δ 17.5 |
| Human | 3.64 | 1–5; original rating | 73.3 |
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) |
|---|---|---|
| Source linesThe number of non-empty source lines. | 28 | +11.2 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 280 | −9.24 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 5.046 | −7.569 |
Intercept 8.87 + feature contributions = 3.261 (log-odds).
Score = sigmoid(3.261) = 0.963.
| Score | 0.563 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.025 | +0.697 |
| 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. | 72 | +0.616 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 12 | −0.322 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 62.483 | +0.204 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 27.685 | −0.023 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 29 | +0.01 |
Intercept 0.07 + feature contributions = 1.648 (log-odds).
Score = sigmoid(1.648) = 0.839.
| Score | 0.349 |
|---|
| Score | 8 |
|---|
Run 1
The code is highly readable. It begins with a clear license header, followed by clean imports. The class definition is logically organized, inheriting from a base sorter and clearly specifying the domain object class. The constructor uses *args and **kwargs with clear default handling for sorting direction and key. Indentation is flat, purpose is evident, and the code is concise without unnecessary verbosity. Minor deductions for slightly implicit parameter handling and potential ambiguity around 'period' if not known from context.
Run 2
The code is well-structured and highly readable. The module begins with a standard license header, clearly separated from the code, followed by imports and a single class definition. The class inherits from a base sorter class, and the DomainObjectClass attribute is unambiguous. The __init__ method uses *args and **kwargs but explicitly sets default values for sortAscending and sortBy, making the behavior clear. Nesting is minimal, and each logical step appears on its own line. The code is concise yet expressive, with little ambiguity. The only minor drawback is the use of kwargs without a docstring or type hints, which slightly reduces clarity for maintainers unfamiliar with the base class contract.
Run 3
The code is generally readable. It starts with clear licensing and concise imports. The class inherits from a clear base class and defines its domain object explicitly. The __init__ method has a single, clear purpose—setting default sort options—but the use of *args/**kwargs adds slight ambiguity about the full expected signature. The lines are short, flat, and logically ordered, with no unnecessary nesting or verbosity. Overall structure and intent are clear, but the reliance on **kwargs for configuration and unused *args slightly reduces clarity for a new reader.
Run 1
Code Structure: Imports, class metadata, and initialization are logically organized. Nesting: Minimal, with only a class and method scope. Clarity of intent: EffortSorter and the sorting options clearly convey the purpose, though the absence of a superclass initialization call leaves setup behavior uncertain. Code length: Implementation is concise; the lengthy license header adds scanning overhead but is conventional. Action granularity: Each statement performs one action. Reading flow: Natural top-to-bottom progression with appropriate spacing, although the generic args and kwargs provide little information about the constructor interface.
Run 2
Code Structure: Imports and a single focused class are logically organized. Nesting: Only the class and initializer levels are present, with no nested control flow. Clarity of intent: EffortSorter, DomainObjectClass, and the sorting keyword names clearly indicate purpose, although the initializer only modifies kwargs without visibly invoking the parent initializer, leaving its intended effect uncertain. Code length: The implementation is concise; the lengthy license header adds reading overhead but is conventional. Action granularity: Each statement performs one clear action. Reading flow: The progression from imports to class metadata to initialization is natural, though the abrupt ending makes the initialization appear incomplete.
Run 3
Code Structure: Imports and a single focused class are logically organized. Nesting: Only standard class and method indentation, with no nested control flow. Clarity of intent: EffortSorter and the sorting options clearly suggest descending sorting by period, although the absence of a superclass initialization call leaves the constructor's completeness unclear. Code length: The implementation is concise; the lengthy license header adds reading overhead but is conventional. Action granularity: Each executable line performs one clear assignment or import. Reading flow: The progression from imports to class metadata to constructor defaults is natural and easy to follow.