Sample
pyint-431120fd198b-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.792 | 0–1; higher is more readable |
| Mi | 0.395 | 0–1; higher is more readable |
| LLOC | 25 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.33 | 0–20; mean of three runs |
| BTTF | 0.591 | 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. | 1176 | −38.808 |
| Source linesThe number of non-empty source lines. | 60 | +24 |
| 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.496 | −6.744 |
Intercept 8.87 + feature contributions = -12.682 (log-odds).
Score = sigmoid(-12.682) = 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. | 61 | −1.123 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 82.934 | +0.534 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.048 | +0.479 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 59.738 | +0.425 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 33 | +0.404 |
| 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. | 82.984 | +0.15 |
Intercept 0.07 + feature contributions = 1.337 (log-odds).
Score = sigmoid(1.337) = 0.792.
| Score | 0.395 |
|---|
| Score | 25 |
|---|
Run 1
The code is generally well-structured with a clear docstring, helper classes, and minimal nesting. However, readability is reduced by unclear variable names like 'met', 'bas', 'kwa', 'met2', 'kwa2', and 'key2', which obscure intent. Line-level logic is mostly clear, and the control flow is flat (no deep nesting). The docstring is excellent. Overall, it's readable but would benefit from more descriptive variable names and slightly more contextual comments.
Run 2
The code is well-structured with clear class-level organization and separation of concerns. The MethodView class has a logical flow, with __init_subclass__ handling method registration and dispatch handling request routing. Nesting is minimal—loops are shallow and conditionals are simple. Intent is clearly conveyed through descriptive variable names like 'met' for methods and 'bas' for base classes, though these abbreviations slightly reduce clarity. Code length is appropriate without being verbose. Most lines perform a single action, maintaining good granularity. The reading flow is natural: class docstring, method definitions, then implementation details. Minor deductions include abbreviated variable names ('met', 'bas', 'kwa') that could be more explicit, and the type ignore comments add slight noise. Overall, it is highly readable for experienced Python developers, with only minor naming choices preventing a higher score.
Run 3
The code is generally well-structured with clear class and method organization. The docstring provides excellent context and usage examples, improving clarity of intent. Nesting is shallow with only one level in conditionals and loops. However, variable names like 'met', 'bas', 'key2', 'met2', and 'kwa2' are cryptic and reduce readability significantly. The assert statement combines error checking with f-string formatting in a single line, reducing action granularity. The dispatch method logic is concise but could benefit from better variable naming to clarify that 'met2' represents a method handler. The mix of abbreviated and full names creates inconsistency. The type annotations and comments help maintain clarity, but the abbreviated naming pattern detracts from the overall readability despite otherwise clean structure and acceptable length.
Run 1
Code Structure: The class cleanly separates method discovery from request dispatch, although View and http_method_funcs are not defined or imported in the snippet. Nesting: Subclass initialization has moderate nesting, while dispatch remains mostly flat. Clarity of intent: The detailed docstring and HEAD fallback comment explain behavior well, but abbreviated names such as met, bas, kwa, key2, and met2 obscure their roles. Code length: The implementation is concise; the longer docstring provides useful documentation and an example. Action granularity: Most lines perform one action, although the final return combines handler synchronization and invocation. Reading flow: Organization is natural, progressing from documentation to setup and dispatch, but weak variable names and missing context slightly interrupt comprehension.
Run 2
Code Structure: Two focused methods logically separate automatic method discovery from request dispatch. Nesting: Discovery uses moderately nested loops and conditionals, while dispatch remains flat and easy to follow. Clarity of intent: The detailed class docstring and HEAD fallback comment explain behavior well, but abbreviated names such as met, bas, key2, met2, and kwa2 obscure meaning. View and http_method_funcs are not defined or imported in the snippet, reducing standalone clarity. Code length: The implementation is concise; the longer docstring provides useful documentation and an example rather than unnecessary code. Action granularity: Most lines perform one clear action, although the final return combines synchronization wrapping and handler invocation. Reading flow: Discovery proceeds naturally from inherited methods to available handlers, and dispatch follows lookup, fallback, validation, and invocation. More descriptive variable names and clearer dependency context would improve readability.
Run 3
Code Structure: Two focused methods logically separate supported-method discovery from request dispatch. Nesting: Discovery uses moderate nesting with loops and conditionals, while dispatch remains mostly flat. Clarity of intent: The detailed class docstring and HEAD fallback comment explain behavior well, but abbreviated names such as met, met2, bas, kwa, and key2 obscure meaning. View and http_method_funcs are not defined or imported in the snippet, limiting standalone comprehension. Code length: Implementation is concise; the lengthy docstring provides useful documentation and an example rather than unnecessary code. Action granularity: Most lines perform one clear action, although the final return combines handler synchronization and invocation. Reading flow: Discovery proceeds naturally from inherited methods to implemented handlers, and dispatch follows lookup, fallback, validation, and execution. More descriptive identifiers and clearer import completeness would improve readability.