Sample

pyint-4a37024d6210-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines17

Scores

MethodScoreScale
Posnett0.9870–1; higher is more readable
Dorn0.8360–1; higher is more readable
Mi0.8190–1; higher is more readable
LLOC7Logical lines; fewer is more readable
DeepSeek V4 Pro16.670–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.6820–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): a = "can't set attribute" super().__init__(a) self.msg = a

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.17+6.8
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.431−6.646
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.142.624−4.707

Intercept 8.87 + feature contributions = 4.317 (log-odds).
Score = sigmoid(4.317) = 0.987.

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.033+0.617
Indentation frequencyHow rapidly indentation changes from line to line.9−0.426
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.18+0.399
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.73.556+0.382
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.78+0.361
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.16.848−0.174

Intercept 0.07 + feature contributions = 1.628 (log-odds).
Score = sigmoid(1.628) = 0.836.

Score0.819
Score7
Run 1

The code is highly readable with clear structure: a single-purpose exception class with a logical docstring, flat nesting, and concise implementation. The intent is unambiguous—defining an immutable attribute error. However, the temporary variable `a` is unnecessary and slightly obscures the purpose, reducing clarity. One action per line is mostly followed, though consolidating the message into `super().__init__` would improve conciseness. The reading flow is natural and self-explanatory.

Run 2

The code is concise and clearly structured. The class has a single responsibility: defining a custom exception. It uses a clear, descriptive name (`FrozenError`) and inherits from `AttributeError`, which communicates intent well. The docstring provides context, version info, and mirrors the style of `namedtuple`, improving readability. However, there is mild ambiguity: the local variable `a` is poorly named and slightly harms clarity of intent, even though its value is reused for the message. The class is not deeply nested, has short methods, and avoids multiple actions per line. Overall, it is highly readable with only minor naming issues.

Run 3

The code is generally clear and well-structured. It defines a custom exception with a simple, readable constructor. The docstring provides helpful context, including version and behavior details. Naming is explicit: `FrozenError` and `msg` clearly communicate purpose. The code is concise and has no unnecessary nesting. However, two issues reduce readability: (1) the local variable `a` is vague and only used to avoid duplicating the string—using the literal directly in both places or a module-level constant would be clearer; (2) setting `self.msg` after calling `super().__init__()` is redundant since `AttributeError` already stores the message internally, and the assignment adds minor clutter. The single action per line and straightforward flow are good, but the variable naming and slight redundancy prevent a higher score.

Run 1

Code Structure: Clearly organized as a small exception class with documentation and a constructor. Nesting: Minimal, with only the class and method levels. Clarity of intent: The class name, inheritance, and docstring clearly communicate its purpose, though the variable name 'a' is vague and the docstring has awkward grammar. Code length: Concise overall; the docstring is somewhat lengthy relative to the implementation but provides useful context. Action granularity: Each statement performs one action on its own line. Reading flow: Natural progression from the import to the class documentation and initialization; naming the message variable more descriptively would improve readability.

Run 2

Code Structure: The custom exception is logically organized, with documentation followed by a short initializer. Nesting: Minimal, limited to the class and method scopes. Clarity of intent: The class name, inheritance, and docstring clearly communicate the exception's purpose, though the variable name 'a' is vague and the docstring has a minor grammatical issue. Code length: Concise, with useful documentation and no unnecessary logic. Action granularity: Each statement performs one action on its own line. Reading flow: Natural and easy to follow, from the exception description to message initialization; a descriptive variable name and an additional blank line before the class would improve readability.

Run 3

Code Structure: The exception class is logically organized, with documentation followed by a short initializer. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class name, inheritance, and docstring clearly communicate its purpose, although the variable name 'a' is vague and the docstring has a grammatical error. Code length: Concise overall; the temporary variable could be more descriptively named. Action granularity: Each statement performs a single action on its own line. Reading flow: Natural top-to-bottom flow from the exception's purpose to message initialization and storage.