Sample
pyint-82d5e16c6695-SRC
Unmodified source class
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 | 16.33 | 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 highly readable with clear structure and intent. It defines a SessionMixin class extending MutableMapping, with well-documented attributes using docstrings and comments. Each property method is concise and serves a single purpose, maintaining flat nesting and natural reading flow. Type hints improve clarity. The only minor drawbacks are slightly verbose imports (some unused or redundant) and a class-level attribute 'accessed' placed after its docstring, which slightly disrupts logical grouping. Overall, the code is well-organized, maintainable, and easy to understand.
Run 2
The code is highly readable with clear structure and purpose. It defines a SessionMixin class with well-documented properties and attributes. Each method has a single responsibility, with clean type hints and minimal nesting. The use of property decorators for 'permanent' is logical and maintains good action granularity. Docstrings and comments provide context without being excessive. Minor deductions: some attributes are declared inline (new, modified, accessed), which slightly interrupts the flow, and the 'accessed' attribute has its docstring after it rather than before, breaking consistency. Import aliasing (collections.abc as c, typing as t) is standard but adds slight cognitive overhead. Overall, the code follows Python best practices, maintains flat structure, and clearly communicates intent through naming and documentation.
Run 3
The code demonstrates good organization with clear class structure and docstrings that explain intent, making it relatively readable. However, several issues prevent a higher score: unnecessary and inconsistent imports create confusion (mixing 'collections.abc as c' with 'from collections.abc import MutableMapping', alongside unused imports). The class attributes are interspersed between methods, disrupting natural reading flow. Multiple actions occur in the property getter at the type-ignore comment line, though this is minor. The docstring placement after 'accessed = False' is unconventional as it appears to document the attribute below it but is positioned after the assignment. While the structure is logical and nesting is flat, the import redundancy and attribute placement reduce clarity and create a slightly disorganized feel relative to what could be cleaner with better consolidation and alignment.
Run 1
Code Structure: Imports and a single focused mixin are logically organized, although imports could be grouped more clearly. Nesting: Minimal nesting makes the property getter and setter easy to follow. Clarity of intent: Descriptive names, type annotations, and documentation clearly explain session attributes; abbreviated import aliases slightly reduce clarity. Code length: Implementation is concise, though documentation occupies most of the snippet and some imports are unused here. Action granularity: Each statement performs one clear action, with no compressed multi-action lines. Reading flow: The progression from the permanent property to session-state attributes is natural. Mixed documentation styles and the intervening version note add minor visual overhead.
Run 2
Code Structure: Imports and a single focused mixin provide logical organization, although import grouping could be cleaner. Nesting: Minimal nesting makes the property getter and setter easy to follow. Clarity of intent: Descriptive names, type annotations, and documentation clearly explain session behavior; abbreviated import aliases are slightly less intuitive. Code length: The implementation is concise, though documentation and imports occupy much of this excerpt. Action granularity: Each executable line performs one clear action. Reading flow: The progression from the class description to the permanent property and session flags is natural. Mixed documentation styles for attributes slightly reduce consistency.
Run 3
Code Structure: Imports and a single focused mixin are logically organized, though 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 and defaults; abbreviated import aliases are slightly less intuitive. Code length: The implementation is concise, although documentation occupies substantially more space than executable code. Action granularity: Each executable line performs one clear action. Reading flow: The class progresses naturally from the permanent property to session state flags, but inconsistent documentation styles and the version-change note slightly interrupt the flow.