Sample
pyint-e98e3f59c8ce-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.988 | 0–1; higher is more readable |
| Dorn | 0.837 | 0–1; higher is more readable |
| Mi | 0.819 | 0–1; higher is more readable |
| LLOC | 7 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs |
| BTTF | 0.762 | 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. | 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.447 | −6.671 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 140.182 | −4.626 |
Intercept 8.87 + feature contributions = 4.373 (log-odds).
Score = sigmoid(4.373) = 0.988.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.033 | +0.622 |
| 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.873 | −0.174 |
Intercept 0.07 + feature contributions = 1.633 (log-odds).
Score = sigmoid(1.633) = 0.837.
| Score | 0.819 |
|---|
| Score | 7 |
|---|
Run 1
The code is highly readable. Structure is logical and well-organized: a custom exception class with a clear docstring, proper inheritance from AttributeError, and a straightforward __init__ method. Nesting is minimal and flat. Intent is unambiguous—creating a frozen attribute error mirroring namedtuple behavior. Length is concise with no unnecessary code. Each action (creating message, calling super, assigning attribute) is on its own line, following clean action granularity. Reading flow is natural, from class definition to docstring to initialization. Minor deductions: the 'msg' attribute assignment is slightly redundant since the message is already stored by the base exception, and the docstring could be trimmed, but these are trivial and don't hinder comprehension.
Run 2
The code is well-structured and highly readable. It defines a single exception class with a clear name and a straightforward, single-purpose __init__ method. Nesting is minimal, and there is no unnecessary complexity. The docstring clearly explains the intent, behavior, and version context, which improves clarity. The code is concise, with each action on its own line, and reads naturally from top to bottom. Minor deductions: the `msg` attribute is slightly redundant since the message is already stored in `args`; storing it explicitly could be intentional but adds a small amount of ambiguity. Also, the docstring is somewhat long for a tiny class, though it remains informative rather than obstructive. Overall, this is clean, maintainable code that would be easy for any developer to understand.
Run 3
The code is highly readable. It has a clear, single-purpose class with a logical structure and minimal nesting. The docstring clearly explains the intent and context, and the method is concise with one action per line. The reading flow is natural, with imports, class definition, docstring, and initializer in a standard order. Minor deductions: the redundant assignment of `self.msg` could be simplified, and the slightly verbose docstring reduces conciseness slightly, but these do not meaningfully impair readability.
Run 1
Code Structure: Imports, class documentation, and initialization are logically organized. Nesting: Minimal, with only a class and its constructor. Clarity of intent: The descriptive exception name, docstring, and standard error message clearly explain its purpose, although the docstring's opening sentence is grammatically awkward. Code length: Concise overall; storing the message in self.msg may be redundant but adds little complexity. Action granularity: Each statement performs one distinct action. Reading flow: Natural top-to-bottom progression with appropriate spacing and no distracting control flow.
Run 2
Code Structure: The custom exception 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, AttributeError inheritance, and docstring clearly communicate the purpose, though the opening sentence is grammatically awkward. Code length: The implementation is concise; storing the message in self.msg adds a small amount of potentially unnecessary state. Action granularity: Each statement performs one clear action. Reading flow: The progression from purpose to message definition, parent initialization, and message storage is natural.
Run 3
Code Structure: Logically organized into a focused exception class with documentation and a short initializer. Nesting: Minimal, limited to the method within the class. Clarity of intent: The class name, docstring, inheritance, and error message clearly communicate its purpose, although the docstring's opening sentence is grammatically awkward. Code length: Concise, with documentation proportionate to the functionality. Action granularity: Each executable line performs one clear action. Reading flow: Natural progression from import to class documentation to initialization; an additional blank line before the top-level class would improve conventional formatting.