Sample
pyint-637bf8b749c8-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.17 | 0–1; higher is more readable |
| Mi | 0.425 | 0–1; higher is more readable |
| LLOC | 90 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.182 | 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. | 6017.346 | −198.572 |
| Source linesThe number of non-empty source lines. | 182 | +72.8 |
| 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.467 | −6.7 |
Intercept 8.87 + feature contributions = -123.603 (log-odds).
Score = sigmoid(-123.603) = 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. | 183 | −5.443 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 148 | +4.382 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 148 | −2.975 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 181.839 | +2.132 |
| 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. | 110.984 | −1.036 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 110.973 | +0.986 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.297 |
Intercept 0.07 + feature contributions = -1.587 (log-odds).
Score = sigmoid(-1.587) = 0.17.
| Score | 0.425 |
|---|
| Score | 90 |
|---|
Run 1
The code is primarily unreadable due to the `open` method, which uses deeply nested conditional logic with cryptic single-letter variables (a, b, c, d, e, f, g, h, i, j, k, l). Instead of simply checking `args[0]`, it performs arithmetic like `a + b` to yield `0`, which severely obscures intent and violates clarity of intent, nesting, and action granularity. The rest of the class is reasonably structured with good docstrings and type hints, but the `open` method dominates the reading experience and makes the overall code difficult to follow and maintain. The action granularity is poor, as many lines perform multiple steps via obfuscated conditions. The reading flow is natural until the `open` method, where it becomes disorganized.
Run 2
The code is difficult to read due to several factors. First, the 'open' method is deeply nested with excessive use of meaningless variable names (a, b, c, etc.) solely for arithmetic to represent indices, which obscures the logic. The action granularity is poor; multiple actions are condensed into complex expressions. The reading flow is disrupted by the use of 'type: ignore' comments and copy operations. Additionally, the intent of the code, particularly in the index calculations, is not clear. While the class docstring and some method docstrings are good, they do not compensate for the convoluted implementation. The structure is logical at a high level, but the execution is tangled. Overall, this code would be very hard to maintain or debug as-is.
Run 3
The code has good structure and documentation, but the `open` method is severely degraded by obfuscated variable names and artificial arithmetic (e.g., `a = 1`, `b = -1`, `args[(a + b)]`). This makes the intent ambiguous and the reading flow poor. The deeply nested if/elif/else blocks in `open` are hard to follow, and several lines perform multiple actions. The rest of the class is reasonably readable, but the `open` method's unmaintainable style drags the score down significantly.
Run 1
Code Structure: Methods separate session management, request construction, and context cleanup logically. Nesting: Generally shallow, with a manageable nested type-dispatch block in open(). Clarity of intent: Descriptive method names, type annotations, and docstrings explain most behavior, but meaningless variables a through l and arithmetic indexing obscure simple args[0] accesses. Code length: Most methods are appropriately sized; redundant assignments unnecessarily inflate open(). Action granularity: Statements generally perform one action per line, although some request-building expressions combine several operations. Reading flow: Session and context lifecycles follow a coherent sequence, aided by comments, but artificial index calculations repeatedly interrupt comprehension. Referenced types and helpers absent from the snippet also limit standalone understanding.
Run 2
Code Structure: Methods are logically separated by responsibility, with coherent session, request, and context management. Nesting: Mostly shallow, although open() contains a moderately nested type-dispatch block. Clarity of intent: Descriptive method names, type annotations, docstrings, and lifecycle comments help, but meaningless variables a through l and arithmetic expressions replacing args[0] obscure straightforward indexing. Code length: Most methods are appropriately sized; redundant assignments in open() unnecessarily inflate the code. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: The class follows a natural initialization-to-request-to-cleanup progression, but repeated artificial index calculations interrupt that flow. Some referenced types and helpers are not defined or imported in the supplied excerpt, limiting standalone comprehension.
Run 3
Code Structure: Well-separated methods organize session handling, request construction, and context cleanup logically. Nesting: Mostly shallow, with a manageable nested dispatch block in open(). Clarity of intent: Descriptive method names, type hints, docstrings, and lifecycle comments help, but meaningless variables a through l and arithmetic indexing obscure simple args[0] access. Code length: Most methods are appropriately sized; redundant assignments unnecessarily inflate open(), while documentation provides useful context. Action granularity: Statements generally perform one action per line, although chained builder calls and long expressions require extra parsing. Reading flow: Session and context operations follow a natural sequence, but repeated arithmetic indexing interrupts request dispatch, and the misleading 'request is None' comment adds confusion. Referenced types and helpers not defined in the excerpt also limit standalone understanding.