Sample
pyint-0cf995cfffd5-I01
Remove comments and docstrings
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.927 | 0–1; higher is more readable |
| Mi | 0.531 | 0–1; higher is more readable |
| LLOC | 121 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.552 | 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. | 8315.156 | −274.4 |
| Source linesThe number of non-empty source lines. | 211 | +84.4 |
| 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.206 | −6.309 |
Intercept 8.87 + feature contributions = -187.439 (log-odds).
Score = sigmoid(-187.439) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 211 | +6.561 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 210 | −6.399 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 210.795 | +2.537 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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. | 81.958 | +0.194 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.098 | −0.011 |
Intercept 0.07 + feature contributions = 2.545 (log-odds).
Score = sigmoid(2.545) = 0.927.
| Score | 0.531 |
|---|
| Score | 121 |
|---|
Run 1
The code is generally readable but has several issues. Structure is logical with clear method grouping, but imports are disorganized (threading at bottom). Nesting is problematic in _find and _find_no_duplicates with three-level nested conditionals. Intent is mostly clear but some methods have empty docstrings instead of meaningful documentation. Code length is reasonable with concise methods. Action granularity follows one-action-per-line well. Reading flow is natural, following Python conventions. The main issues are: unnecessary empty docstrings, inconsistent type hints, the walrus operator in set_cookie makes intent less clear, and multiple_domains has a logic issue (checks domain in list before appending). The nested conditionals in _find methods could be flattened using early returns or continue statements. Some methods like _find_no_duplicates could be more concise with better structure.
Run 2
The code is generally well-structured with clear method organization and type hints. Nested conditions in `_find_no_duplicates` and `_find` could be flattened using early continues or combined conditions. The use of walrus operator in `set_cookie` improves conciseness but may slightly reduce readability. Magic methods are appropriately grouped together. Some methods like `multiple_domains` have redundant type annotations and could use set() for clarity. Empty comment blocks (docstring placeholders with only whitespace) are minor noise. Overall, the code is readable with clear intent and good naming, but minor nesting depth and redundant annotations prevent a higher score.
Run 3
The code is generally clear and well-structured, but has a few readability issues. Positives: logical class organization with related methods grouped, flat nesting in most methods, clear intent with descriptive names, one action per line mostly, and natural reading flow. The methods are concise, and type hints improve clarity. Negatives: excessive blank lines (e.g., between method signature and body, multiple consecutive spaces after colons), inconsistent spacing in type hints (e.g., 'str | None' vs 'CookieJar | SupportsKeysAndGetItem'), and a few slightly dense lines such as the conditional stription in set_cookie. The _find and _find_no_duplicates methods have triple nesting, which slightly reduces readability. Some methods like list_domains and list_paths could be more concise with set comprehension. Overall, the code is above average in readability but would benefit from consistent formatting and minor refactoring.
Run 1
Code Structure: Logically organized into focused cookie-access, mapping, lookup, and serialization methods, although grouping could be clearer. Nesting: Most methods are shallow, but _find and _find_no_duplicates contain unnecessarily deep conditional chains. Clarity of intent: Descriptive method names and type annotations communicate purpose well; absent documentation, abbreviated variables such as c and new_cj, inconsistent toReturn naming, and surprising multiple_domains behavior weaken clarity. Code length: Methods are generally concise, but repeated iteration patterns, redundant wrappers, and excessive blank lines add noise. Action granularity: Statements generally perform one action per line; the assignment expression in set_cookie slightly increases density. Reading flow: Conventional method implementations are easy to follow, but inconsistent whitespace, scattered import ordering, and nested lookup logic interrupt the flow.
Run 2
Code Structure: The class is logically organized into mapping operations, cookie lookup, serialization, and copying, with small, focused methods. Nesting: Most methods are shallow, but _find and _find_no_duplicates use unnecessarily deep conditional chains. Clarity of intent: Descriptive method names and type annotations help, while missing docstrings, abbreviated variables such as c and new_cj, and inconsistent toReturn naming reduce clarity. The multiple_domains implementation also appears at odds with its name, complicating interpretation. Code length: Individual methods are concise, although repetitive lookup logic and excessive blank whitespace add avoidable bulk. Action granularity: Statements generally perform one action per line; the assignment expression in set_cookie slightly increases cognitive load. Reading flow: Method grouping is natural, but inconsistent whitespace, threading imported after local imports, and externally defined helpers and types make the snippet less self-contained.
Run 3
Code Structure: Methods are logically grouped within a focused cookie-jar class, though import ordering and excessive blank whitespace reduce polish. Nesting: Most methods are shallow, but _find and _find_no_duplicates contain three to four nested conditionals that could be flattened. Clarity of intent: Descriptive method names and type annotations communicate purpose well; abbreviated variables, inconsistent toReturn naming, and undocumented duplicate-handling and serialization behavior weaken clarity. Code length: Individual methods are concise, but repeated filtering logic and iterator/list wrappers add verbosity. Action granularity: Statements generally perform one action per line; the assignment expression in set_cookie slightly increases cognitive load. Reading flow: Public operations precede lookup and serialization helpers in a mostly natural sequence, but missing definitions for referenced helpers/types and unused imports distract when reading this snippet independently.