Sample
pyint-adb096ab65b0-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.629 | 0–1; higher is more readable |
| Mi | 0.266 | 0–1; higher is more readable |
| LLOC | 41 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.432 | 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. | 2088.247 | −68.912 |
| Source linesThe number of non-empty source lines. | 89 | +35.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.71 | −7.065 |
Intercept 8.87 + feature contributions = -31.507 (log-odds).
Score = sigmoid(-31.507) = 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. | 90 | −2.15 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 66 | +1.546 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 66 | −1.094 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 88.912 | +0.833 |
| 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. | 78.133 | +0.456 |
| 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.967 | +0.321 |
Intercept 0.07 + feature contributions = 0.528 (log-odds).
Score = sigmoid(0.528) = 0.629.
| Score | 0.266 |
|---|
| Score | 41 |
|---|
Run 1
The code is generally well-structured with clear class hierarchy, type hints, and descriptive docstrings. The __init__ method follows a logical flow: validate parameters, compute base_url defaults, then delegate to parent. However, readability is hampered by a few issues: (1) the bizarre travel_distance calculation block (lines assigning meaningless position variables) is confusing and appears to be dead code; (2) the assert condition with mixed boolean logic and string interpolation is difficult to parse; (3) the base_url construction using nested ternaries and f-strings requires careful reading. The json_dumps method is clean and well-documented. Nesting depth is moderate, and action granularity is mostly one operation per line. Overall, the code is readable but would benefit from simplifying the assertion logic and removing the extraneous travel_distance block.
Run 2
The code is generally well-structured, with clear class and method definitions, comprehensive docstrings, and readable type hints. Imports are logically grouped. However, there are some readability issues. The 'travel_distance' block (lines computing it) is dead code that serves no purpose and should be removed. The assert condition is convoluted and difficult to parse logically. The base_url construction and path manipulation are somewhat dense. Overall nesting is low, and the reading flow is mostly natural, but the mentioned issues slightly reduce clarity of intent and code length efficiency.
Run 3
The code is generally readable but contains dead code that hurts clarity. The variables 'starting_position', 'ending_position', and 'travel_distance' are meaningless and serve no purpose, creating confusion. The assertion condition is overly complex and difficult to parse logically. The docstring is thorough and well-structured, which aids understanding. The code structure follows a logical flow: validate inputs, construct base URL, initialize parent. Nesting is minimal and line length is reasonable. However, the redundant calculation block and the convoluted boolean expression in the assertion significantly reduce readability. Action granularity is acceptable, with one primary operation per line for critical sections. The method signature and typing are clear. Overall, the code would be more readable with removal of dead code and simplification of the validation logic.
Run 1
Code Structure: Imports, class documentation, initialization, and JSON serialization are logically organized, but unrelated, unused travel-distance calculations disrupt cohesion. Nesting: Conditional nesting is shallow and manageable. Clarity of intent: Descriptive names, type annotations, and detailed docstrings explain environment construction well; the compound assertion is harder to interpret, and Flask is not defined or imported in the snippet. Code length: Most implementation is concise, but dead calculations and several unused imports add unnecessary material. Action granularity: Statements generally perform one action per line, with sensible multiline formatting for complex expressions. Reading flow: Configuration lookup, URL construction, and superclass initialization follow a natural sequence, though the irrelevant calculations and dense validation expression interrupt that flow.
Run 2
Code Structure: Imports, class documentation, initialization, and serialization are logically organized, but the unused travel-distance calculation is unrelated clutter. Nesting: Shallow conditionals keep the code easy to follow. Clarity of intent: Descriptive names, type annotations, and detailed documentation explain environment construction well; however, the compound assertion is difficult to parse, and Flask is not imported in the snippet. Code length: Mostly concise for its purpose, though the irrelevant calculation adds unnecessary lines. Action granularity: Statements generally perform one action per line, with sensible multiline formatting. Reading flow: Configuration lookup, URL construction, and superclass initialization progress naturally, but the unrelated opening calculation and dense validation expression interrupt that flow.
Run 3
Code Structure: Imports, class documentation, initialization, and serialization are logically organized, but the unrelated travel-distance calculation disrupts cohesion. Nesting: Conditional nesting is shallow and easy to follow. Clarity of intent: Descriptive names, type annotations, and detailed docstrings explain environment construction well; the unused calculation and complex boolean assertion obscure intent locally. Code length: Most implementation code is concise, although the irrelevant calculation adds unnecessary lines and the documentation is lengthy relative to the implementation. Action granularity: Statements generally perform one action per line, with multiline expressions formatted clearly. Reading flow: Configuration lookup, URL construction, and superclass initialization follow a natural sequence, but the initial calculation and difficult-to-parse assertion interrupt that flow.