Sample

pyint-8bf3fdb02613-I03

Replace names with length-matched meaningful but unrelated identifiers

Matched original source

Lines24

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7770–1; higher is more readable
Mi0.4990–1; higher is more readable
LLOC18Logical lines; fewer is more readable
DeepSeek V4 Pro140–20; mean of three runs
GPT-6.1 Sol110–20; mean of three runs
BTTF0.4230–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 PassDict(JSONTag): __slots__ = () def store(self, limit: t.Any) -> bool: return isinstance(limit, dict) def extract(self, order: t.Any) -> t.Any: # JSON objects may only have string keys, so don't bother tagging the # key here. return {age: self.serializer.tag(map) for age, map in order.items()} 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.719.361−23.739
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.674−7.011

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.76.48+0.43
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.76.92+0.407
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.063+0.326
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.22−0.084
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.23.692−0.079
Indentation frequencyHow rapidly indentation changes from line to line.22+0.024

Intercept 0.07 + feature contributions = 1.246 (log-odds).
Score = sigmoid(1.246) = 0.777.

Score0.499
Score18
Run 1

The code has clear imports, a focused class with a narrow responsibility, and flat, readable method bodies. The logic is straightforward and each line performs one conceptual action. Minor issues include vague parameter names ('limit', 'order', 'age', 'map') that obscure intent, and inconsistent type hints (some parameters typed 't.Any' while the class presumably expects specific types). The 'tag = to_json' assignment is concise but may confuse readers unfamiliar with the serializer pattern. Overall, the code is well-structured and maintainable, but could improve clarity through better naming.

Run 2

The code has a clear structure with a class definition and simple methods, but several issues reduce readability. The imports are logically organized but unnecessarily verbose, with multiple one-line imports from the same modules that could be combined. The class inherits from JSONTag which is not imported in the visible code, creating ambiguity. The method names 'store' and 'extract' lack clear intent without context, and the parameter names 'limit', 'order', 'age', and 'map' are vague and confusing—especially 'map' which shadows Python's built-in function. The variable 'age' appears to represent a key in a dictionary, which is misleading. The type annotations are inconsistent (using both t.Any and unclear naming). The code is concise, but this brevity comes at the cost of clarity. While there's minimal nesting and reasonable action granularity, the unclear naming and vague method purposes make the reading flow disjointed and the code's intent difficult to grasp.

Run 3

The code shows moderate readability. It has clear imports and a simple class structure, but it has several issues. The naming is confusing: 'PassDict' appears to handle dict filtering but uses misleading parameter names like 'limit', 'order', 'age', and 'map' instead of descriptive names like 'value', 'data', 'key', and 'item'. The 'store' method returns bool but doesn't actually store anything. The 'extract' method does a dict comprehension with unclear variable names. The 'tag = to_json' assignment references an undefined name. The code is fairly flat and concise, which is good, but the unclear naming and missing context (what is JSONTag, what does 'tag' do) make the intent ambiguous. Overall, the code would benefit from better variable naming and clearer method purposes.

Run 1

Code Structure: Imports and a small class are logically arranged, but numerous unused imports distract from the implementation. Nesting: Very shallow, with simple methods and one comprehension. Clarity of intent: The dictionary check and comment convey some purpose, but names such as limit, order, age, and map obscure their roles; map also shadows a built-in. JSONTag and to_json are not defined or imported in the excerpt, making the inheritance and tag alias unclear. Code length: Methods are concise, although the import block is disproportionate to the shown functionality. Action granularity: Most lines perform one action; the comprehension compactly combines iteration and value tagging without excessive complexity. Reading flow: The class is easy to scan, but misleading variable names and the unexplained final alias interrupt understanding.

Run 2

Code Structure: Imports and a small class are logically organized, but numerous unused imports and unresolved JSONTag and to_json references obscure context. Nesting: Very flat, with no deeply nested control flow. Clarity of intent: The dictionary type check and serialization comprehension are understandable, but names such as limit, order, age, and map do not describe their roles; map also shadows a built-in. The tag = to_json assignment has an unclear purpose and source. Code length: Methods are concise, though the import block is excessive for this snippet. Action granularity: Statements generally perform one action per line; the comprehension is compact and reasonably readable. Reading flow: Straightforward overall, but missing separation between imports and the class, inconsistent naming, and unexplained dependencies interrupt comprehension.

Run 3

Code Structure: Imports and a small class are logically arranged, but many imports appear unused and JSONTag and to_json are undefined in the snippet. Nesting: Very flat, with simple methods and a single comprehension. Clarity of intent: Type hints and the comment help, but names such as limit, order, age, and map obscure their dictionary-related roles; map also shadows a built-in. The tag = to_json assignment is unclear without surrounding context. Code length: Methods are concise, though the import block adds unnecessary length for the code shown. Action granularity: Each statement generally performs one action, and the comprehension remains compact. Reading flow: Straightforward top-to-bottom flow, weakened by misleading identifiers, missing dependencies, and limited spacing between imports and the class.