Sample
pyint-06e76eda52e2-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable |
| Dorn | 0.861 | 0–1; higher is more readable |
| Mi | 0.359 | 0–1; higher is more readable |
| LLOC | 17 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.704 | 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. | 615.58 | −20.314 |
| Source linesThe number of non-empty source lines. | 27 | +10.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.527 | −6.791 |
Intercept 8.87 + feature contributions = -7.435 (log-odds).
Score = sigmoid(-7.435) = 0.001.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.034 | +0.614 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 80.071 | +0.487 |
| 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. | 82.893 | +0.154 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 24 | +0.093 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 28 | +0.045 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 26.857 | −0.034 |
Intercept 0.07 + feature contributions = 1.827 (log-odds).
Score = sigmoid(1.827) = 0.861.
| Score | 0.359 |
|---|
| Score | 17 |
|---|
Run 1
The code is highly readable, with clear imports, a single purpose, and a clean class definition. The NullSession class is logically structured, and the _fail method clearly communicates intent with a descriptive error message. Nesting is minimal, and each assignment of methods to _fail is concise. Action granularity is well handled, as the method aliasing is compact but still understandable. The only minor drawback is the slight ambiguity in the import of collections.abc as c, which is unused, but this does not significantly impact readability.
Run 2
The code is generally readable with clear intent and logical structure. The class purpose is documented, and the error message is descriptive. However, the final line assigning multiple methods to _fail in one statement reduces action granularity and harms readability; it is dense and easy to miss. Nesting is minimal, length is concise, and reading flow is natural. Overall, it is understandable but could improve clarity by separating method assignments or using a loop.
Run 3
The code is relatively clear in its intent and readable for a small utility class. The docstring explains the class purpose well, and the error message is descriptive. However, there are a few issues that reduce readability. The imports are somewhat messy—mixing `collections.abc` with an alias `c`, then separately importing `MutableMapping`—which adds visual noise and ambiguity. The `NullSession` class inherits from `SecureCookieSession` without explanation or local definition, forcing the reader to understand an external context. The assignment of multiple dunder methods (`__setitem__`, `__delitem__`, `clear`, `pop`, etc.) to `_fail` on one line is compact but reduces action granularity and reading flow, making it less obvious what each method does. The line is also long and can be easily overlooked. Overall, the code is not deeply nested and has a logical structure, but the mixed import style and compressed method assignment lower its readability.
Run 1
Code Structure: The class is logically organized around a single failure handler, although numerous unused imports distract from its purpose and the base class is not defined or imported in the snippet. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: The docstring and descriptive error message clearly explain read-only session behavior and why modifications fail. Code length: The implementation is concise, but the imports add unnecessary length within this excerpt. Action granularity: Most lines perform one action; the chained assignment binds seven methods at once, sacrificing some readability for compactness. Reading flow: The progression from documentation to error handler to method bindings is natural, though the dense assignment and deletion of the helper require familiarity with Python class construction.
Run 2
Code Structure: The class is logically organized, although several imports are unused in this snippet and the SecureCookieSession base class is not shown. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring and descriptive error message clearly explain the read-only fallback behavior; assigning mutation methods to _fail is less immediately obvious. Code length: The implementation is concise, with little unnecessary code beyond the unused imports. Action granularity: Most lines perform one action, but the chained assignment binds seven methods at once, increasing cognitive load. Reading flow: The progression from documentation to error handling to method binding is natural, though the dense assignment and deletion of _fail require familiarity with Python class construction.
Run 3
Code Structure: The class is logically organized into a descriptive docstring, an error-raising helper, and mutation-method overrides, although several imports are unused in this snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring and explicit error message clearly explain the read-only session behavior; however, SecureCookieSession is not defined or imported here, leaving some context missing. Code length: The implementation is concise without repetitive method definitions. Action granularity: Most lines perform one action, but the chained assignment binds seven methods at once and requires closer reading. Reading flow: The progression from explanation to implementation is natural, though the dense assignment and subsequent deletion of _fail introduce a slightly non-obvious idiom.