Sample
pyint-e39ebde5a784-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.674 | 0–1; higher is more readable |
| Mi | 0.492 | 0–1; higher is more readable |
| LLOC | 25 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.33 | 0–20; mean of three runs |
| BTTF | 0.575 | 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. | 1680.564 | −55.459 |
| 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.511 | −6.766 |
Intercept 8.87 + feature contributions = -28.554 (log-odds).
Score = sigmoid(-28.554) = 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.965 | +0.456 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.425 |
| 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.724 (log-odds).
Score = sigmoid(0.724) = 0.674.
| Score | 0.492 |
|---|
| Score | 25 |
|---|
Run 1
The code imports are clear but the class inherits from four mixins, which obscures its purpose. Many variables are poorly named, such as 'size', 'group', 'age', 'node', 'key', and 'cachedMessage', which do not reflect their actual content (year, month, day, date object, queryset, and lookup filter). The method 'checkState' is misleading because it retrieves an object rather than checking state. The method performs multiple responsibilities: parsing date parts, validating future dates, applying filters, and fetching the object. Comments are present but the code itself is not self-explanatory. Some lines are overly long, and the logic is somewhat tangled due to the mix of parameter validation and queryset filtering. Overall, the structure is only marginally readable due to Django familiarity, but the naming and intent clarity are poor.
Run 2
The code suffers from severe readability issues. Variable names are misleading: `size`, `group`, and `age` map to year, month, and day respectively, obscuring intent. The method `checkState` is poorly named for what it does—it retrieves an object. `node` and `cachedMessage` are equally unclear, representing a date and a lookup dict. The function performs multiple responsibilities: parsing date parts, checking future dates, filtering the queryset, and calling super().get_object. This violates single-responsibility and reduces action granularity clarity. Imported mixins (YearMixin, MonthMixin, DayMixin, DateMixin) are relied on but not shown, adding ambiguity. The docstring is somewhat helpful, but doesn't compensate for the confusing naming and mixed abstraction levels. Overall, the code requires significant cognitive overhead to understand, making it far below average in readability.
Run 3
The code shows a reasonable class structure and follows Django conventions, but the method checkState suffers from poor naming and unclear variable names (e.g., size, group, age, node, key, cachedMessage) that obscure its purpose. The logic is mostly flat with acceptable nesting, but the flow is muddled by misleading identifiers and a mix of unrelated actions. The method attempts to do multiple things—parse date components, enforce future-date rules, build a queryset, and delegate to super()—which reduces clarity. Some lines are concise, but variable renaming and clearer separation of concerns would improve readability.
Run 1
Code Structure: The method is logically organized into date extraction, queryset selection, future-date validation, filtering, and object retrieval. Nesting: Mostly flat, with only one conditional block; multiline exception formatting adds visual complexity without deep nesting. Clarity of intent: The class docstring and comments explain the purpose, but checkState and variable names such as size, group, age, node, key, and cachedMessage obscure their actual roles. The method name also conflicts with its documented object-retrieval purpose. Code length: The method is reasonably concise, though several imports appear unused in this excerpt. Action granularity: Statements generally perform one action each, and multiline calls are clearly formatted. Reading flow: The sequence is natural and comments help, but misleading names and inconsistent naming conventions interrupt comprehension. Mixins and the date-parsing helper are not defined in the excerpt, limiting standalone readability.
Run 2
Code Structure: The method follows a logical sequence: extract date components, construct a date, select a queryset, validate future-date access, filter, and retrieve the object. Nesting: Control flow is shallow, with only one conditional block; multiline calls add visual depth without complex branching. Clarity of intent: The class docstring and comments explain the purpose, but checkState and variables such as size, group, age, node, key, and cachedMessage obscure their actual meanings. Code length: The method is reasonably concise, though several imports are unused in the shown snippet. Action granularity: Statements generally perform one action per line, and longer expressions are appropriately split. Reading flow: Operations proceed naturally, but misleading names, inconsistent naming conventions, and a comment referring to self.queryset rather than the selected queryset interrupt comprehension. Referenced mixins and the date helper are not defined in the snippet, limiting standalone understanding.
Run 3
Code Structure: The method follows a logical sequence: extract date components, construct a date, select a queryset, validate future access, filter, and retrieve the object. Nesting: Mostly flat, with only one conditional; multiline expressions do not add substantial complexity. Clarity of intent: The class docstring and comments explain the purpose, but misleading names such as checkState, size, group, age, node, key, and cachedMessage obscure dates, querysets, and lookup arguments. Code length: The implementation is reasonably concise, although several imports are unused in the shown snippet. Action granularity: Statements generally perform one action each, with a readable conditional queryset assignment. Reading flow: Execution proceeds naturally, but readers must repeatedly translate unrelated variable names into domain concepts. Mixed naming conventions and the mismatch between checkState and its object-retrieval behavior further reduce readability.