Sample
pyint-bf535d2c1878-I11
Split eligible integer literals into pairs of short-named intermediate variables
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.67 | 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 well-structured and highly readable. It uses clear class organization with logically grouped methods, comprehensive docstrings, and type hints that aid understanding. Nesting levels are manageable, with only the _find_no_duplicates method having deeper nesting (four levels) but still comprehensible. Intent is clear throughout - each method's purpose is evident from names and documentation. Code length is appropriate, not unnecessarily verbose, with methods focused on single responsibilities. Action granularity is excellent - most operations are on separate lines making debugging and comprehension easier. Reading flow is natural with methods ordered logically: getters, setters, iterators, then internal helpers. The imports are clean and organized. Minor deductions for some redundant comments, slightly verbose docstrings in places, and the multiple_domains method having slightly confusing logic with the 'domains' variable. Overall, this is production-quality code that a new developer could quickly understand.
Run 3
The code is well-structured and readable, with clear class and method organization. It uses flat method bodies with minimal nesting (max 3 levels in _find_no_duplicates). Each method has a docstring explaining purpose and complexity. Naming is clear and consistent. The code is somewhat long but not unnecessarily so due to the compatibility layer requirements. Most operations are one action per line, and type hints improve clarity. Minor issues: some methods like list_domains could use set() for brevity, and the _find method has nested ifs that could be flattened with combined conditions. The walrus operator in set_cookie adds slight complexity but is contained within a single condition. Overall, it follows Python idioms well and maintains natural reading flow.
Run 1
Code Structure: Methods are logically grouped around dictionary compatibility, cookie lookup, and serialization, with well-separated responsibilities. Nesting: Most methods are flat, but _find and _find_no_duplicates contain unnecessarily deep conditional nesting that could be simplified. Clarity of intent: Descriptive method names, type annotations, and extensive docstrings make the purpose clear; however, multiple_domains checks repeated domains rather than distinct domains, contradicting its description, and toReturn is vague and stylistically inconsistent. Code length: Individual methods are generally concise, though repetitive iterator wrappers and verbose documentation increase overall length. Action granularity: Statements usually perform one action per line; the assignment expression in set_cookie slightly increases cognitive load. Reading flow: Consistent formatting and straightforward control flow support easy reading, but the misplaced threading import, long inline suppression comments, and references to definitions outside the snippet introduce minor friction.
Run 2
Code Structure: Well organized into focused methods covering mapping operations, cookie lookup, and serialization, though imports are inconsistently grouped. Nesting: Most methods are shallow, but lookup helpers contain several nested conditions that could be flattened. Clarity of intent: Descriptive names, type annotations, and extensive docstrings explain most behavior; however, multiple_domains checks repeated domains rather than distinct domains, contradicting its stated intent, and some assignment documentation is misleading. Code length: Generally appropriate for the functionality, but repetitive documentation and similar lookup logic add bulk. Action granularity: Almost every statement performs one clear action; the assignment expression in set_cookie adds minor complexity. Reading flow: Related methods are grouped naturally, and formatting is consistent overall, although long suppression comments, the nonstandard toReturn name, and repeated conditional chains interrupt the flow.
Run 3
Code Structure: Logically organized into small methods covering mapping operations, cookie lookup, serialization, and copying. Nesting: Most methods are shallow, but _find and _find_no_duplicates have unnecessarily deep conditional chains. Clarity of intent: Descriptive method names, type annotations, and extensive docstrings clarify the API; however, multiple_domains checks for repeated domains rather than distinct ones, and some documentation conflicts with implementation. Code length: Individual methods are concise, but repetitive wrappers, lookup conditions, and verbose docstrings increase overall length. Action granularity: Almost every statement performs one action; the assignment expression in set_cookie slightly increases cognitive load. Reading flow: Generally natural and consistent, though mixed import ordering, long type-ignore comments, and inconsistent variable naming such as toReturn interrupt readability.