Sample
pyint-512cc0777c37-SRC
Unmodified source class
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 | 14.33 | 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 due to its concise structure and clear intent. The class is small, focused, and logically organized, with a single-purpose method `_fail` that explains the error scenario. Nesting is essentially flat, and the use of type hints improves clarity. The final line assigning multiple methods to `_fail` is compact but still understandable, though it slightly reduces readability by combining several assignments in one line. Overall, the code maintains a clean action granularity and a natural reading flow, with no unnecessary length or complexity.
Run 2
The code is generally readable and well-documented, with clear intent via the NullSession class and docstring. However, it imports several modules that are unused (collections.abc, hashlib, datetime, itsdangerous, TaggedJSONSerializer), which adds noise and ambiguity. The class definition is concise, and the action granularity is acceptable—the final assignment line is the main exception, packing many operations into a single line, reducing clarity. Reading flow is moderate: while the docstring is helpful, the dense assignment and unused imports break the natural flow. Structure is logical but could benefit from cleanup.
Run 3
The code is generally clear with a straightforward class definition and a concise docstring explaining its purpose. However, it relies on an undefined base class `SecureCookieSession`, which hurts clarity. The `__setitem__` assignment line chains multiple method assignments in one statement, violating action granularity and reducing readability. The use of `t.Any` and `t.NoReturn` is reasonable, but the import of `CallbackDict`, `TaggedJSONSerializer`, etc. is unused, adding clutter. Nesting is flat and structure is logical, but the code would benefit from splitting the method assignment line and removing unused imports.
Run 1
Code Structure: The class is logically organized around a single failure handler, although several imports are unused and the base class is not defined or imported in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring and descriptive error message clearly explain read-only session behavior and why mutations fail. Code length: The implementation is concise, but the unused imports add clutter. Action granularity: Most lines perform one action; the chained assignment binds seven methods at once, sacrificing some readability for brevity. 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 mechanics.
Run 2
Code Structure: The class is logically organized around a single error-raising helper, though numerous unused imports and the undefined-in-snippet base class add distracting context. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The descriptive class name, docstring, and explicit error message clearly explain the behavior; however, mapping mutation methods to one helper requires familiarity with Python's special methods. Code length: The implementation is concise, but imports outweigh the functional code. Action granularity: Most lines express one action, while the chained assignment binds seven methods at once and is relatively dense. Reading flow: The progression from documentation to helper to method bindings is natural, although the long assignment and deletion of the helper slightly interrupt readability.
Run 3
Code Structure: The class is logically organized around a single failure handler, though numerous unused imports and the absent SecureCookieSession definition add distracting context gaps. 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, but the import block is disproportionately long for this snippet. Action granularity: Most lines perform one action; the chained assignment aliases seven methods at once, reducing immediate readability. Reading flow: The progression from documentation to error handler to method overrides is natural, although the compact aliasing and deletion of _fail require familiarity with Python class mechanics.