Sample
pyint-05ef9f200e6b-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.808 | 0–1; higher is more readable |
| Dorn | 0.673 | 0–1; higher is more readable |
| Mi | 0.245 | 0–1; higher is more readable |
| LLOC | 20 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.33 | 0–20; mean of three runs |
| BTTF | 0.685 | 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. | 592.753 | −19.561 |
| Source linesThe number of non-empty source lines. | 48 | +19.2 |
| 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.716 | −7.074 |
Intercept 8.87 + feature contributions = 1.435 (log-odds).
Score = sigmoid(1.435) = 0.808.
Feature contributions
| Feature | Value | Contribution (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.98 | −1.332 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 118 | +1.099 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.018 | +0.763 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 49 | −0.699 |
| 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. | 47.849 | +0.259 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 26 | +0.162 |
Intercept 0.07 + feature contributions = 0.721 (log-odds).
Score = sigmoid(0.721) = 0.673.
| Score | 0.245 |
|---|
| Score | 20 |
|---|
Run 1
The code has clear imports and a well-documented class, showing good structure and intent. However, the max_cookie_size property contains an unnecessarily convoluted conditional (if not current_app: pass else: return...) that could be flattened to a simple guard clause, hurting readability. There are also redundant type ignore comments and the method mixes different abstraction levels. Overall it's readable but has avoidable awkwardness.
Run 2
The code is generally well-structured with clear imports, a logical class definition, and a concise docstring. However, readability issues stem from the awkward `max_cookie_size` property: it includes a redundant `if not (current_app): pass else: ...` pattern that should be inverted to a simple early return. The property also contains double type-ignore comments on a single line, which is noisy and harms clarity. While the code is short and action granularity is fine, the unnatural branching and comment clutter disrupt reading flow and obscure intent. Nesting is flat, which is good, but the conditional expression is unnecessarily verbose.
Run 3
The code is generally readable, with clear imports, well-documented class and method, and simple logic. The structure is logical, and the nesting is shallow. The main issues are an awkward `if not (current_app): pass else: return ...` pattern that adds unnecessary complexity and indentation when an early return would be simpler. Also, the `max_cookie_size` property has a redundant type ignore comment and minor verbosity in its docstring. These small clarity and conciseness problems slightly lower the score.
Run 1
Code Structure: Imports, class attributes, and the property are logically organized, although several imports are unused in this snippet. Nesting: Shallow, but the empty if branch and else introduce unnecessary branching. Clarity of intent: Descriptive names, type annotations, and documentation make the response configuration and fallback behavior clear; `if not (current_app): pass` obscures a straightforward conditional return. Code length: The implementation is short, but historical documentation, redundant parentheses, and duplicated type-ignore comments add clutter. Action granularity: Statements generally perform one action per line, with no compressed multi-action expressions. Reading flow: The class reads naturally from documentation to defaults to behavior, but the no-op branch interrupts the property's flow. A direct `if current_app: return ...` followed by the fallback would improve readability.
Run 2
Code Structure: The class is logically organized, with defaults followed by a property, though several imports are unused. Nesting: Shallow overall, but the empty if branch and else introduce unnecessary control flow. Clarity of intent: Descriptive names, documentation, and the fallback comment make the purpose clear; the negated current_app condition is less direct than a positive check. Code length: Implementation is short, but the verbose historical documentation and duplicated type-ignore comment add clutter. Action granularity: Statements generally perform one action per line. Reading flow: Class attributes and the property follow naturally, but the pass branch interrupts the straightforward configuration-or-default logic. A positive condition with an early return would improve readability.
Run 3
Code Structure: The class is logically organized into documentation, defaults, and a property, although several imports are unused in this snippet. Nesting: Shallow overall, but the empty if branch and else add unnecessary control flow. Clarity of intent: Descriptive names, type annotations, and documentation explain the configuration lookup and fallback; the inverted condition with pass makes that lookup less direct. Code length: The implementation is short, but historical documentation and duplicated type-ignore comments introduce clutter. Action granularity: Statements generally perform one action per line, with no compressed multi-action statements. Reading flow: Class members follow a natural order, but the no-op branch interrupts the property's flow. A direct 'if current_app: return ...' followed by the fallback would be clearer.