Sample
pyint-ee4212f5ea91-I05
Rewrite eligible decimal integer literals in hexadecimal notation
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 | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 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. It uses type hints and imports are organized, though the import of 'c' as an alias for collections.abc is unused and confusing. The NullSession class has a clear purpose and the _fail method is concise with a helpful error message. The assignment of multiple methods to _fail in one line is slightly dense but acceptable for boilerplate session methods. The del _fail statement is unusual and could be surprising to readers. Nesting is minimal and the flow is natural. The main drawbacks are the unused import and the slightly cryptic method assignment line, which could benefit from a comment explaining why these methods are assigned to _fail.
Run 3
The code is highly readable and follows good practices. The structure is logical, with a clear class definition and a purpose-explaining docstring. Nesting is minimal, with only one level of indentation in the _fail method. Intent is explicit: the class exists to produce a helpful error when sessions are unavailable. Code length is concise and appropriate for the single responsibility. Action granularity is strong—one clear assignment line consolidates mutating method replacements, which is idiomatic for this pattern. Reading flow is natural: imports, class definition, docstring, method, then method reassignment. Minor deductions: the chained assignment line, while concise, may require a moment to parse; variable names like 'c' and 't' as import aliases are slightly terse; and the 'del _fail' line, though clean, could surprise readers unfamiliar with the pattern.
Run 1
Code Structure: The class is logically organized, with a descriptive docstring and a centralized failure handler, though several imports are unused in this excerpt and the base class is not defined here. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring and explicit error message clearly explain why session mutations fail. Code length: The implementation is concise, although the surrounding imports add clutter. Action granularity: Most lines perform one action, but the chained assignment binds seven methods at once, reducing immediate readability. Reading flow: The progression from documentation to failure behavior to method bindings is natural; deleting the helper afterward and the compact chained assignment require some familiarity with Python class construction.
Run 2
Code Structure: The class is logically organized, although numerous unused imports and an undefined-in-snippet base class distract from its implementation. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The descriptive class name, docstring, and actionable error message clearly explain the read-only session behavior. Code length: The implementation is concise, but the imports add unnecessary length in isolation. Action granularity: Most lines express a single action; the chained assignment overriding seven methods compresses several actions into one line and requires extra attention. Reading flow: The progression from documentation to failure handler to method overrides is natural, though deleting the helper after assigning its aliases is a less obvious idiom.
Run 3
Code Structure: The class is logically organized, with a descriptive docstring and a centralized error handler, although several imports are unused in this snippet and SecureCookieSession is not defined or imported. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring and explicit error message clearly explain the session's behavior. Code length: The implementation is concise without redundant methods. Action granularity: Most statements perform one action, but the chained assignment binds seven mutation methods at once, reducing readability. Reading flow: The progression from documentation to error handling to method bindings is natural; however, the dense assignment and deletion of _fail require familiarity with Python class construction.