Sample
pyint-7878b5ed7b31-I10
Deterministically remove some optional blank lines and bracketed line breaks
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.607 | 0–1; higher is more readable |
| Mi | 0.429 | 0–1; higher is more readable |
| LLOC | 145 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.33 | 0–20; mean of three runs |
| BTTF | 0.56 | 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. | 269 | +107.6 |
| 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.379 | −6.569 |
Intercept 8.87 + feature contributions = -178.645 (log-odds).
Score = sigmoid(-178.645) = 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. | 269 | −8.488 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 175 | +5.316 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 268.837 | +3.348 |
| 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.974 | −2.009 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 133.978 | +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.435 (log-odds).
Score = sigmoid(0.435) = 0.607.
| Score | 0.429 |
|---|
| Score | 145 |
|---|
Run 1
The code is generally readable and well-structured, but has some inconsistencies that detract from clarity. Class methods are logically organized and docstrings are helpful. However, there are several formatting issues: inconsistent spacing in function signatures (e.g., `set_cookie`, `_find_no_duplicates`), missing blank lines between some methods, and misaligned closing braces in chained method calls. The `_find_no_duplicates` method has a nested conditional structure that could be flattened for clarity, and variable naming like `toReturn` breaks Python conventions. Some methods like `multiple_domains` and `list_domains` have redundant logic. While the overall purpose is clear and the code is concise, these inconsistencies in action granularity and reading flow prevent it from scoring higher.
Run 2
The code suffers from severe readability issues. Structure is inconsistent: methods are packed together with little or no spacing, while some signatures are broken awkwardly across lines with odd indentation and parameter alignment. Nesting is excessive in methods like _find and _find_no_duplicates, creating deep conditional chains. Clarity of intent is undermined by inconsistent naming (toReturn instead of snake_case), misplaced warnings, and unclear comments. Action granularity is poor: many lines contain multiple statements or bizarrely wrapped expressions. Reading flow is disjointed due to erratic line breaks, unexpected placement of return type annotations (e.g., '-> str' on separate line), and inconsistent formatting. While some docstrings are helpful, they are often poorly formatted and not enough to offset the overall lack of polish. The code is functional but not readable.
Run 3
The code has a clear class structure and useful docstrings, but readability suffers from inconsistent spacing, misaligned function parameters, and inconsistent blank lines between methods. Several method signatures have awkward line breaks (e.g., `get()` and `set()`), and some closing parentheses are placed far from their function calls. The `get_dict()` method has overly long lines and multi-line conditions that could be simplified. Nested conditionals in `_find_no_duplicates()` create deep nesting (4 levels), making the logic harder to follow. While the core intent is understandable, the formatting is disorganized and detracts from the reading flow. Overall, the code is functional but would benefit from consistent formatting, reduced nesting, and cleaner parameter alignment.
Run 1
Code Structure: Methods are logically separated into mapping operations, cookie lookup, and serialization, though inconsistent spacing weakens organization. Nesting: Most methods are shallow, but lookup helpers contain three to four nested conditionals that could be flattened. Clarity of intent: Descriptive method names, type annotations, and extensive docstrings explain the compatibility interface well; terse variables such as c and toReturn, plus some misleading documentation, reduce clarity. Code length: Most methods are concise, but repetitive wrappers, verbose docstrings, and duplicated filtering logic add bulk. Action granularity: Statements generally perform one action per line; the assignment expression in set_cookie slightly increases cognitive load. Reading flow: Related methods mostly follow a natural sequence, but missing blank lines, irregular signature formatting, excessive inline whitespace, and long comments interrupt scanning.
Run 2
Code Structure: Cohesive class with small, logically related methods, though inconsistent spacing between methods weakens organization. Nesting: Most methods are shallow, but lookup helpers use three to four nested conditions that could be flattened. Clarity of intent: Descriptive method names, type annotations, and docstrings explain the interface well; vague variables such as c and toReturn, plus misleading documentation in multiple_domains and __setitem__, reduce clarity. Code length: Individual methods are generally concise, but repetitive wrappers and extensive boilerplate docstrings make the class lengthy. Action granularity: Statements generally perform one action per line; the assignment expression in set_cookie slightly increases cognitive load. Reading flow: Related methods are grouped naturally, but irregular signature formatting, excessive inline spacing, long comments, and missing blank lines interrupt scanning.
Run 3
Code Structure: Cohesive class with small, logically related methods, though inconsistent spacing and import organization weaken presentation. Nesting: Most methods are shallow, but the cookie lookup helpers contain three to four nested conditions that could be flattened. Clarity of intent: Descriptive method names, type annotations, and extensive docstrings explain the interface well; generic names such as c and toReturn, plus occasional mismatches between documentation and implementation, reduce clarity. Code length: Individual methods are concise, but repetitive iteration patterns and verbose boilerplate documentation make the class longer than necessary. Action granularity: Almost every statement performs one action; the assignment expression in set_cookie slightly increases parsing effort. Reading flow: Related operations generally appear together, but missing blank lines, awkward signature wrapping, excessive inline whitespace, and long suppression comments interrupt otherwise natural reading.