Sample
pyint-869ad40a683b-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.005 | 0–1; higher is more readable |
| Mi | 0.561 | 0–1; higher is more readable |
| LLOC | 206 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 6.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs |
| BTTF | 0.365 | 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. | 13775.729 | −454.599 |
| Source linesThe number of non-empty source lines. | 450 | +180 |
| 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.425 | −6.637 |
Intercept 8.87 + feature contributions = -272.367 (log-odds).
Score = sigmoid(-272.367) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 450 | −14.897 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 361 | +11.749 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 360 | −7.84 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 449.948 | +5.88 |
| 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. | 133.978 | −2.01 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 133.982 | +1.357 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.052 | +0.44 |
Intercept 0.07 + feature contributions = -5.25 (log-odds).
Score = sigmoid(-5.25) = 0.005.
| Score | 0.561 |
|---|
| Score | 206 |
|---|
Run 1
The code suffers from severe readability issues. The inverted conditional pattern 'if not (condition): pass else:' is used extensively instead of standard 'if condition:' blocks, making even simple logic needlessly convoluted. This anti-pattern appears dozens of times throughout the code, requiring constant mental translation. Type annotations are comprehensive but add visual noise without improving comprehension. The generous column width makes lines overly long, forcing horizontal scrolling. While the docstrings are helpful and imports are well-organized, the core logic is obscured by the pathological use of negated conditionals. Simple checks like 'if auth is None:' become 'if not (auth is None): pass else:', tripling the line count and doubling cognitive load. The code structure follows a logical method-by-method organization, but the execution is fundamentally flawed from a readability perspective. A mechanical refactoring to remove all inverted conditionals would instantly improve clarity.
Run 2
The code has severe readability issues. The most striking problem is the inverted conditional pattern throughout (e.g., 'if not (condition): pass else: do_something'), which is non-idiomatic, confusing, and directly violates natural reading flow. For example, 'prepare_method' contains a completely pointless 'if not (self.method is not None): pass else: ...' block. Nesting is generally flat, which is good, but the bizarre conditionals negate this benefit. There are also misleading patterns like 'if not (not data and json is not None): pass else: ...' which require mental double-negation. Some sections are well-documented, and the code is structurally organized into logical methods, but the action granularity is inconsistent. While the code is not deeply nested and methods are reasonably sized, the pervasive use of inverted conditions with empty 'pass' branches makes the control flow extremely difficult to follow and understand at a glance. The over-reliance on type casting also adds noise.
Run 3
This code is extremely difficult to read due to pervasive inverted conditional logic using 'if not (condition): pass else:' instead of standard 'if condition:' statements. This pattern appears throughout nearly every method, making the control flow bass-ackwards and requiring mental gymnastics to understand. The code violates multiple readability criteria: clarity of intent is severely compromised by the negated conditionals, reading flow is unnatural, and nesting is unnecessarily complex. While the code structure follows logical method separation and naming conventions are reasonable, the implementation details are obscured. The excessive type annotations and imports add noise. Comments are generally helpful but cannot compensate for the fundamentally broken conditional structure. The prepare_url and prepare_body methods are particularly egregious, with the latter spanning nearly 80 lines with confusing branching logic. Action granularity is mostly acceptable, but the overall effect is code that reads like it was deliberately obfuscated.
Run 1
Code Structure: Clearly separated preparation methods and a central orchestration method provide logical organization. Nesting: Mostly moderate, but body preparation has several nested branches, and unnecessary pass/else constructs add indentation. Clarity of intent: Descriptive names, type annotations, and docstrings explain responsibilities; repeated negations such as 'if not (not scheme)' obscure simple checks. Code length: Excessive imports, redundant conditionals, verbose type-ignore comments, and occasional irrelevant comments increase reading effort. Action granularity: Generally one operation per line, with intermediate variables making transformations easy to follow. Reading flow: The preparation sequence is natural and ordering constraints are documented, but inverted conditions and empty branches repeatedly interrupt it. Overall, the well-organized design remains understandable, while avoidable control-flow verbosity substantially reduces readability.
Run 2
Code Structure: Methods logically separate request preparation responsibilities, with a clear orchestration method. Nesting: Mostly moderate, but body preparation and redundant pass/else branches introduce avoidable indentation. Clarity of intent: Descriptive method names, annotations, and docstrings help considerably; repeated negated and double-negated conditions obscure straightforward checks. Code length: Unnecessarily expanded by empty branches, verbose conditionals, and some distracting comments. Action granularity: Generally strong, with individual operations on separate lines and few compound statements. Reading flow: The preparation sequence is natural and ordering dependencies are documented, but inverted conditions repeatedly interrupt comprehension. Overall, good modular organization and documentation are undermined by systematically awkward control flow.
Run 3
Code Structure: Preparation responsibilities are logically separated into focused methods, with a clear orchestration method. Nesting: Mostly moderate, but body preparation has several nested branches, and unnecessary else blocks increase indentation. Clarity of intent: Descriptive method names, annotations, and docstrings help, but repeated inverted conditions, double negatives, and empty pass branches obscure straightforward checks. Code length: Excessive conditional boilerplate, extensive imports, and some redundant comments make the snippet longer than necessary. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: The preparation sequence is natural and ordering constraints are documented, but frequent 'if not ...: pass; else ...' patterns repeatedly interrupt comprehension. Overall, sound organization is undermined by avoidable control-flow complexity and verbosity.