Sample
pyint-24b7303c6858-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.43 | 0–1; higher is more readable |
| Mi | 0.463 | 0–1; higher is more readable |
| LLOC | 74 | 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.367 | 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. | 5514.733 | −181.986 |
| Source linesThe number of non-empty source lines. | 144 | +57.6 |
| 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.466 | −6.699 |
Intercept 8.87 + feature contributions = -122.215 (log-odds).
Score = sigmoid(-122.215) = 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. | 145 | −4.098 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 135 | +3.932 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 135 | −2.677 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 143.795 | +1.6 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.938 | +0.598 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.065 | +0.31 |
| 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. | 86.986 | −0.019 |
Intercept 0.07 + feature contributions = -0.283 (log-odds).
Score = sigmoid(-0.283) = 0.43.
| Score | 0.463 |
|---|
| Score | 74 |
|---|
Run 1
The code demonstrates good readability overall. The class structure is logical and well-organized, with clear separation of concerns across methods. The __init__ method is the most complex section but uses descriptive variable names and explanatory comments. Nesting is minimal - no deep conditional nesting exists. Intent is generally clear, though some Django-specific patterns like 'rel' and 'info' assume domain knowledge. Code length is appropriate - no unnecessary verbosity. Action granularity is strong - most lines perform single operations, particularly in get_context and the property methods. The reading flow is natural, moving from initialization through utility methods to context building. Minor deductions: the 'supported' variable logic could be clearer, and the __init__ method contains multiple responsibility blocks that might benefit from extraction. The backward compatibility check is well-documented. Overall, this is maintainable, understandable code that follows Django conventions effectively while maintaining good coding practices.
Run 2
The code is highly readable, well-structured, and follows Django conventions. It uses clear class and method names, keeps methods focused on single responsibilities, and maintains a flat structure with minimal nesting. The constructor uses explicit keyword arguments with sensible defaults, and the logic for determining capabilities (add, change, delete, view) is clearly separated. The get_context method builds the context in a straightforward, linear fashion, with only minor conditional blocks. Imports are organized, and type hints are not needed given Django's dynamic style. The code is concise without sacrificing clarity, and the use of helper methods like get_related_url avoids duplication. The only slight deduction is due to a few internal comments referencing backwards compatibility or UX edge cases, which could be slightly clearer, but overall the code is a model of readability.
Run 3
The code is highly readable. It follows Django's own widget wrapper patterns, with a clear class name, concise docstring, and well-organized __init__ method that groups related attribute assignments. Nesting is minimal, with no deep conditional blocks. Each line performs a single logical action, maintaining a clean flow. Intent is clear from descriptive variable names and comments explaining non-obvious behaviors. The get_context method builds a context dict step-by-step, with conditional URL additions kept flat. Minor complexity arises from backwards-compatible checks and template context assembly, but the structure remains transparent. Overall, the code is well-structured and maintainable.
Run 1
Code Structure: Well organized into initialization, delegated properties, URL/context generation, and widget forwarding methods. Nesting: Mostly flat, with simple conditionals and no deeply nested branches. Clarity of intent: Descriptive method and permission names, plus useful comments, make the wrapper's purpose clear; abbreviated names such as rel and info, framework internals, and the unexplained 0x1 slightly obscure details. Code length: Reasonably concise for its responsibilities, although several imports are unused in this snippet and delegation adds some boilerplate. Action granularity: Statements generally perform one action per line; compound permission expressions remain manageable. Reading flow: Methods follow a natural progression, and context construction is easy to trace, though the local import and manual query-string assembly slightly interrupt the flow.
Run 2
Code Structure: Well-organized class with initialization, properties, context construction, and delegation separated into focused methods. Nesting: Shallow conditionals and a straightforward comprehension keep complexity low. Clarity of intent: Descriptive method and permission names, comments, and the docstring explain the wrapper's purpose; framework-specific concepts, abbreviated names such as rel and info, and magic values such as 0x1 and __fk__ require additional context. Code length: Mostly concise, though the broad import list contains many imports unused in this snippet, and get_context is relatively long. Action granularity: Statements generally perform one action each; compound Boolean expressions remain manageable. Reading flow: Consistent formatting and logical sequencing make the code easy to follow, although the local import and some multiline expressions mildly interrupt the flow.
Run 3
Code Structure: Well-organized class with initialization, properties, context generation, and delegation methods clearly separated. Nesting: Shallow conditionals and a straightforward comprehension keep complexity low. Clarity of intent: Descriptive method names, permission flags, and explanatory comments communicate purpose, though abbreviated names such as rel and info, framework internals, and unexplained values such as 0x1 and __fk__ require background knowledge. Code length: Mostly concise, although numerous unused imports in this snippet and repetitive delegation add visual overhead. Action granularity: Statements generally perform one action per line; multiline expressions are consistently formatted. Reading flow: Progression from configuration to rendering and delegation is natural, but the lengthy initializer, local import, and manual URL parameter construction slightly interrupt the flow.