Sample

pyint-96153ce2cfd6-I03

Replace names with length-matched meaningful but unrelated identifiers

Matched original source

Lines24

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7590–1; higher is more readable
Mi0.6810–1; higher is more readable
LLOC20Logical lines; fewer is more readable
DeepSeek V4 Pro11.330–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.1890–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 TagBytes(JSONTag): __slots__ = () key = " b" def reset(self, limit: t.Any) -> bool: return isinstance(limit, bytes) def prepare(self, price: t.Any) -> t.Any: return b64encode(price).decode("ascii") def loadToken(self, index: t.Any) -> t.Any: return b64decode(index)

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.750.633−24.771
Source linesThe number of non-empty source lines.24+9.6
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.716−7.074

Intercept 8.87 + feature contributions = -13.375 (log-odds).
Score = sigmoid(-13.375) = 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.46.92+1.678
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.08+0.165
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.25+0.151
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.24−0.13
Indentation frequencyHow rapidly indentation changes from line to line.24+0.093
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.23.708−0.078

Intercept 0.07 + feature contributions = 1.145 (log-odds).
Score = sigmoid(1.145) = 0.759.

Score0.681
Score20
Run 1

The code suffers from major clarity issues. The class name 'TagBytes' is reasonably descriptive, but the method names and parameters are confusing: 'prepare' receives 'price' (likely a bytes value), 'loadToken' receives 'index' (likely a base64 string), and 'reset' receives 'limit' (likely a type check target). These misleading names make the intent ambiguous. The class inherits from 'JSONTag' but no such import is present, indicating missing context. The structure is flat and short, which would ordinarily aid readability, but the lack of docstrings or type hints on parameters beyond generic 't.Any' obscures the data flow. Import organization is logical, though the class definition lacks surrounding context for the serializer format. Overall, the code is syntactically clean but semantically opaque due to poor naming and missing documentation.

Run 2

The code is generally readable with flat structure and clear intent, but suffers from unnecessary length and poor semantic naming. The class has a logical single responsibility, and methods are concise, one action per line. However, the parameter names 'limit', 'price', and 'index' are confusing and do not convey purpose; 'value' or 'token' would be clearer. The 'reset' method name is ambiguous—it checks type, not state. Imports are slightly verbose but acceptable. No deep nesting is present. The lack of docstrings or type specificity beyond 't.Any' reduces clarity. Overall it is easily parsed but lacks the clarity and intent that would make it highly readable.

Run 3

The code shows a basic class structure with clear method separation, but has several readability issues. The naming is inconsistent and confusing: 'TagBytes' suggests a tag for bytes but methods use misleading parameter names like 'limit' and 'price' that don't reflect their purpose (checking bytes type, encoding data). 'loadToken' has a vague name that doesn't clearly indicate it decodes base64. The 'reset' method returning a boolean for type checking is unintuitive. Imports are clean and follow logical grouping. The class has minimal nesting, which is good. However, the overall clarity of intent is obscured by poor naming conventions. The code is concise but at the cost of clarity—method names and parameters don't communicate their actual behavior, requiring readers to infer intent from implementation details rather than documentation or self-explanatory identifiers.

Run 1

Code Structure: Imports and a small class are logically organized, though several imports are unused in this snippet and JSONTag is not defined or imported. Nesting: Minimal nesting makes the methods easy to scan. Clarity of intent: TagBytes and the base64 operations suggest byte serialization, but reset, prepare, and loadToken use inconsistent naming, and parameters such as limit, price, and index obscure their roles. The key value is unexplained, and broad Any annotations offer little guidance. Code length: Compact, with no unnecessarily long methods. Action granularity: Each line performs a focused operation; the encode-and-decode chain is straightforward. Reading flow: The progression from type checking to encoding and decoding is natural, but clearer names and more consistent spacing around imports and the class would improve readability.

Run 2

Code Structure: Imports and a compact class are logically organized, although several imports are unused and JSONTag is not defined in the snippet. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Base64 encoding and decoding are recognizable, but reset, prepare, and loadToken do not consistently describe their operations; parameters such as limit, price, and index obscure that they represent byte or encoded values. The key " b" is unexplained, and broad Any annotations provide little guidance. Code length: The implementation is concise, though unused imports add clutter. Action granularity: Each method contains a single return statement; the encoding-and-decoding chain is short and understandable. Reading flow: The progression from type checking to serialization and deserialization is natural, but inconsistent naming and limited spacing between imports and the class reduce polish.

Run 3

Code Structure: The class logically groups byte recognition, encoding, and decoding, but several unused imports add clutter, and JSONTag is not defined or imported in the snippet. Nesting: Methods are flat, with no nested control flow. Clarity of intent: TagBytes and the Base64 operations suggest byte serialization, but reset, prepare, loadToken, and parameters limit, price, and index poorly describe their roles. The key " b" is unexplained, and broad Any annotations provide little guidance. Code length: The implementation is concise, though unnecessary imports lengthen it. Action granularity: Each method contains one straightforward return statement; the encoding chain remains easy to follow. Reading flow: Recognition, encoding, and decoding appear in a natural sequence, but inconsistent method naming and unrelated imports interrupt readability.