Sample
pyint-e1ebe1a9e34e-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.006 | 0–1; higher is more readable |
| Mi | 0.561 | 0–1; higher is more readable |
| LLOC | 192 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.369 | 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. | 12993.171 | −428.775 |
| Source linesThe number of non-empty source lines. | 422 | +168.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.467 | −6.7 |
Intercept 8.87 + feature contributions = -257.805 (log-odds).
Score = sigmoid(-257.805) = 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. | 423 | −13.941 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 333 | +10.781 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 333 | −7.22 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 421.942 | +5.488 |
| 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. | 135.981 | −2.094 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 135.983 | +1.39 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.05 | +0.456 |
Intercept 0.07 + feature contributions = -5.071 (log-odds).
Score = sigmoid(-5.071) = 0.006.
| Score | 0.561 |
|---|
| Score | 192 |
|---|
Run 1
The code is well-structured with clear class methods, logical organization, and good documentation. The imports are extensive but organized. The class has clear attributes and methods that follow a logical flow: prepare() calls sub-methods in sequence. Type hints are used effectively. However, there are some readability challenges: prepare_url() and prepare_body() are quite long with multiple responsibilities, containing complex conditional logic and several early returns that interrupt flow. Deep nesting occurs in prepare_body() where iterable checks nest multiple levels. The comment '# Nottin' on you.' is cryptic. Some type ignores and casting suggest complex type handling that could confuse readers. Overall, the code is professional and maintainable but could benefit from extracting some logic into smaller helper methods and reducing nesting in complex conditional blocks.
Run 2
The code is highly readable despite its length and complexity. It demonstrates excellent structure with a clear class hierarchy and well-separated methods, each handling a single responsibility (e.g., prepare_url, prepare_headers, prepare_body). Nesting is minimal with early returns and guard clauses reducing deep indentation. Intent is explicitly conveyed through descriptive method names and strategic comments that explain rationale rather than restate code. While thorough URL validation involves many conditional branches, the logical flow remains traceable. Type annotations enhance clarity throughout. The code is necessarily long due to the domain's inherent complexity (HTTP request preparation), but it avoids needless verbosity. Action granularity is appropriate—complex operations are broken into meaningful steps. Reading flow follows a natural top-down progression through request preparation phases. The thoughtful ordering of method calls in prepare() (with comments explaining why auth must be last) exemplifies the code's overall clarity and intentional design.
Run 3
The code is generally well-structured and uses clear naming conventions, but it has several readability challenges. Imports are extensive but logically grouped, which helps navigation. The class has a clear purpose and docstrings explain complex behaviors, but some methods like prepare_body and prepare_url are quite long with dense conditional logic, making them harder to follow. Nesting is moderate, but prepare_body has multiple levels of conditionals and type casts that obscure flow. Action granularity is mostly one action per line, though a few lines combine multiple operations. Comments are helpful but sometimes verbose or redundant (e.g., 'Nottin' on you'). The type annotations on some variables use inline ignores that add noise. Overall, the code is maintainable but could benefit from extracting helper methods for body preparation and URL reconstruction to reduce complexity.
Run 1
Code Structure: Well-organized preparation methods separate URL, headers, body, authentication, cookies, and hooks. Nesting: Mostly moderate, but prepare_body contains several nested branches and exception handlers that increase cognitive load. Clarity of intent: Descriptive method names, type annotations, and explanatory comments make the purpose clear; cryptic names such as p and r, hexadecimal 0x2, and an irrelevant comment detract. Code length: Generally justified by protocol handling, although lengthy imports, verbose comments, and typing suppressions add noise. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: The main preparation sequence is natural and ordering dependencies are documented, but complex body handling, long annotated lines, and references to definitions absent from the excerpt interrupt the flow.
Run 2
Code Structure: Well organized into focused preparation methods, with a clear orchestration method separating responsibilities. Nesting: Mostly shallow, but prepare_body contains several nested conditionals and exception handlers that increase reading effort. Clarity of intent: Descriptive method names, type annotations, docstrings, and comments explain most behavior; abbreviated variables, hexadecimal 0x2, and an irrelevant comment weaken clarity. Code length: Generally justified by HTTP edge cases, although lengthy imports, repetitive comments, and inline typing suppressions add noise. Action granularity: Consistently uses one operation per line, making state changes easy to identify. Reading flow: The preparation sequence is natural and ordering constraints are documented, but long URL/body routines, compatibility details, and dependencies not defined in this excerpt interrupt otherwise smooth reading.
Run 3
Code Structure: Well organized into focused preparation methods, with a clear coordinating prepare method. Nesting: Mostly shallow, but prepare_body contains several nested branches and exception handlers that increase cognitive load. Clarity of intent: Descriptive names, type annotations, and useful docstrings explain most behavior; obscure choices such as 0x2, an irrelevant comment, and frequent type-ignore annotations introduce distractions. Code length: Generally justified by HTTP edge cases, though lengthy imports, comments, and the large body-preparation method reduce concision. Action granularity: Statements generally perform one action per line, with no compressed multi-statement lines. Reading flow: Preparation proceeds in a natural sequence, and comments explain ordering dependencies; however, complex body handling and dense typing details occasionally interrupt the flow.