Sample
pyint-c0abd95df7d9-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.673 | 0–1; higher is more readable |
| Mi | 0.513 | 0–1; higher is more readable |
| LLOC | 25 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.633 | 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. | 1668.406 | −55.057 |
| Source linesThe number of non-empty source lines. | 62 | +24.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.509 | −6.764 |
Intercept 8.87 + feature contributions = -28.151 (log-odds).
Score = sigmoid(-28.151) = 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. | 62 | −1.159 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 53 | +1.096 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 53 | −0.795 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 84.873 | +0.565 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 61.942 | +0.456 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.424 |
| 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. | 84.968 | +0.066 |
Intercept 0.07 + feature contributions = 0.723 (log-odds).
Score = sigmoid(0.723) = 0.673.
| Score | 0.513 |
|---|
| Score | 25 |
|---|
Run 1
The code is generally readable with clear imports, logical structure, and good variable naming. The main method is well-organized and focused, using meaningful intermediate variables like `year`, `month`, `day`, and `lookup_kwargs`. Comments explain non-obvious behavior, and action granularity is appropriate. However, the error-raising block contains dense string formatting that interrupts flow, and the `_date_from_string` call breaks from class methods to use a standalone function, which could confuse intent. The mixin inheritance with multiple base classes may require added cognitive load, though this is a common Django pattern. Overall, the code is concise but could benefit from extracting error handling or simplifying formatting logic.
Run 2
The code is highly readable with clear structure and intent. Imports are organized, class inheritance is logical, and the `get_object` method follows a clean sequential flow: parse date, validate future, filter queryset, delegate to super. Nesting is minimal with only one conditional block. Comments are concise and explain non-obvious logic. Naming is descriptive. Minor deductions: the long error message and string formatting occupy several lines, and some mixed levels of abstraction, but overall the code is concise, well-structured, and easy to follow.
Run 3
The code is generally readable with clear structure, consistent naming, and logical organization. Imports are well-grouped, and the class/method purpose is documented. The get_object method has a natural flow: parse date, validate future, filter queryset, delegate. Nesting is minimal, with only one conditional. However, some aspects reduce readability: the date parsing uses multiple helper calls that obscure intent slightly, and the error message construction is verbose and split across lines. Action granularity is mostly one action per line, but the qs assignment and filter operations could be clearer. The mixin-heavy inheritance pattern adds complexity for readers unfamiliar with Django's generic views. Overall, it's maintainable and idiomatic Django, though not perfectly self-explanatory for beginners.
Run 1
Code Structure: The class and method are logically organized, separating date parsing, queryset selection, validation, filtering, and object retrieval. Nesting: A single conditional keeps control flow shallow; the multiline exception adds visual complexity but not deep nesting. Clarity of intent: Descriptive method names, a useful docstring, and comments make the purpose clear, although external mixins and helpers require surrounding context, and 'qs' is abbreviated. Code length: The method is appropriately concise, but several imports are unused in this excerpt and the error construction is somewhat verbose. Action granularity: Most lines perform one clear action; multiline calls improve readability rather than combining unrelated operations. Reading flow: Execution follows a natural sequence from URL date components to the filtered object, with sensible whitespace and consistent formatting.
Run 2
Code Structure: Clearly organized around a single view class and a focused get_object method, with date parsing, validation, filtering, and retrieval separated logically. Nesting: Minimal nesting; one conditional and an early exception keep control flow straightforward. Clarity of intent: Descriptive method names, a useful class docstring, and explanatory comments make the purpose clear, although mixins and helper functions defined elsewhere require context. Code length: Mostly concise, but unused imports in this excerpt and the lengthy exception formatting add visual overhead. Action granularity: Each statement performs a distinct action; multiline calls and dictionary formatting remain readable. Reading flow: Follows a natural progression from URL date components to queryset selection, future-date validation, filtering, and superclass retrieval. The abbreviated variable qs is conventional but less explicit than queryset.
Run 3
Code Structure: The method is logically organized into date extraction, parsing, queryset selection, validation, filtering, and retrieval. Nesting: Control flow is shallow, with only one conditional; nested formatting expressions add minor visual complexity. Clarity of intent: Descriptive method names, a class docstring, and helpful comments make the purpose clear, though external mixins and helpers require context, and 'qs' is abbreviated. Code length: The implementation is concise, but several imports appear unused in this excerpt and the multiline error message occupies substantial space. Action granularity: Each statement performs a distinct operation; the conditional queryset assignment remains readable. Reading flow: Execution follows a natural sequence from URL date components to object retrieval, with whitespace separating stages effectively.