Sample
pyint-a5090a69149a-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.907 | 0–1; higher is more readable |
| Dorn | 0.784 | 0–1; higher is more readable |
| Mi | 0.819 | 0–1; higher is more readable |
| LLOC | 9 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.442 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Source linesThe number of non-empty source lines. | 19 | +7.6 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 225.621 | −7.445 |
| 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.497 | −6.746 |
Intercept 8.87 + feature contributions = 2.279 (log-odds).
Score = sigmoid(2.279) = 0.907.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.048 | +0.471 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 74.15 | +0.392 |
| 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. | 77.95 | +0.364 |
| 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 (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 18.886 | −0.146 |
Intercept 0.07 + feature contributions = 1.291 (log-odds).
Score = sigmoid(1.291) = 0.784.
| Score | 0.819 |
|---|
| Score | 9 |
|---|
Run 1
The code is generally readable: it uses clear class and method names, a helpful docstring, and simple logic. The intent is obvious—create a frozen error with an explanatory message. However, readability suffers due to an unnecessary, confusing debug check `if ((0x5c39 ^ 0x5c39) != 0):` which is always false and adds clutter. The `msg` variable is redundant since it’s directly passed to `super().__init__` and stored; storing it is reasonable for potential later use but not necessary. Nesting is minimal and structure is logical. Length is appropriate. Minor issue: the class docstring references versionadded and namedtuples, which is fine but slightly verbose for this simple class. Overall, the code is readable despite the odd assert block and minor redundancy.
Run 2
The code has a clear purpose but is severely undermined by a nonsensical embedded check `if ((0x5c39 ^ 0x5c39) != 0): raise AssertionError()`. This adds confusion, noise, and unnecessary length. The rest is readable and simple, but that block destroys clarity and intent. Overall structure is fine, nesting is flat, but action granularity is violated by combining check and raise on one line, and the dead code ruins reading flow.
Run 3
The code is generally readable and simple, with a clear structure and intent. The class and docstring are well-formatted and explain the purpose well. The `FrozenError` class cleanly subclasses `AttributeError` and mirrors namedtuple behavior. However, the inclusion of an incomprehensible, dead-code check `if ((0x5c39 ^ 0x5c39) != 0): raise AssertionError()` adds unnecessary confusion and noise, disrupting reading flow and clarity. Apart from that oddity, the code is concise, flat, and easy to follow.
Run 1
Code Structure: The exception class is logically organized, with documentation and a short initializer. Nesting: Only one shallow conditional is present. Clarity of intent: The class name, docstring, and error message clearly communicate immutable-attribute behavior, but the hexadecimal XOR condition is always false and introduces confusing dead code. Code length: Mostly concise, though the unreachable assertion is unnecessary and the documentation is somewhat lengthy relative to the implementation. Action granularity: Each statement performs one action, making individual steps easy to follow. Reading flow: Initialization proceeds naturally from message creation to superclass initialization and attribute assignment, but the unexplained conditional interrupts that flow.
Run 2
Code Structure: The exception class is logically organized, with documentation followed by a short initializer. Nesting: Only one shallow conditional, so nesting is minimal. Clarity of intent: The class name, inheritance, docstring, and error message clearly convey its purpose, but the hexadecimal XOR condition is an opaque, always-false check that distracts from that purpose. Code length: Mostly concise, though the unreachable assertion adds unnecessary code. Action granularity: Each statement performs a single action on its own line. Reading flow: The initializer otherwise flows naturally from defining the message to initializing the superclass and storing the message; the unexplained conditional interrupts that flow.
Run 3
Code Structure: The exception class, documentation, and initializer are logically organized, but the unrelated assertion check adds clutter. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: The class name, inheritance, docstring, and error message clearly convey its purpose; however, the hexadecimal XOR condition obscures an always-false check. Code length: Generally concise, though the unreachable assertion branch is unnecessary. Action granularity: Each statement performs a single action, aiding readability. Reading flow: The progression from documentation to message creation, superclass initialization, and attribute assignment is natural, except for the distracting check at the initializer's start.