Sample

pyint-ef7557660738-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines26

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.1810–1; higher is more readable
Mi0.2410–1; higher is more readable
LLOC22Logical lines; fewer is more readable
DeepSeek V4 Pro30–20; mean of three runs
GPT-6.1 Sol13.330–20; mean of three runs
BTTF0.2470–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 check(self, value: t.Any) -> bool: lI0O_c5f7db09 = 0xd8d7 lI0O_c5f7db09 = (0 if (lI0O_c5f7db09 ^ lI0O_c5f7db09) == 0 else 1) if (lI0O_c5f7db09 & 0) == 0 else 2 return isinstance(value, datetime) def to_json(self, value: t.Any) -> t.Any: return http_date(value) def to_python(self, value: t.Any) -> t.Any: return parse_date(value)

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.901.892−29.762
Source linesThe number of non-empty source lines.26+10.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.886−7.33

Intercept 8.87 + feature contributions = -17.822 (log-odds).
Score = sigmoid(-17.822) = 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.108.926−0.948
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.26−0.176
Indentation frequencyHow rapidly indentation changes from line to line.26+0.162
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.081+0.157
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.27+0.08
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.25.682−0.051

Intercept 0.07 + feature contributions = -1.51 (log-odds).
Score = sigmoid(-1.51) = 0.181.

Score0.241
Score22
Run 1

The code has severe readability issues. The class structure is clear, but the presence of obfuscated, dead code (the lI0O_c5f7db09 variable with meaningless name and nonsense bitwise operations) is a major red flag that obscures intent. The nesting is flat, which is good, but the reading flow is disrupted by this irrelevant block. Action granularity is poor in this section: multiple operations are crammed onto one line with confusing conditional logic. Other methods are concise and readable, but the overall file is significantly degraded by this obtrusive dead code. The import block is clean, and the class methods otherwise show clear intent. However, the presence of undeletable-looking obfuscation suggests either generated or intentionally obscured code, which breaks trust and readability. The valid parts are outweighed by the confusing block, making it hard to follow.

Run 2

This code is severely degraded by obfuscation artifacts. The variable 'lI0O_c5f7db09' with meaningless bitwise operations adds no functional value and completely destroys readability. While the class structure follows a simple pattern (check, to_json, to_python methods), the obfuscated code in the 'check' method makes the intent unclear and violates the principle of one action per line. The reading flow is broken by this meaningless code block. The imports and method signatures are otherwise reasonable, but the core logic is corrupted with what appears to be deliberately obscured code. A clean version would simply check isinstance(value, datetime) and return it, making the purpose immediately clear. The current state fails most readability criteria despite the underlying structure being salvageable.

Run 3

The code is severely compromised by an obfuscated, meaningless block (lI0O_c5f7db09 with bitwise operations) inside the check method that serves no functional purpose and destroys clarity. While the class structure, imports, and method separation follow standard patterns, the injected dead code makes intent ambiguous and reading flow disjointed. Nesting is minimal and action granularity is acceptable, but the overall readability is critically undermined by the confusing meaningless variable. The datetime handling logic itself is clear, but the presence of unexplained noise dominates the assessment.

Run 1

Code Structure: The class is logically organized into checking and conversion methods, though numerous unused imports add clutter. Nesting: Methods are flat, but the nested conditional expression in check is unnecessarily complex. Clarity of intent: Class and method names clearly convey datetime serialization, while the cryptic variable and irrelevant bitwise operations obscure the type check. Code length: The functional implementation is concise, but redundant assignments and imports inflate it. Action granularity: Each statement occupies its own line, although the long conditional assignment combines several operations. Reading flow: The conversion methods read naturally; the distracting assignments interrupt the otherwise straightforward flow of check.

Run 2

Code Structure: The class is logically organized into type checking, serialization, and deserialization methods, though several imports are unused and JSONTag is not defined in the snippet. Nesting: Methods are flat, but the nested conditional expression in check adds needless complexity. Clarity of intent: Class and method names clearly communicate datetime conversion; the opaque variable name and irrelevant bitwise arithmetic obscure the otherwise simple type check. Code length: Most methods are concise, but redundant assignments and unused imports unnecessarily expand the snippet. Action granularity: Each statement occupies its own line, although the long conditional assignment combines multiple operations. Reading flow: The method sequence is natural, but distracting arithmetic interrupts the straightforward progression to isinstance.

Run 3

Code Structure: The class is logically organized into checking, serialization, and deserialization methods, but unused imports and irrelevant assignments add clutter. Nesting: Methods are shallow, although the nested conditional expression in check is unnecessarily difficult to parse. Clarity of intent: Method names and datetime conversion calls communicate the purpose clearly; the opaque variable name and meaningless bitwise operations obscure the type check. Code length: Mostly concise, but the two redundant assignments and unrelated imports unnecessarily expand the snippet. Action granularity: Statements generally perform one action per line, though the conditional assignment combines several operations. Reading flow: The conversion methods read naturally, while the obfuscated logic interrupts the otherwise straightforward flow.