Sample
pyint-f6b1c7db9183-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.606 | 0–1; higher is more readable |
| Mi | 0.474 | 0–1; higher is more readable |
| LLOC | 23 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 4.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.67 | 0–20; mean of three runs |
| BTTF | 0.602 | 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. | 1259.466 | −41.562 |
| Source linesThe number of non-empty source lines. | 31 | +12.4 |
| 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.786 | −7.18 |
Intercept 8.87 + feature contributions = -27.472 (log-odds).
Score = sigmoid(-27.472) = 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 |
| 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. | 69.906 | +0.704 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.114 | −0.162 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 26 | +0.116 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 24 | +0.093 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 30.451 | +0.016 |
Intercept 0.07 + feature contributions = 0.43 (log-odds).
Score = sigmoid(0.43) = 0.606.
| Score | 0.474 |
|---|
| Score | 23 |
|---|
Run 1
The code has several issues affecting readability. The class name 'DummyCache' clearly indicates purpose, but parameter names like 'hos', 'key2', 'val', 'tim', 'ver', 'def2', 'ver2', 'key3', 'def2', 'tou', 'del2', 'cle', and 'has' are cryptic and inconsistent. The method 'tou' likely means 'touch', 'del2' means 'delete', 'cle' means 'clear', and 'has' means 'has_key', but abbreviations obscure intent. The unused 'hos' parameter is confusing. Some methods return values implicitly (set returns None), while others return booleans, creating unclear contracts. The code violates Django's BaseCache interface naming conventions, making it harder to understand. Structure is flat and simple, but the inconsistent naming and unclear method purposes contribute to poor readability.
Run 2
The code lacks clarity and consistency. Function names are cryptic ('tou', 'del2', 'cle'), and parameter names are arbitrarily numbered ('key2', 'key3', 'def2', 'ver2') which obscures their purpose. The constructor includes an unused 'hos' parameter, suggesting leftover code. The class fails to follow the standard cache backend interface (e.g., incorrect method names like 'delete' and 'clear'), making the intent unclear. While nesting is flat and line length is concise, the poor naming and inconsistent structure significantly reduce readability. The repeated calls to 'make_and_validate_key' hint at side effects but return values are ignored, adding ambiguity. Overall, the code appears disorganized and difficult to understand without prior context.
Run 3
The code has several readability issues. The class structure is mostly logical but method names are cryptic or abbreviated inconsistently (e.g., 'tou', 'del2', 'has', 'cle'), which obscures intent. Parameter names like 'key2', 'def2', 'ver3', 'tim2' add ambiguity and reduce clarity. Nesting is flat, which is good, and each action is generally on its own line. However, the code is unnecessarily repetitive and the naming inconsistencies break natural reading flow. The 'hos' parameter is unused and unexplained. Overall, the code is difficult to understand at a glance and would require significant renaming and cleanup in a real codebase.
Run 1
Code Structure: The class is logically organized into small cache-operation methods, with consistent spacing and implementation patterns. Nesting: Methods are flat, with no nested control flow. Clarity of intent: DummyCache and recognizable operations suggest a no-op cache, but abbreviated method names such as tou, del2, has, and cle obscure their purposes. Numbered parameters such as key3, tim2, and ver5 are distracting, while hos, arg, and kwa are unclear. Code length: The implementation is concise, with little unnecessary code. Action granularity: Each line performs a single action, making individual methods easy to follow. Reading flow: Consistent validation followed by a return supports natural reading, but inconsistent naming across methods disrupts continuity. Overall, the simple structure is readable, but poor naming substantially reduces clarity.
Run 2
Code Structure: Methods are logically grouped within a single cache class, with consistent implementation patterns. Nesting: Flat method bodies make the code easy to scan. Clarity of intent: DummyCache suggests a no-op cache, but abbreviated method names such as tou, del2, has, and cle, along with numbered parameters, obscure operations and weaken consistency with the expected cache interface. Unused parameters are plausible for a dummy implementation but remain unexplained. Code length: Short and appropriately concise, without unnecessary complexity. Action granularity: Each line performs one clear action. Reading flow: Repeated validation followed by simple returns creates a predictable flow, though inconsistent naming interrupts comprehension.
Run 3
Code Structure: Methods are logically grouped within a single cache class, with consistent implementation patterns. Nesting: Minimal nesting makes each method easy to scan. Clarity of intent: DummyCache suggests a no-op cache, but abbreviated method names such as tou, del2, and cle, along with numbered parameters like key4 and ver3, obscure meaning and API correspondence. Unused parameters and the unexplained hos argument further weaken clarity. Code length: Short and appropriately concise for a dummy implementation. Action granularity: Each line performs one straightforward action. Reading flow: Consistent spacing and repeated validation-then-return patterns support natural reading, though inconsistent naming interrupts comprehension.