Sample
pyint-e2087edf19dd-I10
Deterministically remove some optional blank lines and bracketed line breaks
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.009 | 0–1; higher is more readable |
| Dorn | 0.85 | 0–1; higher is more readable |
| Mi | 0.577 | 0–1; higher is more readable |
| LLOC | 22 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17.67 | 0–20; mean of three runs |
| BTTF | 0.739 | 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. | 41 | +16.4 |
| 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.652 | −6.978 |
Intercept 8.87 + feature contributions = -4.705 (log-odds).
Score = sigmoid(-4.705) = 0.009.
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. | 42 | −0.451 |
| 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. | 71.714 | +0.353 |
| 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. | 79 | +0.319 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 27 | +0.197 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 40.875 | +0.162 |
Intercept 0.07 + feature contributions = 1.738 (log-odds).
Score = sigmoid(1.738) = 0.85.
| Score | 0.577 |
|---|
| Score | 22 |
|---|
Run 1
The code is well-structured and highly readable. It uses clear imports, type hints, and a logical class hierarchy with SessionMixin extending MutableMapping. The property methods for 'permanent' are concise with clear intent, and class-level attributes are well-documented with explanatory comments. Nesting is minimal and the reading flow is natural, following a standard Python layout. The code slightly loses points for a few minor issues: the import 'c' is aliased but unused, 'CallbackDict' and 'TaggedJSONSerializer' are imported but not referenced in this snippet, and some comments like '#: Some implementations...' are somewhat vague. Overall, the code demonstrates strong organization, appropriate granularity, and clear separation of concerns.
Run 2
The code is highly readable with clear structure and purpose. It defines a SessionMixin class that extends MutableMapping, with well-documented properties and attributes. The nesting is minimal (only one level in property methods), and each action is on its own line with appropriate spacing. Imports are organized, though some are unused (datetime, timezone, hashlib, itsdangerous imports) which slightly detracts. The docstrings are informative but could be more concise. Type hints improve clarity. The class-level attributes (new, modified, accessed) are well-placemented with explanatory comments. Overall structure is logical, progressing from imports through class definition to properties. Minor improvements could include removing unused imports and tightening some docstring verbosity, but the code maintains high readability standards with clear intent and natural flow.
Run 3
The code is logically organized with clear class structure and imports, but readability is hindered by several factors. Imports use cryptic aliases ('c', 't') and include unused modules (hashlib, datetime, itsdangerous), suggesting potential placeholder or incomplete code. The class methods are concise and well-documented, with clear property/setter logic, but the action granularity is mixed—some lines bundle multiple operations (imports on separate lines vs combined aliased imports). The attribute declarations ('new', 'modified', 'accessed') are flat and readable, though the trailing docstring placement after 'accessed' breaks natural flow. The session permanence property has clear intent, but the type ignore comment adds minor noise. Overall, readable for experienced Python developers but less friendly to newcomers due to abbreviated imports and unused dependencies.
Run 1
Code Structure: Imports precede a focused mixin class, and session attributes are logically grouped; blank lines between imports and the class would improve separation. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive names, type annotations, and documentation clearly explain session behavior, although abbreviated import aliases and framework-specific references require some familiarity. Code length: The implementation is concise; comments are proportionate to the behavior being documented, though several imports are unused in this excerpt. Action granularity: Each executable line performs a single clear action. Reading flow: The getter and setter appear together, followed by related state flags, creating a natural progression. Inconsistent documentation styles and dense spacing near the imports slightly reduce readability.
Run 2
Code Structure: The mixin logically groups a session property and related state flags, although imports lack grouping and separation from the class. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive names, type annotations, and documentation clearly explain session behavior; abbreviated import aliases and mixed documentation styles slightly reduce clarity. Code length: The implementation is concise, though several imports are unused in this excerpt and comments occupy more space than executable code. Action granularity: Each executable line performs one clear action. Reading flow: The property getter and setter appear together, followed by related flags, providing a natural progression. Missing blank lines around top-level sections and inconsistent comment formatting modestly interrupt that flow.
Run 3
Code Structure: Imports and a single focused mixin are logically organized, although blank lines between import groups and before the class would improve separation. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: Descriptive names, type annotations, and documentation clearly explain session attributes and the permanent property; abbreviated import aliases are less expressive. Code length: The implementation is concise, with documentation adding useful context rather than unnecessary complexity. Action granularity: Each executable line performs one clear operation. Reading flow: The property getter, setter, and default attributes follow a natural sequence, though mixed documentation styles and tightly packed imports slightly interrupt consistency.