Sample
pyint-94e6a31d78d1-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.874 | 0–1; higher is more readable |
| Mi | 0.266 | 0–1; higher is more readable |
| LLOC | 36 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.469 | 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. | 1919.799 | −63.353 |
| Source linesThe number of non-empty source lines. | 84 | +33.6 |
| 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.73 | −7.096 |
Intercept 8.87 + feature contributions = -27.979 (log-odds).
Score = sigmoid(-27.979) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 85 | −1.973 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 61 | +1.373 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 83.862 | +0.762 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.041 | +0.547 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 77.165 | +0.441 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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.976 | +0.32 |
Intercept 0.07 + feature contributions = 1.938 (log-odds).
Score = sigmoid(1.938) = 0.874.
| Score | 0.266 |
|---|
| Score | 36 |
|---|
Run 1
The code is generally readable and well-organized. The class has a clear purpose, the docstring is helpful, and the method logic is logically structured. The assertion statement, however, is somewhat complex and hard to parse, reducing clarity. Nesting is minimal, and most code is at the method level. The `__init__` method contains a few multi-step operations (e.g., building the base URL and path) that are reasonably concise but could be slightly clearer with helper methods. Action granularity is mostly one action per line, but the assertion and URL-building lines bundle multiple operations, slightly reducing readability. Reading flow is natural overall, with imports and method ordering following common patterns.
Run 2
The code is generally readable and well-structured. The class has a clear purpose and the method organization is logical. The docstring is comprehensive, explaining parameters clearly. The assertion is complex but captures a non-obvious validation rule, though it could be simplified for readability. The conditional logic for building the base_url is well-segmented but nests three levels deep. Variable naming is clear and intent-revealing. The json_dumps method is concise with good separation of concerns. The main readability challenge is the dense assertion expression and the conditional URL construction block, which requires careful reading to understand the branching logic. Overall, the code demonstrates good practices like type hints, clear naming, and documentation.
Run 3
The code is generally well-structured and readable. The class has a clear single responsibility, the __init__ method logically separates URL construction from initialization, and the docstring is thorough. The assert statement is somewhat dense and could be clearer, but it uses a helpful error message. The reading flow is natural, with good action granularity. Minor deductions for the complex boolean assertion and the assert containing multiple conditions, which reduces clarity and nesting readability slightly.
Run 1
Code Structure: Imports, class documentation, initialization, and serialization are logically organized. Nesting: Conditional nesting is shallow and easy to follow. Clarity of intent: Descriptive names, type annotations, and detailed documentation make the purpose clear, but the compound assertion is difficult to parse. Code length: Implementation is concise; documentation is useful but occupies much of the snippet, and several imports appear unused here. Action granularity: Each statement generally performs one action, with complex URL construction sensibly split across lines. Reading flow: Configuration lookup, URL assembly, and superclass initialization follow a natural sequence. Missing blank lines between import groups and before the class slightly reduce visual clarity.
Run 2
Code Structure: Clearly organized into a documented class, constructor, and serialization method, although several imports appear unused in this snippet. Nesting: Shallow conditional nesting keeps the main logic easy to follow. Clarity of intent: Descriptive names, type hints, and thorough documentation explain application-derived defaults; the compound assertion is unnecessarily difficult to parse. Code length: Implementation is reasonably concise, though the lengthy docstring and unused imports add reading overhead. Action granularity: Most lines perform a single action, with multiline expressions used appropriately for formatting. Reading flow: Configuration lookup, URL construction, path adjustment, and superclass initialization follow a natural sequence. The dense assertion and Flask annotation without a visible import slightly interrupt comprehension.
Run 3
Code Structure: Well-organized class with a focused initializer and separate serialization method, though several imports are unused in this snippet. Nesting: Shallow and manageable, with simple conditionals inside one main configuration branch. Clarity of intent: Descriptive names, type annotations, and thorough documentation make the purpose clear; the compound assertion is harder to interpret than an explicit validation condition. Code length: Implementation is reasonably concise, although the docstring is substantial relative to the code. Action granularity: Statements generally perform one action each, with URL construction appropriately split across lines. Reading flow: Configuration defaults, URL parsing, and superclass initialization follow a natural sequence. Minor distractions include unused imports and the Flask annotation lacking an import in the shown code.