Sample
pyint-c023be8075de-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.298 | 0–1; higher is more readable |
| Mi | 0.474 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.33 | 0–20; mean of three runs |
| BTTF | 0.419 | 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. | 2440.842 | −80.548 |
| 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.715 | −7.073 |
Intercept 8.87 + feature contributions = -46.751 (log-odds).
Score = sigmoid(-46.751) = 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. | 119.975 | −1.416 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 119.988 | +1.131 |
| 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.826 | +0.706 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.072 | +0.239 |
Intercept 0.07 + feature contributions = -0.859 (log-odds).
Score = sigmoid(-0.859) = 0.298.
| Score | 0.474 |
|---|
| Score | 35 |
|---|
Run 1
The code has reasonable logical organization (class structure, dunder methods grouped) and short helper methods, but it is undermined by misleading naming and unclear intent. Parameters like 'user', 'map', 'entry', and methods 'buildConfig', 'find' obscure the data semantics (e.g., 'map' is actually a key). 'buildConfig' returns lowercased items, but the name suggests building a config object; 'find' returns a copy, not a search result. The generator in `__iter__` uses 'category' for a key and yields 'key' for the stored original key, which is confusing. Several lines are dense, and some expressions (e.g., `return ((document, source[1]) for (document, source) in self._store.items())`) could be clearer with meaningful variable names. Nesting is low, and action granularity is mostly one action per line, which helps. The docstring is informative but ambiguous about undefined behavior on duplicate lowercased keys. Overall, the structure is salvageable but readability suffers significantly from poor naming and misleading method names.
Run 2
The code has good documentation and type hints, but suffers from poor naming and misleading methods. Method names like `buildConfig`, `find`, and parameters like `map`, `entry`, `user` do not clearly express their purpose, significantly hurting clarity of intent. `buildConfig` actually returns lowercase items, and `find` actually returns a copy, which is confusing. The structure is mostly flat and organized, but the logic in `__eq__` is awkward with an unused `defaultKey` variable. Some methods are concise, while others like `buildConfig` pack multiple operations into a single line, reducing readability. Reading flow is disrupted by the need to mentally map unclear names to their actual behavior. Overall, the code is understandable but not highly readable due to these issues.
Run 3
The code follows a logical class structure with clear separation of dunder methods, and the docstring provides helpful examples. However, readability is undermined by confusing naming choices in method parameters ('map' for a key, 'entry' for a value), and misleading method names ('buildConfig' for lowercase iteration, 'find' for copy). Variable names like 'document', 'source', 'category', and 'defaultKey' are inconsistent and obscure intent. There is some unnecessary verbosity: __iter__ and __eq__ use redundant generator expressions, and __init__ has avoidable branching. Mutation methods are concise and mostly flat, but odd naming and parameter types (e.g., `map: str`) force the reader to constantly reinterpret what variables represent. Overall, structure is reasonable but clarity and naming significantly reduce readability.
Run 1
Code Structure: The class is logically organized into small mapping methods, but advertised methods such as lower_items and copy are replaced by unrelated names. Nesting: Minimal nesting makes individual methods easy to follow. Clarity of intent: The docstring and storage comment explain the design well, but misleading identifiers such as map, category, buildConfig, and find obscure meaning. _VT is not defined in the snippet, and equality calls an absent lower_items method, undermining confidence in the implementation. Code length: Methods are concise; the lengthy docstring provides useful context, though it does not consistently match the implementation. Action granularity: Statements generally perform one action each, with straightforward expressions and comprehensions. Reading flow: Standard mapping-method ordering supports natural reading, but inconsistent naming, camelCase identifiers, and documentation mismatches interrupt that flow.
Run 2
Code Structure: Methods are logically organized around a mapping implementation, but advertised methods lower_items and copy are instead named buildConfig and find, creating inconsistencies. Nesting: Minimal nesting makes individual methods easy to scan. Clarity of intent: The class docstring and storage comment explain the design, but misleading names such as user, result, map, category, and defaultKey obscure roles. _VT is undefined in the snippet, and equality calls a missing lower_items method. Code length: Most methods are concise, though the lengthy docstring and equality annotation add visual weight. Action granularity: Statements generally perform one action per line; generator expressions remain manageable. Reading flow: The standard mapping-method sequence reads naturally, but inconsistent naming, camelCase, and documentation mismatches interrupt comprehension and undermine confidence.
Run 3
Code Structure: The class is logically organized into small mapping methods, but its documented interface conflicts with implementation: lower_items and copy are described but named buildConfig and find, and _VT is undefined. Nesting: Minimal nesting and simple conditionals make methods easy to scan. Clarity of intent: The class docstring and storage comment explain case-insensitive behavior well, but misleading names such as map, category, document, source, and defaultKey obscure key/value roles. Equality calls the missing lower_items method, further undermining comprehension. Code length: Implementation is concise, although documentation is relatively lengthy and some imports are unused. Action granularity: Statements generally perform one action per line; generator expressions remain compact and manageable. Reading flow: Familiar mapping-method ordering supports natural reading, but inconsistent naming conventions and mismatches between documentation and methods interrupt that flow.