Sample
pyint-e7601f2d1d27-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.208 | 0–1; higher is more readable |
| Mi | 0.561 | 0–1; higher is more readable |
| LLOC | 99 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.28 | 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. | 6792.205 | −224.143 |
| Source linesThe number of non-empty source lines. | 217 | +86.8 |
| 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.273 | −6.41 |
Intercept 8.87 + feature contributions = -134.883 (log-odds).
Score = sigmoid(-134.883) = 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. | 218 | −6.682 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 200 | +6.181 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 200 | −4.169 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 216.938 | +2.623 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 95.945 | +0.744 |
| 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. | 95.963 | −0.399 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.297 |
Intercept 0.07 + feature contributions = -1.336 (log-odds).
Score = sigmoid(-1.336) = 0.208.
| Score | 0.561 |
|---|
| Score | 99 |
|---|
Run 1
The code demonstrates strong readability through logical organization and clear type hints. Imports are grouped by standard library, third-party, and local modules. The class has a single responsibility with well-named methods and thorough docstrings. The `path_url` method is cleanly structured with clear variable names, though the unused `remaining_steps` loop (lines 53-56) is confusing dead code that should be removed. Nesting is generally controlled, though `_encode_files` reaches 3-4 levels in the file handling loop. Intent is clear throughout—each method's purpose is documented and self-evident from naming. Action granularity is excellent, with one logical operation per line. The reading flow is natural and progressive. Minor deductions: the dead loop, slightly deep nesting in file processing, and the `type: ignore` comment on line 96 suggest potential cleanup. Overall this is professional-quality code that balances completeness with clarity.
Run 2
The code has clear docstrings and type hints, and the class structure is logical. However, readability is hampered by a few issues. The path_url property contains a pointless while-loop with no effect, which obscures intent. The _encode_params method has multiple overloads, which is good for typing but makes the signature block long and visually heavy. The _encode_files method is quite long and handles many branches (string validation, field encoding, file tuple unpacking), making it harder to follow. Some nested if/else blocks and loops are flat but still require careful reading to understand. The parameter handling repeats patterns from _encode_params, and variable names like 'ft', 'fh', 'fn', 'fp', 'fdata' are terse. Overall, the code is maintainable for experienced developers, but the dense logic and redundant loop reduce clarity.
Run 3
The code demonstrates moderate readability with clear type hints and logical organization of methods, but contains several concerning elements. The 'path_url' property includes a nonsensical while loop that serves no purpose, suggesting leftover debug code that confuses readers. Overloaded `_encode_params` methods add complexity for marginal benefit and make intent harder to follow. Deep conditional nesting in both `_encode_params` and `_encode_files` methods obscures the main data flow paths. Multiple operations packed into list comprehensions and conditional statements reduce action granularity. The tuple unpacking logic for file handling (2-tuple vs 3-tuple vs 4-tuple) lacks explanatory comments or named variables, making it difficult to understand parameter meaning. While imports are organized and type annotations are thorough, the inconsistent handling of similar data transformation patterns between methods hampers reading flow. Variable naming like 'p', 'ft', 'fh', 'rf' prioritizes brevity over clarity.
Run 1
Code Structure: Methods are logically grouped in an encoding mixin, with clear separation between URL, parameter, and multipart handling. Nesting: Parameter and file encoding contain several nested loops and conditionals, making some paths harder to follow. Clarity of intent: Descriptive method names, docstrings, and type annotations explain the purpose, but abbreviated variables such as k, vs, fn, fp, ft, and fh obscure details. The pointless countdown loop in path_url is especially distracting. Code length: Most logic is reasonably concise, though extensive imports, overload declarations, and the redundant loop add reading overhead. Action granularity: Statements generally perform one action per line, with tuple unpacking and conditional expressions remaining manageable. Reading flow: Processing follows a natural validation-to-transformation-to-return sequence, but nested conversions, repeated type checks, and inconsistent spacing occasionally interrupt that flow.
Run 2
Code Structure: Imports and related encoding methods are logically grouped within a cohesive mixin. Nesting: Parameter and file encoding use several nested loops and conditionals, increasing cognitive load. Clarity of intent: Descriptive method names, docstrings, and type annotations explain the purpose well, but abbreviated variables such as ft, fh, fn, and fp obscure details. The pointless countdown loop in path_url is particularly distracting. Code length: Mostly justified by supported input formats, although overload declarations add visual bulk and the countdown adds unnecessary code. Action granularity: Statements generally perform one action per line, with multiline expressions formatted clearly. Reading flow: Methods follow a sensible validation, normalization, encoding, and return sequence, but repeated type checks, nested conversions, and inconsistent variable naming interrupt smooth reading.
Run 3
Code Structure: Methods are logically separated by URL construction, parameter encoding, and multipart encoding; imports are organized. Nesting: Encoding routines contain several nested loops and conditionals, increasing cognitive load. Clarity of intent: Docstrings, type annotations, and descriptive method names explain purpose well, but abbreviated variables such as k, vs, fp, ft, and fh obscure details. The unused countdown loop in path_url is especially distracting and unexplained. Code length: Mostly justified by supported input formats, though overload declarations, verbose tuple construction, and the pointless loop add reading overhead. Action granularity: Statements generally perform one action per line, with conditional expressions occasionally combining conversion and selection. Reading flow: Validation followed by transformation and return is natural, but repeated normalization logic and dense branching interrupt an otherwise coherent flow.