Sample
pyint-d54e59cb2b1e-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.8 | 0–1; higher is more readable |
| Mi | 0.738 | 0–1; higher is more readable |
| LLOC | 27 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.67 | 0–20; mean of three runs |
| BTTF | 0.534 | 0–1; higher is more readable |
Views
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. | 1329.477 | −43.873 |
| Source linesThe number of non-empty source lines. | 40 | +16 |
| 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.469 | −6.704 |
Intercept 8.87 + feature contributions = -25.707 (log-odds).
Score = sigmoid(-25.707) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 39 | +0.612 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 85.976 | +0.583 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 39 | −0.345 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 39.747 | +0.146 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.107 | −0.103 |
| 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. | 85.951 | +0.025 |
Intercept 0.07 + feature contributions = 1.386 (log-odds).
Score = sigmoid(1.386) = 0.8.
| Score | 0.738 |
|---|
| Score | 27 |
|---|
Run 1
The code is generally readable with clear type hints, logical class structure, and consistent naming. However, readability is reduced by the use of negative conditional patterns such as 'if not (obj is None): pass else: return self', which inverts natural reading flow. The same issue appears in the get_converter check. These constructs create unnecessary nesting and obscure the intent compared to a straightforward 'if obj is None: return self' approach. The @overload decorators are well-placed and aid comprehension, but the custom 'te.Self' reference appears undefined within the shown scope, adding confusion. Line length and action granularity are acceptable, with one reasonable action per line. Overall, the code is maintainable but would benefit from clearer conditional logic and simplification of control flow.
Run 2
The code has clear elements—type hints, docstring, and overloaded getters—but readability is undermined by awkward conditional structures. The `if not (obj is None): pass else: return self` pattern is convoluted and should be a simple early return. Similarly, `if not (self.get_converter is not None): pass else: ...` is a double negative that obscures intent. These structures create unnecessary nesting and break natural reading flow. While the class is logically organized and concise, the conditional style makes it harder to scan. Action granularity is mostly one action per line, but the forced `pass` branches add noise. Overall, the code's meaning is recoverable but the control flow is stilted; a straightforward rewrite would improve clarity significantly.
Run 3
The code has a reasonable overall structure and uses type hints, which aids clarity. However, readability is harmed by awkward inverted conditional patterns (`if not (obj is None): pass else: return self`) that obscure intent. Nesting is minimal, and the class is concise, but the conditional logic disrupts natural reading flow and should be written directly (`if obj is None: return self`). The use of `te.Self` is incomplete (missing import) and may confuse. Action granularity is mostly one action per line, and the code length is appropriate, but the unclear conditionals and incomplete type reference reduce overall readability.
Run 1
Code Structure: The descriptor is logically organized into initialization, retrieval, and assignment methods, although unused imports and undefined names (T, te, App) weaken self-contained readability. Nesting: Nesting is shallow, but inverted conditions with pass branches introduce unnecessary control-flow complexity. Clarity of intent: The docstring, method names, and type annotations communicate configuration forwarding, though rv is vague and double-negative conditions obscure straightforward checks. Code length: Generally compact, but redundant pass/else branches and unused imports add avoidable length. Action granularity: Statements consistently perform one action per line. Reading flow: Method ordering is natural, but overload declarations and awkward conditionals interrupt an otherwise clear progression.
Run 2
Code Structure: The descriptor is logically organized into initialization, retrieval, and assignment methods, although T, te, and App lack definitions or imports in the snippet. Nesting: Nesting is shallow, but inverted conditions with empty pass branches introduce unnecessary control-flow complexity. Clarity of intent: The docstring, method names, and type annotations communicate configuration forwarding, while double-negative checks obscure straightforward conditions. Code length: The snippet is fairly short, but redundant branches, unused imports, and extensive typing machinery add visual overhead. Action granularity: Each statement generally performs one action, making individual operations easy to identify. Reading flow: Method ordering is natural, but readers must mentally simplify the conditional branches; direct checks and early returns would make retrieval behavior substantially easier to follow.
Run 3
Code Structure: The descriptor class is logically organized into initialization, retrieval, and assignment methods, but unresolved names (T, te, App) weaken self-contained clarity. Nesting: Shallow overall, though redundant if/else branches add avoidable complexity. Clarity of intent: The docstring, method names, and annotations communicate config forwarding, but negated conditions with pass branches obscure straightforward checks. Code length: Mostly concise, yet unnecessary branches and unused imports add clutter. Action granularity: Statements generally perform one action per line; compact overload declarations are still understandable. Reading flow: Method ordering is natural, but inverted conditions interrupt the flow and require extra mental effort.