Sample
pyint-0cd497ec903a-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.367 | 0–1; higher is more readable |
| Mi | 0.423 | 0–1; higher is more readable |
| LLOC | 31 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 13 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.677 | 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. | 1623.002 | −53.559 |
| Source linesThe number of non-empty source lines. | 43 | +17.2 |
| 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.792 | −7.188 |
Intercept 8.87 + feature contributions = -34.677 (log-odds).
Score = sigmoid(-34.677) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 43 | +0.75 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 43 | −0.566 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 44 | −0.522 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.06 | +0.356 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 42.784 | +0.188 |
| 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. | 86.977 | −0.019 |
Intercept 0.07 + feature contributions = -0.547 (log-odds).
Score = sigmoid(-0.547) = 0.367.
| Score | 0.423 |
|---|
| Score | 31 |
|---|
Run 1
The code is moderately readable but has several issues. The import section is lengthy but organized by type. The class definition is simple, but the __init__ method contains multiple operations in a single line and lacks type hints or docstrings. The __setitem__ method chains a helper function call with a parent method call, which reduces clarity. The use of double underscores and mixing of MIMEMixin and MIMEMultipart inheritance creates ambiguity about the class's true purpose. While the code is flat and not deeply nested, the lack of comments explaining the safety wrapper's intent hurts comprehension. The variable naming like _subtype and **_params is conventional for MIME but may confuse newcomers. Overall, the code is functional but could benefit from better documentation and clearer separation of actions.
Run 2
The code shows moderate readability with clear imports and a straightforward class definition. The class SafeMIMEMultipart has a logical structure with a simple __init__ method. However, several issues reduce readability: the parameter naming is inconsistent (underscore-prefixed params mixed with non-prefixed), the class inherits from MIMEMixin which is not defined in the shown code, and the __setitem__ method relies on an external function (forbid_multi_line_headers) that may not be obvious to readers. The code is relatively flat with minimal nesting, which is positive. Intent is somewhat clear (safety wrapper for MIME multipart), but the overall purpose could be more explicit through docstrings. Action granularity is acceptable with one main operation per line. The code would benefit from type hints, docstrings explaining the safety mechanism, and clearer variable naming.
Run 3
The code has clear imports and a logical structure, but has several readability issues. The class definition is concise but mixes responsibilities (MIMEMixin and MIMEMultipart inheritance) without indicating the purpose of the mixin. The __init__ method uses underscore-prefixed parameters, which is a convention that may confuse readers. __setitem__ mutates arguments before delegating, making the flow less obvious. The function forbid_multi_line_headers is used without explanation, leaving intent ambiguous. Some lines, such as the parameter list in __init__, pack multiple items together. The reading flow is natural in places but interrupted by parameter ordering and lack of docstrings or comments explaining safety measures. Overall, it is readable but could be improved with clearer naming, separation of validation logic, and explanatory comments.
Run 1
Code Structure: Imports precede a compact class with logically separated initialization and header assignment methods, though many imports are unused in this excerpt. Nesting: Methods are flat, with no nested control flow. Clarity of intent: SafeMIMEMultipart and forbid_multi_line_headers clearly communicate header validation, but MIMEMixin and the validation helper are not defined here, limiting standalone understanding. Code length: The class is concise, while the extensive import block outweighs the implementation shown. Action granularity: Each statement performs one clear action. Reading flow: Initialization followed by customized header assignment is natural; grouped imports and multiline formatting help scanning, although an additional blank line before the class would improve visual separation.
Run 2
Code Structure: Imports are grouped by source, followed by a small class with logically separated initialization and header assignment methods; many imports are unused in this excerpt. Nesting: Flat methods with no nested control flow make scanning easy. Clarity of intent: SafeMIMEMultipart and forbid_multi_line_headers clearly convey defensive header handling, although MIMEMixin and the validation helper are not defined here, and val is a generic name. Code length: The class is concise, but the extensive import block is disproportionate to the shown functionality. Action granularity: Each statement performs a focused operation; tuple unpacking cleanly captures the validated header pair. Reading flow: Initialization followed by customized assignment reads naturally, with consistent indentation and a readable multiline signature. Additional blank lines between import groups and before the class would improve visual separation.
Run 3
Code Structure: Imports are grouped sensibly, followed by a focused class with two short methods, although many imports are unused in this excerpt. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class name and header-validation call communicate safe multipart handling, but MIMEMixin and forbid_multi_line_headers are not defined here, and val is a generic name. Code length: The implementation is concise; the extensive import section dominates this small excerpt. Action granularity: Each statement performs one clear operation, with the tuple assignment naturally representing a single validation step. Reading flow: Initialization followed by header assignment is logical, and formatting is consistent. Direct parent-class calls and the long constructor signature introduce minor reading friction.