Sample
pyint-8ae2ff980588-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.298 | 0–1; higher is more readable |
| Mi | 0.472 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.3 | 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.727 | −7.09 |
Intercept 8.87 + feature contributions = -46.768 (log-odds).
Score = sigmoid(-46.768) = 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.858 (log-odds).
Score = sigmoid(-0.858) = 0.298.
| Score | 0.472 |
|---|
| Score | 35 |
|---|
Run 1
The code shows good structure with clear class organization and proper type hints. The docstring is helpful but somewhat verbose. However, several readability issues exist: the use of hexadecimal `0x1` instead of `1` for tuple indexing is confusing and unconventional; the equality comparison logic is a bit convoluted with the `NotImplemented` return and type ignore comment; variable names like `casedkey`, `keyval`, and `lowerkey` are inconsistent (mixing styles); the `__iter__` generator expression could be clearer with a named variable instead of underscore. The class is relatively flat with minimal nesting, which is good. Action granularity is mostly one action per line, though some generator expressions pack multiple operations. Overall the intent is clear, but these minor issues prevent maximum readability.
Run 2
The code is generally readable with clear structure and intent. It benefits from type hints, a docstring with usage examples, and a logical organization. However, readability is slightly reduced by unconventional choices like `[0x1]` instead of `[1]`, which obscures intent, and the use of `reportUnknownArgumentType`/`type: ignore` comments that add noise. Nesting is flat and methods are concise, with one action per line in most cases. The `__eq__` method has a slightly awkward flow, and the `lower_items` generator expression is compact but less natural to read. Overall, the code is well-structured but could be improved with clearer indexing syntax and fewer type-related suppressions.
Run 3
The code is generally well-structured with clear class-level documentation, logical method organization, and type hints that clarify intent. Methods are short and focused, with one action per line in most cases. Nesting is minimal. However, readability is somewhat reduced by the use of non-obvious hexadecimal indexing (`0x1`) instead of `1`, inconsistent use of generator expressions vs. list/dict comprehensions in `__iter__` and `lower_items`, and a slightly convoluted `__eq__` method that could be simplified. The `type: ignore` comment in `__eq__` also hints at type-checking friction that may confuse readers. Overall, the code is understandable but has a few stylistic quirks that prevent it from being maximally readable.
Run 1
Code Structure: Well-organized class with small, focused methods implementing a familiar mapping interface. Nesting: Minimal nesting; simple conditionals and generator expressions keep complexity low. Clarity of intent: The detailed docstring, type annotations, and storage comment explain case-insensitive behavior clearly. However, hexadecimal tuple indices (0x1) obscure ordinary indexing, and _VT is referenced without a visible definition. Code length: Methods are concise; the docstring is lengthy but useful, while unused imports add minor clutter. Action granularity: Statements generally perform one action each, with compact expressions remaining understandable. Reading flow: Methods follow a natural progression from initialization through mapping operations to comparison, copying, and representation. Minor distractions include the long type-ignore line, terse tuple variable names, and references to legacy iteration methods.
Run 2
Code Structure: Well-organized class with small methods corresponding to standard mapping operations. Nesting: Very shallow, with only simple conditionals and generator expressions. Clarity of intent: The descriptive class name, comprehensive docstring, type annotations, and storage comment explain the case-insensitive behavior clearly. However, _VT is never defined despite importing TypeVar, and hexadecimal tuple indices (0x1) unnecessarily obscure ordinary indexing. Code length: Implementation is concise; the lengthy docstring is mostly useful, though some documentation and comments reference outdated methods or state the obvious. Action granularity: Statements generally perform one clear action each. Reading flow: Methods progress naturally from initialization through mapping operations to comparison, copying, and representation. Long annotation lines and inconsistent variable naming slightly interrupt otherwise smooth reading.
Run 3
Code Structure: Methods are logically organized around the mapping interface, with a consistent internal representation. Nesting: Minimal nesting and short methods make control flow easy to follow. Clarity of intent: The class docstring, descriptive method names, and type annotations clearly explain case-insensitive behavior. However, _VT is not defined in the snippet despite importing TypeVar, and hexadecimal tuple indices (0x1) unnecessarily obscure simple value access. Code length: Implementation is concise; the lengthy docstring mostly provides useful context. Action granularity: Statements generally perform one action per line, although generator expressions and the long equality-conversion line require slightly more effort to parse. Reading flow: Construction, core mapping operations, comparison, copying, and representation follow a natural sequence. Minor distractions include outdated iteritems references and the verbose type-ignore comment.