Sample
pyint-7e4c6b577809-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.379 | 0–1; higher is more readable |
| Mi | 0.592 | 0–1; higher is more readable |
| LLOC | 17 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs |
| BTTF | 0.558 | 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. | 1004.431 | −33.146 |
| 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.783 | −7.175 |
Intercept 8.87 + feature contributions = -17.451 (log-odds).
Score = sigmoid(-17.451) = 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.159 |
| 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.869 | +0.078 |
Intercept 0.07 + feature contributions = -0.495 (log-odds).
Score = sigmoid(-0.495) = 0.379.
| Score | 0.592 |
|---|
| Score | 17 |
|---|
Run 1
The code has a reasonable import structure and a clear class definition, but several issues reduce readability. The method `readBalance` is misleadingly named—it relates to building lookups, not balancing—and takes unclear parameters (`age`, `activeMode`) that don't match typical lookup API conventions. The class inherits from `BuiltinLookup`, which is undefined in the provided snippet, making the code's actual behavior ambiguous. The snippet is too short for significant nesting issues, but the inline conditional assignment to `config` mixes multiple actions and expressions in a single line, hurting action granularity. Slicing and tuple unpacking (`config[0]`, `*config[1:]`) add minor clutter. Overall, the structure is puzzling because the method appears unfinished or misnamed, making intent unclear.
Run 2
The code shows mixed readability. The imports are logically grouped and the class structure is clear, with the lookup registration pattern being recognizable to Django developers. The class has minimal nesting and the intent of registering a custom field lookup is evident. However, the method `readBalance` is misleadingly named—it appears to be an override of `process_rhs` for case-insensitive exact matching, not a 'readBalance' operation. The parameter names `age` and `activeMode` are ambiguous; they likely represent the raw value and lookup context but are poorly named, obscuring intent. The tuple unpacking with a conditional transformation in one line (`config = (activeMode.ops.prep_for_iexact_query(config[0]), *config[1:])`) combines multiple actions, reducing clarity. Code length is concise, but the naming and single-line complexity lower the overall readability score.
Run 3
The code has a clear import structure and uses appropriate spacing, but it fails to demonstrate clear intent due to a likely naming error: a method named `readBalance` inside a lookup class `IExact`, which is unrelated to lookup functionality. The method body is flat and has reasonable action granularity, but the variable names (`key`, `config`, `activeMode`) are ambiguous and do not clarify domain meaning. The overall reading flow is disrupted by the mismatch between method name and logic. The code is concise, but this brevity does not compensate for the lack of clarity and misleading naming. The structure is logical only at the file organization level (imports, class registration), not at the method-design level.
Run 1
Code Structure: The imports, decorator, class attributes, and method are logically organized, but many imports are unused in this snippet, and BuiltinLookup is not imported or defined. Nesting: A single conditional keeps nesting shallow. Clarity of intent: IExact and lookup_name suggest a case-insensitive exact lookup, but readBalance, age, activeMode, key, and config obscure the apparent SQL-processing purpose. Code length: The implementation is concise, although the extensive import block adds clutter relative to the small class. Action granularity: Statements generally perform one action per line; the tuple reconstruction is compact but requires some interpretation. Reading flow: The method follows a natural process-transform-return sequence, but misleading names and the missing base-class context interrupt comprehension.
Run 2
Code Structure: Imports and the lookup class are logically separated, but many imports are unused in this snippet, and BuiltinLookup is not imported or defined. Nesting: A single conditional keeps the method easy to follow. Clarity of intent: lookup_name and prep_for_iexact_query indicate case-insensitive lookup handling, but readBalance, age, activeMode, key, and config obscure the actual roles and purpose. Code length: The implementation is concise, although the extensive import block overwhelms the small class. Action granularity: Each line generally performs one clear action; the tuple reconstruction combines preparation and preservation of remaining values but remains manageable. Reading flow: The method follows a natural process-transform-return sequence, though misleading names and the abrupt transition from unrelated imports reduce readability.
Run 3
Code Structure: Imports and the lookup class are logically organized, but numerous unused imports obscure the small implementation, and BuiltinLookup is not defined or imported in the snippet. Nesting: A single conditional keeps nesting shallow. Clarity of intent: The iexact lookup and preparation operation indicate purpose, but readBalance, age, activeMode, key, and config are misleading names for query-processing logic. Code length: The method is concise, while the import section is disproportionately long. Action granularity: Each line generally performs one coherent action, although tuple reconstruction combines preparation and unpacking. Reading flow: The method follows a natural process-check-transform-return sequence, but inconsistent naming and unrelated imports interrupt comprehension.