Sample
pyint-45d9db423421-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.02 | 0–1; higher is more readable |
| Dorn | 0.858 | 0–1; higher is more readable |
| Mi | 0.584 | 0–1; higher is more readable |
| LLOC | 22 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.747 | 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. | 696.883 | −22.997 |
| Source linesThe number of non-empty source lines. | 43 | +17.2 |
| 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.653 | −6.979 |
Intercept 8.87 + feature contributions = -3.906 (log-odds).
Score = sigmoid(-3.906) = 0.02.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.026 | +0.69 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 44 | −0.522 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 73.795 | +0.386 |
| 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. | 78.909 | +0.323 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 29 | +0.266 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 42.875 | +0.189 |
Intercept 0.07 + feature contributions = 1.801 (log-odds).
Score = sigmoid(1.801) = 0.858.
| Score | 0.584 |
|---|
| Score | 22 |
|---|
Run 1
The code is well-structured with clear class definition and logical grouping of properties and attributes. Nesting is minimal—only one class and no deep indentation. The intent is clear: extending a dictionary with session-specific behavior. Code length is concise; each property is short and focused. Action granularity is appropriate, with one logical action per line. Reading flow is natural, moving from imports to class definition to documented attributes. Type hints and docstrings improve understandability. Minor deductions include a couple of slightly long lines and mixed import styles, but overall readability is strong.
Run 2
The code is highly readable with clear structure and intent. The SessionMixin class logically groups session-related attributes and methods. Nesting is minimal—just one class and property methods, keeping the code flat. Each property has a concise, explicit purpose, with docstrings explaining non-obvious behavior like the '_permanent' key. Code length is appropriate; no unnecessary repetition or verbosity. Action granularity is balanced—each line performs a single clear action, such as returning the default or assigning a cast value. Reading flow is natural: imports are organized, then the mixin class, then properties, then documented attributes. Minor issues include slightly inconsistent import style (mixed `typing as t` with direct `MutableMapping` import), and the `# type: ignore` comment slightly interrupts flow. Overall, the code is maintainable and self-documenting with only trivial improvements possible.
Run 3
The code demonstrates excellent readability with clear structure, minimal nesting, and strong intent clarity. It uses modern Python typing syntax and follows a logical class organization. Each method has a focused purpose and the property decorator pattern is clean. The code is concise, avoiding unnecessary verbosity while maintaining proper documentation through docstrings and comments. Action granularity is appropriate—each line performs a single clear operation. The reading flow is natural, starting with imports, then class definition, followed by well-ordered properties and attributes. Minor points could be noted: the inline type ignore comment slightly interrupts flow, and the multiple class attribute assignments with comments could potentially be grouped differently. However, these are trivial and the overall readability remains very high by Python standards.
Run 1
Code Structure: Imports and the session mixin are logically organized, though import grouping could be clearer. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive names, type annotations, and documentation clearly explain session attributes and the permanent property. Code length: The implementation is concise; documentation is somewhat lengthy relative to the executable code but provides useful context. Action granularity: Each statement performs a single action, with no compressed multi-action lines. Reading flow: The property getter and setter are adjacent, followed by related session flags. Flow is slightly interrupted by mixed documentation styles, framework-specific markup, and abbreviated import aliases.
Run 2
Code Structure: Imports and session behavior are logically organized in a focused mixin, although import grouping could be clearer. Nesting: Very shallow, with straightforward property methods and class attributes. Clarity of intent: Descriptive names, type annotations, and documentation make the session flags and permanent setting clear; abbreviated import aliases slightly reduce immediate clarity. Code length: Concise implementation with proportionate documentation, though several imports are unused in the shown snippet. Action granularity: Each executable line performs a single clear action. Reading flow: Natural progression from imports to the class, property accessors, and session flags; inconsistent documentation styles between attributes slightly interrupt the flow.
Run 3
Code Structure: Imports and session behavior are logically organized in a focused mixin, although several imports are unused in this excerpt. Nesting: Minimal nesting makes the property methods easy to follow. Clarity of intent: Descriptive names, type annotations, and documentation clearly explain session attributes; abbreviated import aliases are slightly less explicit. Code length: The implementation is concise, though documentation occupies substantially more space than executable code. Action granularity: Each executable line performs a single clear action. Reading flow: The getter, setter, and default attributes follow a natural sequence. Mixed documentation styles and embedded version metadata slightly interrupt an otherwise smooth reading experience.