Sample
pyint-8ee6c0f8d6d6-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.893 | 0–1; higher is more readable |
| Mi | 0.561 | 0–1; higher is more readable |
| LLOC | 60 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.494 | 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. | 4437.184 | −146.427 |
| Source linesThe number of non-empty source lines. | 162 | +64.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.616 | −6.924 |
Intercept 8.87 + feature contributions = -79.681 (log-odds).
Score = sigmoid(-79.681) = 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. | 163 | −4.735 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 135 | +3.932 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 161.922 | +1.854 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 101.939 | +0.84 |
| 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. | 101.963 | −0.654 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.054 | +0.417 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 2.122 (log-odds).
Score = sigmoid(2.122) = 0.893.
| Score | 0.561 |
|---|
| Score | 60 |
|---|
Run 1
The code is highly readable with clear structure, minimal nesting, and explicit intent. Imports are logically grouped by source and alphabetized. The class has a clear docstring with examples, well-defined type hints, and defaults handled consistently. Each action in __init__ is concise, with one action per line, improving traceability. The prepare() method cleanly delegates to PreparedRequest. Minor deductions: the long import block adds vertical length, and some annotations (e.g., _t.UriType | None) slightly reduce readability for non-expert readers, but overall this is professional, maintainable code.
Run 2
The code is highly readable with a logical structure, clear intent, and good action granularity. The class definition and __init__ method are well-organized with type hints and sensible defaults. Nesting is minimal, and the reading flow is natural. The imports are long but grouped, which is consistent with project conventions. Minor deductions: the import block is verbose, and the docstring could be more concise, but these do not significantly hinder readability. Overall, the code is clean, maintainable, and easy to follow.
Run 3
The code is highly readable due to its clear structure, logical organization, and explicit type annotations. Imports are grouped and ordered, class and method definitions are clean, and the constructor uses a flat, straightforward pattern with sensible defaults. The docstring and type hints make intent clear, and the `prepare()` method is concise and well-factored. Nesting is minimal, and each line performs a single, clear action, supporting natural reading flow. Minor deductions come from the large number of imports and repetitive parameter assignments in `__init__` and `prepare()`, but these are common in library code and do not meaningfully hinder comprehension.
Run 1
Code Structure: Imports, documentation, attributes, and methods are logically grouped, although the extensive imports and unresolved RequestHooksMixin obscure the snippet's self-contained context. Nesting: Minimal nesting makes control flow easy to follow. Clarity of intent: Descriptive method and attribute names, type annotations, parameter documentation, and a usage example clearly explain request construction and preparation; the variable name p is less informative. Code length: The implementation is concise, but the import block and documentation are substantial relative to the functionality shown, with many imports unused in this excerpt. Action granularity: Each assignment and operation occupies its own line, and the multiline preparation call is easy to scan. Reading flow: Initialization proceeds naturally from defaults to hooks to attributes, followed by representation and preparation methods. Minor distractions include the inaccurate 'Default empty dicts' comment for list defaults and missing visible definitions or imports for some referenced types.
Run 2
Code Structure: The class is logically organized into documentation, attribute declarations, initialization, representation, and preparation, though the extensive imports distract from the small class. Nesting: Control flow is very shallow, with only a simple loop. Clarity of intent: Descriptive names, type annotations, and detailed documentation clearly communicate how requests are configured and prepared; externally defined types and an unexplained base class require additional context. Code length: The implementation is concise, but lengthy imports, repeated field declarations and assignments, and verbose documentation increase scanning effort. Action granularity: Statements generally perform one action per line, making initialization easy to follow. Reading flow: The progression from defaults to hooks to attributes and then preparation is natural; the abbreviated variable p and inconsistent comment describing empty dictionaries despite list defaults slightly reduce clarity.
Run 3
Code Structure: The class is logically organized into documentation, type declarations, initialization, representation, and preparation, though the large import block includes many names unused in this excerpt. Nesting: Control flow is nearly flat, with only a simple hook-registration loop. Clarity of intent: Descriptive names, type annotations, and detailed documentation clearly explain request construction and preparation; externally defined types and the mixin require additional context. Code length: The implementation is concise, but extensive imports, documentation, and repeated parameter declarations add reading overhead. Action granularity: Statements generally perform one action per line, and multiline arguments are easy to scan. Reading flow: Initialization proceeds naturally from defaults to hooks to attribute assignment, followed by preparation. Minor distractions include the vague local name 'p' and a comment describing empty dictionaries despite some defaults being lists.