Sample
pyint-b6057b665be9-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable |
| Dorn | 0.873 | 0–1; higher is more readable |
| Mi | 0.43 | 0–1; higher is more readable |
| LLOC | 18 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs |
| BTTF | 0.46 | 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. | 701.154 | −23.138 |
| Source linesThe number of non-empty source lines. | 36 | +14.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.631 | −6.946 |
Intercept 8.87 + feature contributions = -6.814 (log-odds).
Score = sigmoid(-6.814) = 0.001.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 69.838 | +0.707 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.035 | +0.606 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 37 | −0.274 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 62.243 | +0.2 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 25 | +0.128 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 35.845 | +0.091 |
Intercept 0.07 + feature contributions = 1.926 (log-odds).
Score = sigmoid(1.926) = 0.873.
| Score | 0.43 |
|---|
| Score | 18 |
|---|
Run 1
The code is generally organized but has readability issues that prevent a higher score. The class has a clear purpose and the docstring is helpful for understanding behavior. However, several points hurt clarity: the type alias 'c' for collections.abc feels unnecessarily abbreviated, and the parameter 'a' is ambiguous (should be 'initial_data' or similar). The 'te.Self' reference appears undefined in this snippet, creating confusion. The nesting is minimal and flow is straightforward, with one action per line mostly followed. The imports are slightly disorganized with duplicates from collections.abc and some unused imports (datetime, hashlib, serializer). Given these clarity issues, the score lands below 15 despite good structure and low nesting.
Run 2
The code is generally readable with a clear class structure, appropriate type hints, and well-documented behavior via docstrings and comments. The inheritance chain and import patterns are logical. Minor deducts: the single-parameter constructor using a generic Mapping type is fine but the nested `on_update` callback adds slight nesting; import alias `te` is referenced but not imported in the shown snippet, which would break clarity. The variable name `a` for the initial mapping is unnecessarily short and ambiguous. Overall, intent is clear, nesting is minimal, and each action is on its own line.
Run 3
The code is moderately readable but has several issues. It imports collections.abc twice (once as 'c' and once as MutableMapping), creating redundancy. The namespace import 'c' obscures clarity, and MutableMapping is imported but unused. The 'te.Self' reference in the inner function is undefined (likely a typo), breaking the code and obscuring intent. The class and docstring are clear, but the `__init__` method uses a nested function solely to set a boolean flag, which adds unnecessary nesting and hampers reading flow. The parameter 'a' is poorly named; 'initial' or 'data' would be more descriptive. Type hints are used but inconsistently (e.g., missing return annotation on the nested function). The docstring is informative, yet the code could be simplified by using a lambda or a method. Overall, the structure is logical but impeded by minor errors, redundant imports, and unclear naming, making it only somewhat readable.
Run 1
Code Structure: Imports, class documentation, state, and initialization are logically organized, although several imports are unused and SessionMixin and te are undefined in the snippet. Nesting: Only a small callback is nested inside the constructor, keeping complexity low. Clarity of intent: The class name, docstring, and detailed comment explain signed-cookie sessions and modification tracking well, but the parameter name 'a' is vague, and documentation mentions accessed without showing its implementation. Code length: The implementation is concise, though the import list and multiline constructor signature add unnecessary visual overhead for this small excerpt. Action granularity: Each statement performs one clear action. Reading flow: The progression from documentation to state initialization to callback registration is natural, but unresolved names and abbreviated aliases interrupt comprehension.
Run 2
Code Structure: Imports, class documentation, state, and initialization are logically organized. Nesting: Only one small nested callback, keeping complexity low. Clarity of intent: The class and comments clearly describe signed-cookie session behavior and modification tracking, but the parameter name 'a' is vague, and SessionMixin and te.Self are undefined in the provided snippet. The documentation also mentions accessed without showing its implementation. Code length: The implementation is concise, though documentation is relatively lengthy and several imports are unused here. Action granularity: Each statement performs a single clear action. Reading flow: The progression from class purpose to state and initialization is natural, although missing definitions and abbreviated aliases interrupt comprehension.
Run 3
Code Structure: Imports, class documentation, state, and initialization are logically organized, although several imports are unused in this snippet. Nesting: Shallow; the nested callback is small and appropriate. Clarity of intent: Documentation clearly explains cookie-session behavior and modification tracking, but the parameter name 'a' is vague, and SessionMixin and te.Self are not defined or imported in the shown code. Code length: The implementation is concise, though the lengthy documentation and multiline signature outweigh the small amount of executable code. Action granularity: Each executable line performs one clear action. Reading flow: The progression from class purpose to state initialization and update handling is natural; unexplained type references and terse aliases cause minor interruptions.