Sample

pyint-50ee54b31db6-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines24

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.8110–1; higher is more readable
Mi0.6920–1; higher is more readable
LLOC20Logical lines; fewer is more readable
DeepSeek V4 Pro50–20; mean of three runs
GPT-6.1 Sol13.330–20; mean of three runs
BTTF0.1360–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 TagDateTime(JSONTag): __slots__ = () key = " d" def che(self, val: t.Any) -> bool: return isinstance(val, datetime) def to(self, val2: t.Any) -> t.Any: return http_date(val2) def to2(self, val3: t.Any) -> t.Any: return parse_date(val3)

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.710.987−23.463
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.727−7.091

Intercept 8.87 + feature contributions = -12.083 (log-odds).
Score = sigmoid(-12.083) = 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.39.84+1.978
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.079+0.175
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.634−0.079

Intercept 0.07 + feature contributions = 1.454 (log-odds).
Score = sigmoid(1.454) = 0.811.

Score0.692
Score20
Run 1

The code has some positive aspects — imports are organized, type hints are used, and the class structure is logical. However, several serious readability issues lower the score. The method names 'che', 'to', and 'to2' are unclear and do not convey intent. Parameter names 'val', 'val2', and 'val3' are ambiguous and don't describe the values they represent. The class appears to extend 'JSONTag', but that base class is never imported, suggesting missing context. The 'to2' method returns the result of a parse function without clarity on the transformation purpose. The action granularity is acceptable, with one operation per method, but the code length is artificially short due to abbreviated names. Nesting is flat, which is positive. The reading flow is natural in terms of import-to-class-to-method order, but the unclear naming breaks the flow by forcing the reader to guess what each method actually does. Overall, the code needs more descriptive naming and clearer intent to be considered readable.

Run 2

This code suffers from severe readability problems. The structure is incomplete and fragmented—method names are cryptic ('che', 'to', 'to2') and parameters are inconsistently numbered ('val', 'val2', 'val3'), making intent nearly impossible to discern without external context. The class references an undefined 'JSONTag' base class, breaking logical organization. While nesting is flat and line length is reasonable, the action granularity is acceptable but meaningless given the ambiguous naming. Critical semantic issues exist: 'to' serializes a datetime to HTTP date format, while 'to2' actually deserializes (parse_date), yet both names suggest forward conversion—this inversion is highly misleading. The imports are cleanly grouped but many appear unused (UUID, b64decode/encode, Markup, dumps, loads), adding noise. The key attribute ' d' with a leading space is suspicious and unexplained. Overall, the code lacks the naming clarity, consistent conventions, and self-documenting quality needed for maintainable code.

Run 3

The code is largely unreadable due to multiple issues. The class 'TagDateTime' lacks a clear purpose, and method names like 'che', 'to', and 'to2' are extremely ambiguous and give no indication of their function. The method parameters ('val', 'val2', 'val3') are equally opaque. The class inherits from 'JSONTag' which is never imported or defined in the visible code, creating confusion about its behavior. There are unused imports (b64decode, b64encode, UUID, Markup, dumps, loads) that clutter the file. While the code structure is flat and each line performs a single action, the logical organization is poor: the methods appear randomly ordered with no coherent flow. The lack of docstrings or comments compounds the problem. The only redeeming quality is the minimal nesting and concise line length, but this does not compensate for the severe clarity issues that make the code's intent nearly impossible to discern without external context.

Run 1

Code Structure: Imports and a small class are logically organized, but several imports are unused and JSONTag is not defined or imported in the snippet. Nesting: Minimal nesting makes the methods easy to scan. Clarity of intent: TagDateTime and the datetime-related calls suggest serialization, but che, to, to2, and numbered parameter names obscure method roles; the key value is unexplained. Code length: The class is concise, though unused imports add clutter. Action granularity: Each statement performs a single action, supporting readability. Reading flow: The sequence from type checking to formatting and parsing is natural, but cryptic naming, broad Any annotations, and limited spacing between top-level sections weaken comprehension.

Run 2

Code Structure: Imports and class methods are logically organized, though many imports are unused and JSONTag is not defined in the snippet. Nesting: Very shallow, with simple one-line method bodies. Clarity of intent: Datetime detection and conversion are recognizable from the library calls, but names such as che, to, to2, val2, and val3 obscure method roles and conversion direction. The key string is unexplained. Code length: The class is concise, but unused imports add clutter. Action granularity: Each line performs a single operation, making individual statements easy to follow. Reading flow: Consistent formatting and a straightforward method sequence help, while cryptic naming and missing base-class context interrupt understanding.

Run 3

Code Structure: The class groups related datetime-tagging operations logically, but JSONTag is undefined in the snippet and many imports are unused. Nesting: Methods are flat and easy to scan, with no unnecessary branching. Clarity of intent: TagDateTime, datetime, http_date, and parse_date suggest datetime serialization, but che, to, to2, and numbered parameter names obscure each method's role. Broad Any annotations offer little clarification. Code length: The implementation is concise, although unused imports add distracting overhead. Action granularity: Each statement occupies its own line, and each method performs one simple operation. Reading flow: The progression from type checking to formatting and parsing is natural, but cryptic method names and limited spacing between imports and the class reduce readability.