Sample
pyint-fb2c9bfec6c7-SRC
Unmodified source class
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 well-structured and readable. The class has a clear purpose and includes useful documentation. Imports are organized. The __init__ method handles configuration logic in a methodical way. However, the assert statement at the start of __init__ is quite complex and hard to parse, negatively impacting clarity of intent. The conditional logic for base_url construction involves moderate nesting and several string manipulations that could be more transparent. Variable naming is clear and follows conventions. Line lengths are reasonable. The json_dumps method is concise and readable. Overall, the code demonstrates good structure and documentation, but the complex assertion and somewhat intricate URL construction logic reduce readability compared to simpler patterns.
Run 2
The code is highly readable with clear structure and intent. The class has a well-documented docstring explaining parameters and behavior. The constructor breaks down URL construction logically with flat conditional nesting. Variables are descriptively named, and actions are separated into distinct blocks (e.g., handling base_url, subdomain, url_scheme). The assertion for mutually exclusive parameters is explicit but slightly dense. The json_dumps method is concise and clear. Overall, the code follows good practices: minimal nesting, natural reading flow, and appropriate granularity.
Run 3
The code is well-structured and highly readable. It features a single class with a clear, documented purpose and logical method organization. Nesting is minimal, with only one level of conditional logic inside the constructor. The constructor's assertion is compact and explicit, though slightly dense. Each logical action is generally split across readable lines, and the base URL construction is broken into clear f-string segments. Type hints and descriptive parameter names enhance clarity. The docstring is detailed but not excessive. While the assertion condition is complex and may require careful reading, overall the code maintains a natural flow, avoids deep nesting, and keeps line lengths manageable.
Run 1
Code Structure: Imports, a focused class, and clearly separated methods provide logical organization. Nesting: Conditional blocks are shallow and easy to follow. Clarity of intent: Descriptive names, type annotations, and documentation explain environment construction and JSON serialization, although the compound assertion is difficult to parse and Flask is not imported in the snippet. Code length: The implementation is concise; the lengthy docstring is useful, but several imports appear unused here. Action granularity: Statements generally perform one action per line, with multiline formatting aiding readability. Reading flow: Initialization progresses naturally from validation through URL construction to superclass setup, followed by a small serialization method. More spacing between import groups and before the class, plus simpler validation logic, would improve readability.
Run 2
Code Structure: Imports, class documentation, initialization, and serialization are logically organized, although several imports appear unused in this snippet. Nesting: Mostly shallow, with simple conditionals inside one main configuration branch. Clarity of intent: Descriptive names, type annotations, and detailed documentation clearly explain application-derived request defaults; the compound assertion is harder to interpret, and Flask is not imported in the shown code. Code length: Implementation is concise, while the extensive parameter documentation is useful rather than excessive. Action granularity: Statements generally perform one action per line, with sensible multiline formatting for signatures and URL construction. Reading flow: Configuration lookup, URL assembly, and superclass initialization follow a natural sequence. The dense assertion and minor import clutter interrupt an otherwise clear flow.
Run 3
Code Structure: Well-organized class with distinct initialization and serialization responsibilities, although many imports are unused in this excerpt. Nesting: Shallow conditional nesting keeps control flow manageable. Clarity of intent: Descriptive names, type annotations, and detailed docstrings explain the purpose; the compound assertion is harder to interpret than a direct validation condition. Code length: Implementation is reasonably concise, though the extensive documentation and unused imports add reading overhead. Action granularity: Statements generally perform one action per line, with sensible multiline formatting for signatures and expressions. Reading flow: Initialization progresses naturally from validation through configuration defaults and URL construction to superclass initialization. The complex assertion briefly interrupts that flow, and the Flask annotation lacks a visible import or definition in the excerpt.