Sample
pyint-ed41d9585699-I10
Deterministically remove some optional blank lines and bracketed line breaks
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.005 | 0–1; higher is more readable |
| Dorn | 0.843 | 0–1; higher is more readable |
| Mi | 0.401 | 0–1; higher is more readable |
| LLOC | 13 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.725 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 533.839 | −17.617 |
| 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.689 | −7.033 |
Intercept 8.87 + feature contributions = -5.38 (log-odds).
Score = sigmoid(-5.38) = 0.005.
Feature contributions
| Feature | Value | Contribution (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. | 71.963 | +0.617 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.039 | +0.559 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 15 | −0.218 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 61.556 | +0.189 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 26 | +0.116 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 25.849 | −0.049 |
Intercept 0.07 + feature contributions = 1.682 (log-odds).
Score = sigmoid(1.682) = 0.843.
| Score | 0.401 |
|---|
| Score | 13 |
|---|
Run 1
The code is generally readable with clear intent and docstrings explaining non-obvious design decisions. The class structure is logical and the methods are short. However, the multiple inheritance and the custom __init__ ordering create conceptual complexity despite explanatory comments. The code uses flat nesting and mostly one action per line, which helps. The reading flow is somewhat disrupted by the dense explanatory docstrings and the need to understand inheritance semantics, but overall it is maintainable and intentional rather than tangled.
Run 2
The code is well-structured with clear separation of class definition, constructor, and serialization method. The inheritance and exception handling logic is explicit, and docstrings provide necessary context for non-obvious design decisions (MRO, pickling). Nesting is minimal, with only one method-level indentation. Intent is clear: define a hybrid JSON decode error class. However, readability is slightly reduced by the unusual multiple inheritance pattern and the need for comments to explain why specific parent methods are called. The __reduce__ method's return type annotation is a bit complex. Overall, the code is concise but context-dependent; someone unfamiliar with the class hierarchy might need to read the docstrings carefully. Action granularity is reasonable, though the constructor chains two initialization calls in sequence, which is acceptable given the explanation.
Run 3
The code is generally readable with clear intent and good structure. The class hierarchy is logical, and docstrings explain non-obvious design choices, such as the __init__ ordering and __reduce__ override. Nesting is minimal, action granularity is reasonable, and the flow is natural. However, the __init__ method's comment and implementation could be clearer, and a few lines are dense. Overall, it's a well-documented and maintainable piece of code.
Run 1
Code Structure: The class logically groups initialization and pickling behavior, though imports lack separation from the class and InvalidJSONError is not defined or imported in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive names and docstrings explain the otherwise subtle multiple-inheritance behavior; unused imports add minor distraction. Code length: Implementation is concise, although the docstrings are somewhat verbose. Action granularity: Each statement performs one clear action. Reading flow: Initialization followed by serialization support is natural, with explicit parent-method calls making execution order clear.
Run 2
Code Structure: The class logically groups initialization and pickling behavior, though missing spacing after imports and the undefined InvalidJSONError base reduce self-contained readability. Nesting: Flat methods with no nested control flow are easy to follow. Clarity of intent: Descriptive aliases, type annotations, and docstrings explain the unusual multiple-inheritance behavior well; unused imports add minor noise. Code length: The implementation is concise, although the docstrings are somewhat verbose and contain minor grammatical issues. Action granularity: Each executable line performs a single clear action. Reading flow: Initialization proceeds naturally, followed by serialization behavior; understanding the inheritance details requires some background knowledge, but the explanations help.
Run 3
Code Structure: Imports and a focused exception class are logically organized, though InvalidJSONError is not defined or imported in the snippet and spacing between imports and the class is missing. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: Descriptive aliases, type annotations, and docstrings explain the unusual initialization and pickling behavior, although multiple inheritance requires background knowledge. Code length: The implementation is concise; the detailed docstrings are useful but slightly wordy. Action granularity: Each statement performs one clear action. Reading flow: Initialization followed by serialization support is natural, but unused TYPE_CHECKING and BaseHTTPError imports add minor distraction.