Sample
pyint-9c0f56278a7f-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.018 | 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 | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.708 | 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. | 699.947 | −23.098 |
| 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.659 | −6.988 |
Intercept 8.87 + feature contributions = -4.016 (log-odds).
Score = sigmoid(-4.016) = 0.018.
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 demonstrates good structure with clear class definition and logical organization. The property decorator and type hints improve clarity. However, there's a significant naming issue: 'buildMode' appears to be a misspelling or unclear name for what is clearly 'permanent' session behavior, which obscures intent. The mixin's purpose is clear but the property implementation is verbose for a simple getter/setter pattern. Type hints and docstrings are helpful, but some documentation comments are lengthy and interrupt reading flow. Nesting is minimal (flat structure), which is positive. Action granularity is appropriate with one concept per line. The code is relatively concise overall. The main readability issue is the confusing 'buildMode' naming which doesn't clearly map to its actual purpose of handling the '_permanent' key.
Run 2
The code demonstrates clear structure with logical grouping of properties and attributes. The nesting is minimal and flat, with no deeply nested logic. Intent is generally clear, though there is a notable naming inconsistency: the property is named 'buildMode' but the docstring references '_permanent', and the setter parameter 'event' is ambiguous for a boolean permanent flag. The code is concise and each line performs a single action. Reading flow is natural, but the class name 'SessionMixin' uses a mixin pattern while importing 'MutableMapping' - the relationship between the naming and the actual session semantics could be more explicit. The docstrings are informative but slightly contradictory with the actual attribute names, which slightly obscures clarity of intent. Type hints are appropriately used. The import section is somewhat lengthy for what is actually used in this snippet.
Run 3
The code demonstrates strong readability with clear structure, minimal nesting, and well-defined intent. The SessionMixin class follows a logical organization with properties, attributes, and documentation clearly separated. The buildMode property has a clear getter/setter pattern, though the method name could better reflect its '_permanent' purpose. Action granularity is appropriate—each line serves a distinct purpose. Type hints and imports are well-organized. Some minor deductions: the 'buildMode' naming is misleading compared to the actual '_permanent' key it manages, and several docstrings are verbose for what are simple class attributes. The 'accessed' documentation block interrupts the flow between related attributes. Overall, the code is comprehensible and maintainable but could be slightly improved with more intuitive naming conventions.
Run 1
Code Structure: Imports and a focused session mixin are logically organized, though several imports are unused in this snippet. Nesting: Very shallow, with straightforward property methods. Clarity of intent: Documentation explains the session attributes, but 'buildMode' and 'event' are misleading names for permanence. The '@permanent.setter' decorator references an undefined property rather than 'buildMode', creating a major inconsistency that interrupts understanding. Code length: Implementation is concise, although documentation occupies much of the snippet. Action granularity: Each executable line performs a single clear action. Reading flow: Generally natural from imports to class members, but inconsistent property naming and mixed comment/docstring styles reduce coherence.
Run 2
Code structure is logical: imports precede a focused mixin, with related session attributes grouped together. Nesting is shallow and easy to follow. Clarity of intent is weakened by the misleading name buildMode for a permanence flag, the vague setter parameter event, and @permanent.setter referencing an undefined name rather than buildMode; this also prevents the class from being defined as shown. Code length is reasonable, although extensive documentation and unused imports add overhead relative to the small implementation. Action granularity is good, with one operation per line. Reading flow is mostly natural, but inconsistent comment styles, documentation placement, and the mismatched setter interrupt comprehension.
Run 3
Code Structure: The mixin logically groups a session property and state attributes, though numerous unused imports clutter this excerpt. Nesting: Flat class structure and short methods make it easy to scan. Clarity of intent: Session-related documentation helps, but buildMode and event are misleading names for permanence settings. The @permanent.setter decorator refers to an undefined property instead of buildMode, creating a confusing inconsistency. Code length: Implementation is concise, although imports and extensive documentation outweigh the executable code. Action granularity: Each executable line performs one clear action. Reading flow: The progression from property methods to state flags is natural, but inconsistent comment styles, a detached accessed docstring, and mismatched naming interrupt comprehension.