Sample
pyint-d0a9b1865b27-I10
Deterministically remove some optional blank lines and bracketed line breaks
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.246 | 0–1; higher is more readable |
| Mi | 0.032 | 0–1; higher is more readable |
| LLOC | 79 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs |
| BTTF | 0.598 | 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. | 4290.036 | −141.571 |
| Source linesThe number of non-empty source lines. | 128 | +51.2 |
| 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.305 | −6.458 |
Intercept 8.87 + feature contributions = -87.959 (log-odds).
Score = sigmoid(-87.959) = 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. | 129 | −3.531 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 115 | +3.241 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 116 | −2.241 |
| 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. | 126.969 | −1.713 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 127.883 | +1.378 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 126.992 | +1.245 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.431 |
Intercept 0.07 + feature contributions = -1.121 (log-odds).
Score = sigmoid(-1.121) = 0.246.
| Score | 0.032 |
|---|
| Score | 79 |
|---|
Run 1
The code is generally readable in terms of variable naming and docstrings, but suffers from inconsistent formatting: missing blank lines between methods, uneven indentation, and broken string literals (e.g., ImproperlyConfigured message and translated strings). Some method calls split arguments across lines awkwardly, reducing reading flow. Nesting is moderate; the pagination and queryset logic includes several nested conditionals and exception handlers, which are manageable but could be flatter. Action granularity is mixed—some lines contain multiple actions (e.g., page lookup in one line), while others are reasonably granular. Overall, structure is logical but visually cluttered, making the code harder to scan than necessary. With formatting fixes, it would rise to 16 or more.
Run 2
The code has clear intent and follows Django's mixin pattern, but readability suffers from inconsistent formatting and vertical alignment issues. Indentation is standard, but many function calls and multiline constructs have awkward spacing (e.g., spaced-out arguments, oddly aligned parentheses). Several methods lack blank lines between them, reducing visual separation. Some lines attempt multiple actions or have broken string literals that disrupt reading flow. The pagination logic is moderately complex and could be flatter. Overall structure is logical, and variable names are descriptive, but the inconsistent style and dense blocks make the code harder to scan than necessary.
Run 3
The code has clear intent and follows Django conventions, but readability suffers from inconsistent formatting and spacing. Several method definitions lack blank lines between them, and some function calls have excessive indentation or misplaced line breaks (e.g., in paginate_queryset and get_paginator). The get_queryset method has awkward string concatenation in the error message. Some lines contain multiple actions, reducing granularity. Nesting is moderate but acceptable. The overall structure is logical, but the formatting inconsistencies disrupt the natural reading flow. With proper PEP 8 formatting and consistent line breaks, readability would improve significantly.
Run 1
Code Structure: Well-organized mixin with focused methods separating queryset retrieval, pagination, and context construction. Nesting: Mostly shallow, with manageable nested conditionals and exception handling. Clarity of intent: Descriptive method names, variables, and docstrings make the purpose clear, although Django-specific conventions require framework knowledge. Code length: Reasonable for its responsibilities; small accessor methods support customization, while duplicated context dictionaries add minor verbosity. Action granularity: Most statements perform one action, but several arguments and dictionary entries are crowded onto single lines. Reading flow: Method order follows a logical progression, but inconsistent blank lines, excessive inline spacing, and awkwardly wrapped calls and error messages interrupt scanning. Overall, strong semantic organization is weakened primarily by formatting.
Run 2
Code Structure: Well organized into focused mixin methods, separating queryset selection, pagination, and context construction. Nesting: Mostly shallow, with manageable conditional branches and exception handling. Clarity of intent: Descriptive method names, configuration attributes, and docstrings make responsibilities clear, though Django-specific conventions require framework knowledge. Code length: Appropriate overall; small accessor methods support customization, although context dictionaries repeat several keys. Action granularity: Most statements perform one action, but several arguments and dictionary entries are crowded onto single lines. Reading flow: Methods follow a logical progression, but inconsistent spacing, missing blank lines between methods, and awkwardly formatted calls and error strings interrupt scanning. These formatting issues reduce readability without obscuring the underlying design.
Run 3
Code Structure: Well organized into focused methods for queryset retrieval, pagination, configuration, and context construction. Nesting: Mostly shallow, with manageable nested conditionals and exception handling. Clarity of intent: Descriptive method names, variables, and docstrings make the purpose clear, although some Django-specific conventions require framework knowledge. Code length: Generally appropriate, but repetitive configuration getters and duplicated context dictionaries add some verbosity. Action granularity: Most statements perform one action; several argument lists and dictionary entries are crowded onto single lines, reducing scanability. Reading flow: Methods follow a logical progression, but inconsistent spacing, missing blank lines between methods, and awkwardly formatted calls and string literals interrupt an otherwise natural flow.