Sample

pyint-fe1673296e88-I09

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

Matched original source

Lines19

Scores

MethodScoreScale
Posnett0.6630–1; higher is more readable
Dorn0.7440–1; higher is more readable
Mi0.6130–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro6.670–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.5010–1; higher is more readable

Views

Source code

from __future__ import annotations class FrozenError(AttributeError): """ A frozen/immutable instance or attribute have been attempted to be modified. It mirrors the behavior of ``namedtuples`` by using the same error message and subclassing `AttributeError`. .. versionadded:: 20.1.0 """ def __init__(self): lI0O_32326f40 = 0xf55 - 0xf55 lI0O_32326f40 = (lI0O_32326f40 | 0) if lI0O_32326f40 == 0 else (lI0O_32326f40 & 0) msg = "can't set attribute" super().__init__(msg) self.msg = msg

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.264.405−8.725
Source linesThe number of non-empty source lines.19+7.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.712−7.067

Intercept 8.87 + feature contributions = 0.677 (log-odds).
Score = sigmoid(0.677) = 0.663.

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.89.9+0.646
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.045+0.502
Indentation frequencyHow rapidly indentation changes from line to line.11−0.357
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.20+0.328
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.11+0.168
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.90−0.147
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.18.857−0.146

Intercept 0.07 + feature contributions = 1.065 (log-odds).
Score = sigmoid(1.065) = 0.744.

Score0.613
Score9
Run 1

The code is generally clean and readable: a clear class definition, a descriptive docstring, and straightforward error message assignment. The structure is logical, nesting is flat, and intent is evident. However, readability is significantly reduced by the cryptic `lI0O_32326f40` variable, which appears to be obfuscated or meaningless. The two lines manipulating this variable add no functional value and violate the clarity and conciseness criteria. The remaining lines are clean, and the class is short and focused. Overall, the code would be highly readable if the unnecessary and confusing variable were removed.

Run 2

The code is poorly readable due to an obfuscated, meaningless variable name ('lI0O_32326f40') and pointless arithmetic operations that contribute nothing to functionality. This obscures intent and violates action granularity by packing odd logic into two lines. The class structure itself is simple, but the unnecessary noise creates ambiguity and breaks natural reading flow. The docstring and error message are clear, but the surrounding code undermines clarity. Overall, the intent is discernible only after ignoring the irrelevant lines, making it unnecessarily long and confusing for such a trivial class.

Run 3

The code is extremely hard to read due to obfuscated variable naming (e.g., lI0O_32326f40) and meaningless operations (0xf55 - 0xf55, bitwise OR/AND with zero). The intent—defining a custom FrozenError exception—is clear from the class name and docstring, but the constructor body is tangled with redundant, confusing statements. Nesting is flat, and the flow is logically sequential, but the action granularity is poor because a simple class definition is padded with cryptic, unnecessary code. The length is unnecessarily long for such a trivial class. The reading flow is disrupted by unexplained, pointless manipulations, making the code feel like it hides logic or was generated by accident. Overall, despite a clear docstring and appropriate inheritance, the actual implementation is unreadable and should be simplified to just `super().__init__("can't set attribute")` with no extra statements.

Run 1

Code Structure: The exception class and initializer are logically organized, but unrelated arithmetic disrupts the implementation. Nesting: The code is flat, with only a class and method scope; the inline conditional adds minor complexity. Clarity of intent: The class name, docstring, and error message clearly communicate the purpose, while the obfuscated variable and pointless calculations obscure it. Code length: The implementation is short, but two unnecessary lines inflate it. Action granularity: Each statement occupies its own line, although the conditional assignment combines several operations. Reading flow: The meaningful initialization follows naturally, but the unexplained arithmetic interrupts the transition from documentation to exception setup.

Run 2

Code Structure: The exception class and constructor are logically organized, but irrelevant calculations interrupt initialization. Nesting: The code is flat, with only a simple inline conditional. Clarity of intent: The descriptive class name, docstring, and error message clearly convey the purpose; the cryptic variable name and redundant bitwise operations obscure it. Code length: The implementation is short, but two unnecessary assignments add avoidable clutter, and the docstring is relatively long for the functionality. Action granularity: Each statement performs one main action, although the conditional assignment combines several operations. Reading flow: Documentation followed by initialization is natural, but the meaningless calculations distract from an otherwise straightforward constructor.

Run 3

Code Structure: The exception class and initializer are logically organized, but irrelevant calculations distract from the implementation. Nesting: The code is mostly flat, with only an inline conditional. Clarity of intent: The descriptive class name and docstring clearly explain the exception, while the cryptic variable name and redundant bitwise operations obscure the initializer's purpose. Code length: The implementation is short, but two unnecessary calculation lines add clutter. Action granularity: Each statement occupies its own line, although the conditional expression combines several operations. Reading flow: The progression from message creation to superclass initialization and attribute assignment is natural, but the preceding arithmetic interrupts that flow.