Sample
pyint-14e07ea0e65a-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.399 | 0–1; higher is more readable |
| Mi | 0.403 | 0–1; higher is more readable |
| LLOC | 49 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17.33 | 0–20; mean of three runs |
| BTTF | 0.584 | 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. | 2921.392 | −96.406 |
| Source linesThe number of non-empty source lines. | 93 | +37.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.5 | −6.75 |
Intercept 8.87 + feature contributions = -57.086 (log-odds).
Score = sigmoid(-57.086) = 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. | 94 | −2.292 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 79 | +1.995 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 79 | −1.392 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 107.989 | +0.938 |
| 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. | 107.947 | −0.907 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 92.817 | +0.888 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.067 | +0.291 |
Intercept 0.07 + feature contributions = -0.409 (log-odds).
Score = sigmoid(-0.409) = 0.399.
| Score | 0.403 |
|---|
| Score | 49 |
|---|
Run 1
The code is highly readable with clear structure and consistent style. The class has a single, well-documented purpose. Methods are short and focused, each performing one action. Nesting is minimal (only one if-block in get_full_url). Type hints are used throughout, enhancing clarity. The docstring explains the class's role and its relationship to cookiejar's expected interface. Method names are descriptive and follow Python conventions. The only minor issues are the # type: ignore comment in get_header and the absence of a docstring on that method, but these are negligible. The code flows naturally from constructor to properties, making it easy to follow.
Run 2
The code is well-structured and readable. It has a clear class purpose, follows consistent naming conventions, and uses docstrings effectively. Each method has a single responsibility, and action granularity is appropriate, with one main operation per line. Nesting is minimal, and the overall flow is logical—request wrapping methods are grouped and easy to follow. The only slight deduction comes from a few verbose type annotations and minor redundancy in property/method pairs, but these do not significantly hinder readability.
Run 3
The code is generally clear and well-structured, with a single class wrapping a PreparedRequest for cookie handling. Methods are short, focused, and mostly flat, with minimal nesting. Naming and comments clarify intent. Minor issues: the get_full_url method contains a multi-line list with a long cast expression, slightly reducing readability. The type annotation MockRequest.type is declared without initialization, relying on __init__, which is acceptable but not ideal. Some methods (e.g., get_new_headers) are trivial but add length. Overall, the logical organization and clear purpose make it quite readable, though not perfect.
Run 1
Code Structure: The class logically groups request-adapter methods, although import ordering is inconsistent and several imports are unused in this snippet. Nesting: Minimal nesting and an early return make control flow easy to follow. Clarity of intent: The class docstring, descriptive method names, and type annotations clearly explain its purpose; the abbreviated _r attribute and externally defined PreparedRequest slightly reduce local clarity. Code length: Mostly concise, though some wrapper methods and comments are repetitive. Action granularity: Statements generally perform one action per line; the nested dictionary lookups in get_header are slightly denser. Reading flow: Methods progress naturally from initialization through request information and header handling to properties, with consistent formatting overall. Minor distractions include redundant parentheses, a long type-ignore line, and a comment referring to a response when the class wraps a request.
Run 2
Code Structure: The class logically groups request-adapter methods and properties, though numerous unused imports and inconsistent import ordering add clutter. Nesting: Methods are flat, with only one simple conditional and an early return. Clarity of intent: The detailed class docstring, descriptive method names, and type annotations explain the adapter's purpose well; the abbreviated attribute `_r` and externally defined `PreparedRequest` annotation require additional context. Code length: Most methods are concise, but some comments repeat obvious operations and the imports unnecessarily lengthen the excerpt. Action granularity: Statements generally perform one action per line; the nested dictionary lookup in `get_header` is slightly denser. Reading flow: Initialization, interface methods, and property aliases follow a natural sequence, with minor distractions from redundant comments, a stray blank line, and the long return line.
Run 3
Code Structure: A cohesive adapter class groups related request-interface methods logically, although numerous unused imports and inconsistent import ordering add clutter. Nesting: Very shallow, with a simple conditional and early return. Clarity of intent: The class docstring, descriptive method names, and type annotations explain its purpose well; the abbreviated attribute `_r` and unexplained `PreparedRequest` reference slightly reduce clarity. Code length: Methods are concise, though some comments repeat obvious operations and imports are excessive for this snippet. Action granularity: Statements generally perform one action per line; the nested header lookup is compact but requires a little extra attention. Reading flow: Initialization followed by interface methods and properties creates a natural progression, with minor formatting inconsistencies and a long return line interrupting readability.