Sample
pyint-566a278a9ffe-I01
Remove comments and docstrings
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.378 | 0–1; higher is more readable |
| Mi | 0.599 | 0–1; higher is more readable |
| LLOC | 17 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17.67 | 0–20; mean of three runs |
| BTTF | 0.623 | 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. | 1000.905 | −33.03 |
| Source linesThe number of non-empty source lines. | 35 | +14 |
| 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.737 | −7.106 |
Intercept 8.87 + feature contributions = -17.266 (log-odds).
Score = sigmoid(-17.266) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 35 | +0.473 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 35 | −0.382 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 36 | −0.238 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.081 | +0.157 |
| 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. | 83 | +0.15 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 34.774 | +0.076 |
Intercept 0.07 + feature contributions = -0.498 (log-odds).
Score = sigmoid(-0.498) = 0.378.
| Score | 0.599 |
|---|
| Score | 17 |
|---|
Run 1
The code is generally readable with clear intent and good structure. The imports are organized logically, and the class definition is flat with minimal nesting. The `process_rhs` method shows one main action per line, though the conditional tuple assignment is slightly complex. The reading flow is natural: class declaration, attribute assignments, then method definition. However, some clarity is lost due to the implicit assumption that `BuiltinLookup` exists (not imported in this snippet) and the cryptic parameter name `qn`, which requires Django internal knowledge. The code is concise and not unnecessarily long. Overall, it's maintainable but could improve by renaming ambiguous parameters and adding brief docstrings.
Run 2
The code is generally readable with a clear structure: imports are organized by source, the class definition is short, and the method has a straightforward flow. Nesting is minimal — the only conditional is a single-level 'if' block. The intent is fairly clear for developers familiar with Django ORM internals, but less obvious to others; variable names like 'qn', 'rhs', and 'params' rely on domain knowledge. Code length is appropriate and not overly verbose. Each line performs a single action, and the reading flow follows a logical sequence. However, the spread of params and the use of a tuple concatenation with '*params[1:]' slightly reduce clarity for those unfamiliar with Django's query compilation internals. Overall, the readability is good but not exceptional due to implicit assumptions about the reader's knowledge.
Run 3
The code is generally readable with clear imports, a well-structured class, and consistent formatting. The class `IExact` is concise and its purpose is evident from its name and the `lookup_name` attribute. The method `process_rhs` has a clear intent, though the logic for modifying `params` could be slightly more explicit. The nesting is minimal, and the action granularity is appropriate. The reading flow is natural, following Django lookup patterns. Minor deductions are for the slightly dense conditional operation on `params` and the reliance on implicit knowledge of Django internals.
Run 1
Code Structure: Imports, lookup registration, class configuration, and processing logic are logically organized. Nesting: A single conditional keeps nesting shallow. Clarity of intent: The class and method names communicate case-insensitive exact lookup processing, although framework-specific names such as rhs and qn require Django familiarity, and BuiltinLookup is not defined or imported in the snippet. Code length: The implementation is concise, but numerous unused imports add visual clutter. Action granularity: Each statement performs one coherent action; tuple unpacking and parameter reconstruction are compact without becoming difficult to follow. Reading flow: Execution proceeds naturally from superclass processing to conditional parameter preparation and return. An additional blank line before the top-level class would improve formatting.
Run 2
Code Structure: The lookup class is logically organized, with configuration attributes followed by a focused method; the extensive unused imports distract in this snippet. Nesting: A single conditional keeps nesting shallow. Clarity of intent: The class name, lookup_name, and prep_for_iexact_query call clearly indicate case-insensitive exact-match preparation, although rhs and qn require framework familiarity and BuiltinLookup is not defined or imported here. Code length: The implementation is concise, but the import block is disproportionate to the functionality shown. Action granularity: Each line performs one clear operation, with tuple unpacking expressing parameter replacement compactly. Reading flow: The method naturally proceeds from superclass processing to conditional parameter preparation and then returns the result.
Run 3
Code Structure: Imports and lookup implementation are logically organized, although many imports are unused in this snippet and BuiltinLookup is not defined or imported. Nesting: Only one shallow conditional, making control flow easy to follow. Clarity of intent: IExact, lookup_name, and prep_for_iexact_query clearly indicate case-insensitive exact lookup behavior; rhs and qn require framework familiarity. Code length: The implementation is concise, but the extensive import section adds unnecessary length for the code shown. Action granularity: Each statement performs a focused operation; the tuple construction compactly transforms the first parameter while preserving the others. Reading flow: The method naturally proceeds from superclass processing to conditional parameter preparation and return. An additional blank line before the top-level class would improve formatting.