Sample
pyint-22aee56c115d-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.328 | 0–1; higher is more readable |
| Mi | 0.445 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.67 | 0–20; mean of three runs |
| BTTF | 0.446 | 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. | 2461.042 | −81.214 |
| Source linesThe number of non-empty source lines. | 80 | +32 |
| 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.742 | −7.113 |
Intercept 8.87 + feature contributions = -47.457 (log-odds).
Score = sigmoid(-47.457) = 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. | 81 | −1.832 |
| 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. | 113.975 | −1.162 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 113.975 | +1.034 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 50 | +0.992 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 51 | −0.749 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 79.835 | +0.706 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.074 | +0.224 |
Intercept 0.07 + feature contributions = -0.716 (log-odds).
Score = sigmoid(-0.716) = 0.328.
| Score | 0.445 |
|---|
| Score | 35 |
|---|
Run 1
The code has a clear class purpose and docstring but suffers from several readability issues. The structure is reasonable with logical method ordering, but naming is inconsistent and confusing (e.g., 'key2', 'key3', 'key4', 'key5', 'oth', 'other2', 'lower2', 'cop'). The '__eq__' method is awkward with a type-ignored cast and an unnecessary reassignment. Some methods mix intent with implementation details, and the generator expressions reduce clarity. Nesting is generally flat, which is good, but variable names force the reader to infer meaning. Action granularity is mostly one action per line, though concatenated operations and inline comments add minor clutter. Overall, while functionally structured, the poor naming and unclear equality logic significantly reduce readability.
Run 2
The code has clear intent and decent structure, but suffers from poor naming, inconsistent method names, and a missing method. Variable names like key2, key3, key4, key5, _2, and oth are cryptic. Method names are inconsistent: lower2 should be lower_items, cop should be copy, and __eq__ calls other2.lower_items() which does not exist (likely a bug). The generator expressions are concise but slightly reduce readability due to unclear placeholder names. Nesting is flat, and action granularity is mostly one action per line, aiding flow. The docstring is helpful but long. Overall, the code is understandable, but these naming and consistency issues hurt readability significantly.
Run 3
The code has decent structure with clear class definition and method separation, but suffers from poor naming choices and inconsistent implementation patterns. Variable names like key2, key3, key4, key5, cas, _2, and oth lack clarity and require mental mapping to understand. The method lower2 is misleadingly named since it returns items, not just keys, while the docstring references lower_items which doesn't exist. The method cop is likely a typo for copy, which is confusing. The action granularity is mostly one action per line, and nesting is minimal, which is positive. However, the reading flow is disrupted by these naming inconsistencies and the mismatch between documentation and implementation. The __eq__ method creates a full CaseInsensitiveDict from other mappings, which is a bit indirect but functional. The iterator uses a generator expression that's reasonably clear, but the variable name cas for original-case keys is cryptic. Overall, the code is functional but requires close reading to understand due to naming issues and documentation mismatches.
Run 1
Code Structure: Methods are logically organized around the mapping interface, though undefined _VT and inconsistent method names undermine coherence. Nesting: Minimal nesting and short methods make control flow easy to follow. Clarity of intent: The class docstring and storage comment clearly explain case-insensitive behavior, but names such as dat, kwa, key2, key5, lower2, and cop are vague or misleading. Documentation promises lower_items and copy, while implementations use different names; equality also calls the absent lower_items method. Code length: Implementation is concise, although the docstring is comparatively lengthy and includes outdated iterator terminology. Action granularity: Statements generally perform one action per line; generator expressions are compact without excessive complexity. Reading flow: Conventional method ordering supports natural reading, but inconsistent naming, tuple indexing, and the long inline type-ignore comment interrupt comprehension.
Run 2
Code Structure: Methods are logically organized around the mapping interface, but _VT is undefined and method names conflict with documented usage. Nesting: Very shallow, with simple conditionals and comprehensions. Clarity of intent: The class docstring and storage comment explain the design well, but names such as dat, kwa, key2, key5, lower2, and cop obscure meaning. Equality calls lower_items(), although the implemented method is lower2(), undermining confidence in the intended behavior. Code length: Implementation is concise; the substantial docstring provides useful context but references unsupported or renamed methods. Action granularity: Most lines perform one clear action, although the equality conversion line is crowded by an annotation and suppression comment. Reading flow: Standard mapping methods create a natural progression, but inconsistent naming and documentation force readers to reconcile discrepancies.
Run 3
Code Structure: The class is logically organized into small mapping methods, but _VT is undefined and documented method names differ from implementations. Nesting: Minimal nesting makes control flow easy to follow. Clarity of intent: The docstring and storage comment explain case-insensitive behavior well, but names such as dat, kwa, key2, key5, lower2, and cop obscure meaning. Equality calls lower_items(), although only lower2() is defined, creating confusion. Code length: Methods are concise; the lengthy docstring is mostly useful, though outdated references and unused imports add noise. Action granularity: Statements generally perform one action per line, with compact generator expressions remaining manageable. Reading flow: Standard mapping-method ordering supports natural reading, but inconsistent naming, missing type-variable setup, and documentation mismatches interrupt comprehension.