Sample
pyint-2e262ecfa857-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.64 | 0–1; higher is more readable |
| Mi | 0.598 | 0–1; higher is more readable |
| LLOC | 145 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.572 | 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. | 8743.824 | −288.546 |
| Source linesThe number of non-empty source lines. | 298 | +119.2 |
| 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.384 | −6.576 |
Intercept 8.87 + feature contributions = -167.052 (log-odds).
Score = sigmoid(-167.052) = 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. | 299 | −9.55 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 198 | +6.111 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 297.822 | +3.753 |
| 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. | 133.973 | −2.009 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 133.99 | +1.357 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.051 | +0.443 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 0.573 (log-odds).
Score = sigmoid(0.573) = 0.64.
| Score | 0.598 |
|---|
| Score | 145 |
|---|
Run 1
The code is highly readable with clear structure, comprehensive docstrings, and logical organization. It uses flat nesting (maximum 2-3 levels), maintains one action per line, and follows natural reading flow. Type hints are used consistently, and methods are appropriately named (get, set, keys, values, items). The main strength is the excellent documentation explaining the 'why' behind methods. Minor deductions: some methods like multiple_domains could be simplified using set operations, and a few comments contain defensive redundancies. Overall, this represents production-quality code with very high clarity of intent.
Run 2
The code is highly readable with clear structure and logical organization. Each method serves a single, focused purpose with descriptive names and comprehensive docstrings. Nesting is generally flat, although _find and _find_no_duplicates have three-level nested conditionals that could be flattened. The code maintains one action per line throughout, and the reading flow follows a natural progression from basic operations to more complex methods. Docstrings are excellent, clearly explaining the O(n) complexity warnings, compatibility purposes, and method behaviors. Type hints are used consistently and appropriately. The code length is justified given the comprehensive documentation. Minor deductions: nested conditionals in finding methods and a few slightly verbose docstrings. Overall, this demonstrates exemplary readability that prioritizes maintainability and clear intent communication.
Run 3
The code has a clear class structure with logical method definitions, which supports readability. However, several issues reduce clarity: it uses a mix of naming styles (e.g., 'toReturn' instead of 'to_return'), has multiple methods with repetitive docstrings, and includes deeply nested conditional blocks in methods like '_find' and '_find_no_duplicates'. The 'set_cookie' method uses the walrus operator in an awkward way, making the intent less clear. Some methods (e.g., '__iter__') are trivial and could be consolidated, but not severely. The class purpose is documented well, and methods generally have a single action per line, but the overall flow is interrupted by long docblocks and inconsistent type hints. The code is fairly maintainable but not highly readable due to nesting and minor style inconsistencies.
Run 1
1. Code Structure: Well-organized class with focused methods covering mapping compatibility, lookup, serialization, and copying; imports are less consistently organized. 2. Nesting: Most methods are shallow, but _find and _find_no_duplicates use unnecessarily deep conditional chains. 3. Clarity of intent: Descriptive method names, type annotations, and extensive docstrings clarify purpose. However, multiple_domains checks for repeated domains rather than distinct domains, contradicting its documentation; toReturn is also a weak, inconsistently styled name. 4. Code length: Individual methods are generally concise, although repetitive iterator wrappers and verbose documentation lengthen the class. 5. Action granularity: Statements generally perform one action each; the assignment expression in set_cookie slightly increases cognitive load. 6. Reading flow: Consistent formatting and related method grouping support natural reading, while long type-ignore comments, repeated filtering logic, and references to helpers outside the snippet introduce friction.
Run 2
Code Structure: Methods are logically grouped around dictionary compatibility, cookie lookup, and serialization, with clear separation of responsibilities. Nesting: Most methods are flat, but _find and _find_no_duplicates contain unnecessarily deep conditional nesting. Clarity of intent: Descriptive method names, type annotations, and extensive docstrings explain most behavior well; however, multiple_domains checks repeated domains rather than distinct domains, contradicting its stated purpose. Some comments and docstrings also inaccurately describe behavior. Code length: Individual methods are generally concise, though repetitive documentation and duplicated filtering logic add bulk. Action granularity: Statements usually perform one action per line; the assignment expression in set_cookie slightly increases cognitive load. Reading flow: Consistent formatting and predictable method patterns support natural reading, but inconsistent naming such as toReturn, long inline type-ignore comments, and poorly ordered or apparently unused imports introduce distractions.
Run 3
Code Structure: Methods are logically grouped around dictionary compatibility, cookie lookup, and serialization, with clear separation of responsibilities. Nesting: Most methods are shallow, but _find and _find_no_duplicates contain several nested conditions that could be flattened. Clarity of intent: Descriptive method names, type annotations, and docstrings explain most behavior well; however, multiple_domains checks for repeated domains rather than distinct domains, and some docstrings do not match implementation behavior. Code length: Individual methods are generally concise, though repetitive documentation and duplicated lookup logic make the class longer than necessary. Action granularity: Statements generally perform one action each; the assignment expression in set_cookie slightly increases cognitive load. Reading flow: Consistent formatting and predictable method patterns aid scanning, but inconsistent naming such as toReturn, long inline suppression comments, and the misplaced threading import interrupt the flow.