Sample
pyint-04523175076d-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.626 | 0–1; higher is more readable |
| Mi | 0.411 | 0–1; higher is more readable |
| LLOC | 29 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.33 | 0–20; mean of three runs |
| BTTF | 0.388 | 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. | 1334.495 | −44.038 |
| Source linesThe number of non-empty source lines. | 64 | +25.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.475 | −6.713 |
Intercept 8.87 + feature contributions = -16.281 (log-odds).
Score = sigmoid(-16.281) = 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. | 65 | −1.265 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 84.985 | +0.567 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 37 | +0.543 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 63.814 | +0.482 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.048 | +0.479 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 37 | −0.428 |
| 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. | 84.969 | +0.066 |
Intercept 0.07 + feature contributions = 0.513 (log-odds).
Score = sigmoid(0.513) = 0.626.
| Score | 0.411 |
|---|
| Score | 29 |
|---|
Run 1
The code is well-structured with clear separation between class configuration (__init_subclass__) and request handling (dispatch_request). Nesting is minimal, with only one level of conditional loops. Intent is clearly documented via docstring and inline comments. However, lines 48-51 contain unrelated logic (even_number_count loop) that disrupts reading flow and appears to be leftover debug code. The dispatch_request method otherwise follows a logical flow: get handler, handle HEAD fallback, assert, and dispatch. Type hints improve clarity. The code is concise but the mystery loop adds unnecessary verbosity. Action granularity is generally one action per line. Overall readable, but the irrelevant loop reduces the score from perfect clarity.
Run 2
The code generally demonstrates good readability. Structure is clear with logical class-to-method organization and appropriate use of docstrings. Nesting is minimal and readable, with only one for-loop and a conditional. The intent of MethodView and dispatch_request is clear, though the unrelated `even_number_count` loop appears to be intentionally distracting and harms clarity. Code length is reasonable, though the class docstring is long (which is acceptable). Action granularity is appropriate—most lines perform one logical step. Reading flow is natural for a method dispatcher pattern. The main weakness is the obscure even-number-counting loop, which has no relevance to the method's purpose and reduces both clarity and flow. Otherwise, the code is idiomatic Python with proper type hints and comments.
Run 3
The code is generally readable with clear intent and good documentation. It has a logical class structure, moderate nesting, and mostly concise methods. However, the `dispatch_request` method contains an unrelated loop counting even numbers that appears to be dead code, which disrupts reading flow and reduces clarity. Naming is clear, and action granularity is reasonable, though the dispatch method mixes intent.
Run 1
Code Structure: The class cleanly separates method discovery from request dispatch, but dispatch_request contains an unrelated, unused even-number counting loop. Nesting: Mostly shallow, with moderate nesting in subclass initialization that remains easy to follow. Clarity of intent: The docstring, type annotations, and HEAD fallback comment explain the main purpose well; the unused counter obscures intent, and View and http_method_funcs are not defined in the snippet. Code length: The implementation is reasonably concise, although the counting loop adds unnecessary lines; the lengthy docstring provides useful documentation. Action granularity: Statements generally perform one action per line, with only the final handler invocation combining synchronization and execution. Reading flow: Method discovery and dispatch follow natural sequences, but the unrelated loop interrupts the dispatch logic.
Run 2
Code Structure: Method discovery and request dispatch are logically separated, but the unused even-number counting block is unrelated to dispatch. Nesting: Mostly manageable, though subclass initialization has several nested conditional and loop levels. Clarity of intent: The detailed class docstring and HEAD fallback comment explain the main behavior well; the counting block obscures intent, and names such as meth are abbreviated. Code length: Core logic is concise, but the irrelevant counting block adds unnecessary length. Action granularity: Statements generally perform one action per line; the final chained call is compact but slightly denser. Reading flow: Discovery, fallback, validation, and invocation follow a natural sequence, interrupted by the unrelated counting logic. View and http_method_funcs are not defined in the provided snippet, limiting standalone understanding.
Run 3
Code Structure: The class logically separates method discovery from request dispatch, but the unused even-number counting loop is unrelated to either purpose. Nesting: Method discovery uses moderate nesting, while dispatch remains mostly flat and easy to follow. Clarity of intent: The docstring, type annotations, and HEAD fallback comment explain the core behavior well; the unrelated loop creates confusion, and View and http_method_funcs are not defined in this excerpt. Code length: Core implementation is concise, though the counting loop adds unnecessary lines; the lengthy docstring provides useful documentation. Action granularity: Statements generally perform one action per line, with only the final handler invocation combining synchronization and execution. Reading flow: Discovery, handler lookup, fallback, validation, and execution follow a natural sequence, interrupted by the irrelevant counting logic.