Sample
pyint-8c9656e35b04-I12
Inline all eligible single-use intermediate local variables
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.33 | 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 with a clear structure and purpose. It uses type hints, docstrings, and logical organization. The constructor is moderately complex but not deeply nested. The conditional logic for base_url construction is somewhat lengthy but flows naturally. The assert statement is complex and might benefit from extraction, but it clearly conveys intent. Action granularity is appropriate, with one logical operation per line. The mix of parsing URL components and constructing base_url in a single block slightly reduces clarity, and the json_dumps method is concise. Overall, it is well-structured and maintainable, with minor opportunities for improvement in breaking up the constructor logic.
Run 3
The code is well-structured and highly readable. The class has a clear purpose, and its constructor logically groups URL/base_url resolution steps with minimal nesting. Type hints and future annotations improve clarity. Docstrings are thorough and explain parameters well. The assertion message clearly communicates constraints. The base_url construction uses multiple lines but remains natural to follow. The json_dumps method is concise and delegates appropriately. Minor deductions: the long assertion condition slightly reduces clarity, and the base_url string concatenation could be split across lines more naturally. Overall, strong readability with clear intent and structure.
Run 1
Code Structure: Logically organized imports and a focused class with clearly separated initialization and JSON serialization. Nesting: Shallow, with straightforward conditionals inside one main configuration branch. Clarity of intent: Descriptive names, type annotations, and detailed docstrings explain the purpose well; however, the compound assertion is difficult to parse, and Flask is referenced without a visible import. Code length: Implementation is concise, although documentation occupies much of the snippet and several imports appear unused. Action granularity: Generally one action per line, with multiline expressions formatted cleanly. Reading flow: Configuration defaults, URL construction, and superclass initialization follow a natural sequence; the assertion briefly interrupts that flow.
Run 2
Code Structure: The class cleanly separates environment initialization from JSON serialization, with logically grouped configuration and URL handling. Nesting: Control flow stays shallow, with only a few conditionals inside the base_url branch. Clarity of intent: Descriptive names, type annotations, and detailed docstrings explain the purpose well, although the compound assertion is harder to interpret than a direct validation condition. Code length: Methods are concise, but numerous imports unused in this excerpt and the lengthy parameter documentation add reading overhead. Action granularity: Statements generally perform one action per line; multiline expressions are formatted clearly. Reading flow: Initialization proceeds naturally from validation through default resolution and URL construction to superclass initialization. The dense assertion and the Flask annotation without a visible import slightly interrupt an otherwise clear presentation.
Run 3
Code Structure: Imports, a focused class, and two clearly separated methods provide logical organization. Nesting: Mostly shallow, with a few straightforward conditionals inside base URL construction. Clarity of intent: Descriptive names, type annotations, and detailed docstrings explain application-specific defaults well; however, the compound assertion is difficult to parse. Code length: Implementation is concise for its purpose, although the documentation is relatively lengthy. Action granularity: Statements generally perform one action each, and multiline expressions improve formatting without combining unrelated operations. Reading flow: Configuration lookup, URL construction, instance initialization, and parent initialization follow a natural sequence. Minor distractions include unused imports in the supplied snippet and the unexplained Flask annotation.