Sample
pyint-e069b99e2e1c-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.647 | 0–1; higher is more readable |
| Mi | 0.375 | 0–1; higher is more readable |
| LLOC | 40 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.408 | 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. | 2118.047 | −69.896 |
| Source linesThe number of non-empty source lines. | 60 | +24 |
| 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.384 | −6.577 |
Intercept 8.87 + feature contributions = -43.602 (log-odds).
Score = sigmoid(-43.602) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 57 | +1.234 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 61 | −1.123 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 57 | −0.887 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 88 | +0.615 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 59.865 | +0.427 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.063 | +0.333 |
| 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. | 88 | −0.062 |
Intercept 0.07 + feature contributions = 0.607 (log-odds).
Score = sigmoid(0.607) = 0.647.
| Score | 0.375 |
|---|
| Score | 40 |
|---|
Run 1
The code is well-structured, with clear class-level defaults and a concise __init__ that only overrides provided parameters. Nesting is minimal, and intent is generally clear. It is concise and each line performs a focused action. The __call__ method uses a clean boolean logic approach, though the naming 'invalid_input' could be more explicit. __eq__ is readable but slightly verbose. Overall, it follows idiomatic Django patterns and maintains good readability.
Run 2
The code is well-structured and highly readable. It uses clear class and method definitions, consistent formatting, and logical organization. The __init__ method handles optional parameters with a flat series of independent if-statements, making it easy to follow. The validation logic in __call__ is concise and explicit, with a clear inline comment describing inverse_match behavior. The __eq__ method is readable but slightly long due to multiple conditions, though it remains clear. Nesting is minimal, and most lines contain only one action, aiding comprehension. The only minor issues are the somewhat dense import block and the multi-line boolean expression in __eq__, which slightly reduce flow. Overall, the code displays strong clarity of intent and maintainable structure.
Run 3
The code is generally well-structured with clear class organization and follows Django conventions. The __init__ method is verbose but readable due to its straightforward conditional pattern. Nesting is minimal. Action granularity is appropriate—each line performs a distinct action. The __call__ method clearly expresses validation logic in two lines. However, imports at the top are unused (ipaddress, math, re, Path, urlsplit, etc.), which harms clarity and adds unnecessary length. The __eq__ method chains multiple conditions across lines, which is acceptable but slightly dense. Overall, the code is readable and maintainable, but the redundant imports reduce its score.
Run 1
1. Code Structure: Clearly organized into class defaults, initialization, validation, and equality methods; unused imports add minor clutter. 2. Nesting: Mostly flat, with simple conditionals and no deeply nested logic. 3. Clarity of intent: Descriptive names and the validation docstring make the purpose clear, though inverse-match logic requires a little attention. 4. Code length: Concise overall; repeated optional-argument assignments are verbose but straightforward. 5. Action granularity: Statements generally perform one action each, and multiline expressions are formatted cleanly. 6. Reading flow: Natural progression and consistent formatting make the class easy to follow; framework-specific helpers introduce a small contextual burden.
Run 2
Code Structure: The class is logically organized into configuration defaults, initialization, validation, and equality comparison. Nesting: Control flow is shallow, with straightforward conditionals and no deeply nested blocks. Clarity of intent: Descriptive names and the validation docstring clearly communicate purpose, although the inverse-match expression requires brief interpretation. Code length: The implementation is reasonably concise; repeated optional-argument assignments are explicit but slightly verbose, and several imports are unused in this snippet. Action granularity: Each statement performs one clear action, with multiline expressions improving legibility. Reading flow: Consistent formatting and method ordering support natural top-to-bottom reading. Minor distractions include redundant parentheses in equality checks and the lack of a blank line separating imports from the class decorator.
Run 3
Code Structure: The class is logically organized into configuration defaults, initialization, validation, and equality comparison. Nesting: Control flow is shallow, with straightforward conditionals and no nested loops. Clarity of intent: Descriptive names and the validation docstring make the purpose clear, although the inverse-match expression requires a little interpretation. Code length: The implementation is concise overall; repeated initialization checks are reasonable, but several unused imports add clutter. Action granularity: Each statement performs a single clear action, and multiline expressions improve readability. Reading flow: Methods follow a natural sequence, with consistent formatting and useful whitespace. Minor distractions include redundant parentheses in equality checks and the less intuitive hexadecimal zero for flags.