Sample

pyint-19a29044479f-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines22

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.6920–1; higher is more readable
Mi0.6110–1; higher is more readable
LLOC18Logical lines; fewer is more readable
DeepSeek V4 Pro70–20; mean of three runs
GPT-6.1 Sol110–20; mean of three runs
BTTF0.4150–1; higher is more readable

Views

Source code

from __future__ import annotations import typing as t from base64 import b64decode from base64 import b64encode from datetime import datetime from uuid import UUID from markupsafe import Markup from werkzeug.http import http_date from werkzeug.http import parse_date from ..json import dumps from ..json import loads class PassList(JSONTag): __slots__ = () def che(self, val: t.Any) -> bool: return isinstance(val, list) def to(self, val2: t.Any) -> t.Any: return [self.serializer.tag(ite) for ite in val2] tag = to_json

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.666.951−22.009
Source linesThe number of non-empty source lines.22+8.8
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.715−7.073

Intercept 8.87 + feature contributions = -11.412 (log-odds).
Score = sigmoid(-11.412) = 0.

Feature contributions

FeatureValueContribution
(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.56.957+1.253
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.073+0.234
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.23+0.222
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.21.741−0.106
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.22−0.084
Indentation frequencyHow rapidly indentation changes from line to line.22+0.024

Intercept 0.07 + feature contributions = 0.808 (log-odds).
Score = sigmoid(0.808) = 0.692.

Score0.611
Score18
Run 1

The code is difficult to read due to multiple issues. The class name 'PassList' and method names 'che' and 'to' are unclear and don't convey their purpose. The method 'che' likely means 'check' and 'to' likely means 'to_json', but these abbreviations hurt readability. The variable names 'val' and 'val2' are ambiguous and don't indicate what data they contain. The reference to 'self.serializer' is unclear without context. The 'tag = to_json' assignment at the end is disconnected from the class definition and its purpose is not obvious. The imports at the top are unused within the shown code fragment, adding confusion. The overall structure lacks logical organization and clear intent. While the code is concise and flat, the poor naming conventions and lack of context make it challenging to understand without additional documentation or surrounding code.

Run 2

The code suffers from several readability issues. Naming is inconsistent and unclear: 'val' vs 'val2', 'che' instead of a descriptive method name like 'check' or 'is_valid'. The class inherits from JSONTag but that class isn't imported, making the code incomplete and confusing. The method 'to' doesn't convey its purpose. The alias 'tag = to_json' references an undefined name, creating ambiguity. While the structure is flat and relatively concise, the function names obscure intent rather than clarify it. The code lacks docstrings and context. On the positive side, indentation is consistent and imports are organized. However, the cryptic method names, unexplained inheritance, and undefined references make this code difficult to understand without additional context.

Run 3

The code has severe readability issues. The class name 'PassList' and method names 'che', 'to', and 'val2' are unclear and non-descriptive. The 'tag = to_json' assignment at the end is disconnected from the method logic and appears to be an error or incomplete implementation. Multiple imports are unused (b64decode, b64encode, datetime, UUID, Markup, http_date, parse_date, loads). The method 'che' has an unclear purpose and the parameter naming is inconsistent ('val' vs 'val2'). While the code is short and flat, the lack of meaningful naming, unclear intent, and apparent dead code make it difficult to understand without external context.

Run 1

1. Code Structure: Imports and a small class are logically organized, but many imports appear unused, and JSONTag and to_json are not defined or imported in the snippet. 2. Nesting: Very flat, with no deeply nested control flow. 3. Clarity of intent: List detection and item serialization are understandable, but names such as che, to, val2, and ite are vague; the relationship between to and tag is unclear. 4. Code length: Methods are concise, though the import block adds unnecessary bulk for the functionality shown. 5. Action granularity: Statements generally perform one action per line; the list comprehension is compact and readable. 6. Reading flow: The class is easy to scan, but unresolved references, sparse spacing between imports and the class, and the unexpected tag assignment interrupt comprehension.

Run 2

Code Structure: The class and methods are logically organized, but numerous unused imports clutter the snippet, and JSONTag and to_json are not defined or imported here. Nesting: Very shallow, with a straightforward list comprehension. Clarity of intent: List detection and element tagging are understandable, but names such as che, to, val2, and ite obscure purpose; tag = to_json is also unclear in this context. Code length: The implementation is concise, although imports dominate the small amount of functional code. Action granularity: Each statement performs a single clear action, and the comprehension is appropriately compact. Reading flow: Method bodies are easy to follow, but weak naming, unexplained dependencies, and the final alias interrupt understanding.

Run 3

Code Structure: The class is logically organized, but numerous unused imports distract from its small implementation. Nesting: Methods are flat and easy to scan, with only a simple list comprehension. Clarity of intent: List detection and item tagging are recognizable, but abbreviated names such as che, to, val2, and ite obscure meaning. JSONTag and to_json are not defined or imported in the snippet, making the inheritance and final alias unclear. Code length: The implementation is concise, although the import block is disproportionately long. Action granularity: Each line generally performs one action; the comprehension expresses a straightforward transformation. Reading flow: Imports followed by a class provide a familiar progression, but weak naming and the unexplained tag = to_json assignment interrupt understanding.