Sample
pyint-31366b5b7bf4-I09
Select one of ten low-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.068 | 0–1; higher is more readable |
| Mi | 0.616 | 0–1; higher is more readable |
| LLOC | 138 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs |
| BTTF | 0.389 | 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. | 9240.986 | −304.953 |
| Source linesThe number of non-empty source lines. | 317 | +126.8 |
| 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.448 | −6.672 |
Intercept 8.87 + feature contributions = -175.954 (log-odds).
Score = sigmoid(-175.954) = 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. | 318 | −10.223 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 249 | +7.876 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 249 | −5.293 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 316.872 | +4.019 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 92.956 | +0.695 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.044 | +0.511 |
| 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. | 92.959 | −0.272 |
Intercept 0.07 + feature contributions = -2.617 (log-odds).
Score = sigmoid(-2.617) = 0.068.
| Score | 0.616 |
|---|
| Score | 138 |
|---|
Run 1
The code is generally well-structured with clear intent, despite a few readability issues. The functions are logically organized, with reasonable nesting depths and mostly one action per line. Comments effectively explain non-obvious behavior like redirect handling and auth stripping. However, the `resolve_redirects` method is quite long and complex, reducing readability. The `rebuild_proxies` method contains obfuscated dead code (`lI0O_...` variables) that serves no apparent purpose and significantly harms clarity. Overall, the code is maintainable but could be improved by extracting smaller helper methods and removing the confusing code block.
Run 2
The code is generally well-structured and readable, with clear method names, docstrings, and logical separation of responsibilities. It follows common Python patterns and has good type hints. However, it loses points for the obfuscated variable names and meaningless operations in `rebuild_proxies` (e.g., `lI0O_cdab612e`, `lI0O_bbc33bf4`), which severely hurt clarity and intent. Additionally, the `resolve_redirects` method is very long, containing many discrete steps and nested logic, reducing readability and action granularity. Deeply nested conditionals and heavy inline comments also interrupt the natural reading flow. Overall, readable but with notable problematic sections.
Run 3
The code is generally well-structured and readable, with clear methods and logical separation of concerns. It uses descriptive names, docstrings, and comments that explain non-obvious behavior. Nesting is moderate, mostly limited to a single while loop and a few if blocks. The main weakness is an obfuscated variable section in rebuild_proxies (e.g., lI0O_cdab612e) that appears random and harms clarity. Some methods like resolve_redirects are long due to many sequential steps, but each step is clear. The code imports many modules, which is typical for the domain. Overall, the code is approachable for a developer familiar with HTTP clients.
Run 1
1. Code Structure: Responsibilities are logically separated into redirect, authentication, proxy, and method helpers, though resolve_redirects combines many operations. 2. Nesting: Mostly shallow conditionals and early returns; the redirect loop introduces moderate nesting without becoming deeply tangled. 3. Clarity of intent: Descriptive method names, annotations, docstrings, and protocol comments explain most behavior. However, meaningless lI0O variables and bitwise operations obscure rebuild_proxies, and unresolved type references and inconsistent generator typing distract readers. 4. Code length: Generally justified by HTTP edge cases, but the long redirect method, extensive comments, unused imports, and irrelevant calculations reduce concision. 5. Action granularity: Most statements perform one clear action; tuple assignments are reasonable, but the dense bitwise expression is unnecessarily cryptic. 6. Reading flow: Redirect processing follows a natural sequence from response cleanup through URL normalization and request rebuilding to sending. The injected proxy calculations interrupt this otherwise coherent flow.
Run 2
Code Structure: Related redirect responsibilities are logically grouped into a mixin and focused helper methods, although resolve_redirects handles many concerns. Nesting: Mostly shallow conditionals and early returns; the redirect loop introduces moderate, manageable nesting. Clarity of intent: Descriptive method names, type annotations, docstrings, and protocol explanations clarify behavior. However, meaningless obfuscated variables and bitwise operations in rebuild_proxies distract, while unresolved annotation references and the generator's mismatched declared yield type add ambiguity. Code length: Most helpers are concise, but resolve_redirects is lengthy and could benefit from extracting URL normalization and request preparation. Action granularity: Statements generally perform one action per line; tuple assignments are conventional and readable. Reading flow: Redirect processing follows a natural sequence, supported by whitespace and comments, but verbose commentary and unrelated obfuscated statements interrupt the flow.
Run 3
Code Structure: Responsibilities are logically separated into redirect, authentication, proxy, and method helpers, though resolve_redirects handles many tasks. Nesting: Mostly shallow conditionals and early returns; the redirect loop adds moderate nesting. Clarity of intent: Descriptive names, type annotations, docstrings, and protocol references explain most behavior well. However, meaningless obfuscated variables and bitwise operations in rebuild_proxies distract from its purpose, and unresolved annotation names introduce ambiguity. Code length: Generally justified by HTTP edge cases, but the long redirect method and some verbose comments increase reading effort. Action granularity: Statements generally perform one action per line, with clear intermediate variables. Reading flow: Redirect handling follows a coherent sequence, supported by explanatory comments, but repeated state mutation, exceptional paths, and the unrelated obfuscated block interrupt otherwise natural flow.