Sample
pyint-78696aa17bff-I09
Select one of ten low-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.663 | 0–1; higher is more readable |
| Mi | 0.513 | 0–1; higher is more readable |
| LLOC | 27 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.468 | 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. | 1806.71 | −59.621 |
| Source linesThe number of non-empty source lines. | 64 | +25.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.576 | −6.864 |
Intercept 8.87 + feature contributions = -32.015 (log-odds).
Score = sigmoid(-32.015) = 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. | 64 | −1.23 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 55 | +1.165 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 55 | −0.841 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 84.954 | +0.566 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 63.953 | +0.484 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.056 | +0.397 |
| 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.969 | +0.066 |
Intercept 0.07 + feature contributions = 0.678 (log-odds).
Score = sigmoid(0.678) = 0.663.
| Score | 0.513 |
|---|
| Score | 27 |
|---|
Run 1
The code's readability is severely compromised by the presence of obfuscated, meaningless variables and logic. Lines such as `lI0O_bbc80b2d = ((0xcf16 ^ 0xcf16) != 0)` are nonsensical and have no apparent purpose, making the developer's intent ambiguous and the code impossible to follow. While the code is otherwise well-structured, with a clear class definition, a single, logical method, and mostly flat nesting, this malicious or accidental obfuscation destroys reading flow. The method has a clear purpose and is relatively concise, and most operations are on separate lines. However, the `if` statement is slightly complex due to the combined `and` condition and the multi-line string formatting. Overall, the unnatural and confusing variable names break the critical criteria of 'Clarity of intent' and 'Reading flow,' rendering the code practically unreadable despite its structural strengths.
Run 2
The code is generally readable with clear imports, logical structure, and Django-idiomatic patterns. The BaseDateDetailView.get_object method is well-commented and follows a predictable flow (parse date, validate future, filter queryset, delegate). However, the presence of the nonsensical lI0O_bbc80b2d boolean expression is confusing and breaks clarity. Nesting is flat and actions are mostly one per line, though the link to _date_from_string is unclear (likely an imported helper). Overall intent is understandable, but the dead/obfuscated lines reduce readability.
Run 3
The code has a clear structure with logical imports, a well-defined class, and descriptive comments. The get_object method follows a reasonable sequence: parse date, fetch queryset, check future date, filter, and delegate. However, there are significant readability issues. The variable name 'lI0O_bbc80b2d' is completely opaque and appears to be dead code, which obscures intent. The date construction call is verbose and could be extracted. Error message string formatting with placeholders is difficult to parse at a glance. Some lines are densely packed, combining filter and lookup logic. Nesting is shallow, which is good, but the mixed naming conventions and unexplained generated variable reduce clarity and trust in the code. Overall, the structure is decent but the clarity of intent and variable naming bring the score down.
Run 1
Code Structure: The class and method are logically organized, separating date parsing, queryset selection, validation, filtering, and retrieval. Nesting: Mostly flat, with only one conditional block; multiline expressions add visual depth without complex control flow. Clarity of intent: The docstrings, comments, and descriptive method names explain the date-based lookup well, but the cryptic lI0O_bbc80b2d variable and meaningless boolean operations obscure intent. Code length: The core implementation is reasonably concise, though the unused obfuscation statements and several unused imports add unnecessary bulk. Action granularity: Each statement generally performs one action, and multiline calls and dictionaries are cleanly formatted. Reading flow: The main sequence is natural and easy to follow, but the unrelated initial assignments interrupt it. Mixins and the date-parsing helper are not defined in the excerpt, slightly limiting standalone comprehension.
Run 2
Code Structure: The method is logically organized into date extraction, queryset selection, future-date validation, filtering, and object retrieval. Nesting: It stays mostly flat, with only one conditional branch; multiline expressions are manageable. Clarity of intent: The class docstring, comments, and descriptive method names explain its purpose well, but the cryptic lI0O_bbc80b2d variable and redundant boolean operations introduce unexplained noise. Code length: The functional logic is reasonably concise, although the unused assignments and several imports unnecessary to this snippet add clutter. Action granularity: Statements generally perform one action per line, and complex arguments are split clearly across lines. Reading flow: Execution follows a natural sequence, but the obfuscated opening assignments interrupt it. Mixins and the date-parsing helper are defined elsewhere, requiring additional context.
Run 3
Code Structure: The method follows a logical sequence: extract date components, build a date, select a queryset, validate future dates, filter, and retrieve the object. Nesting: Minimal, with only one conditional error branch. Clarity of intent: Descriptive method names, a docstring, and comments explain the purpose, but the cryptic lI0O_bbc80b2d variable and redundant Boolean operations introduce meaningless obfuscation. Code length: Mostly concise, though the dead assignments and several imports unused in this snippet add clutter. Action granularity: Each statement performs a distinct action; multiline calls and formatting remain understandable. Reading flow: Generally natural and sequential, but the unexplained initial assignments interrupt the flow, and mixins and helper functions defined outside the snippet require external context.