Sample
pyint-0cb8277fbea4-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.893 | 0–1; higher is more readable |
| Mi | 0.561 | 0–1; higher is more readable |
| LLOC | 60 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.494 | 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. | 4437.184 | −146.427 |
| Source linesThe number of non-empty source lines. | 162 | +64.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.616 | −6.924 |
Intercept 8.87 + feature contributions = -79.681 (log-odds).
Score = sigmoid(-79.681) = 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. | 163 | −4.735 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 135 | +3.932 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 161.922 | +1.854 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 101.939 | +0.84 |
| 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. | 101.963 | −0.654 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.054 | +0.417 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 2.122 (log-odds).
Score = sigmoid(2.122) = 0.893.
| Score | 0.561 |
|---|
| Score | 60 |
|---|
Run 1
The code is highly readable with clear structure, minimal nesting, and explicit intent. Imports are logically grouped by source and alphabetized. The class has a clear docstring with examples, well-defined type hints, and defaults handled consistently. Each action in __init__ is concise, with one action per line, improving traceability. The prepare() method cleanly delegates to PreparedRequest. Minor deductions: the long import block adds vertical length, and some annotations (e.g., _t.UriType | None) slightly reduce readability for non-expert readers, but overall this is professional, maintainable code.
Run 2
The code is moderately readable. It has a clear class structure with type annotations and a well-documented docstring. The __init__ method logically defaults mutable arguments to empty containers and assigns attributes in a straightforward manner. However, the extensive import block at the top is long and could obscure the purpose of the module. The prepare method is clear but could be simplified by unpacking self attributes. The code is not deeply nested, and each action is generally on one line. The reading flow is mostly natural, but the import section detracts from immediate understanding. Overall, it is maintainable but not exceptionally concise.
Run 3
The code is generally well-structured and readable. It uses clear type hints, logical organization of imports, and a straightforward class definition with a concise constructor. The action granularity is good, with one action per line in most cases, and the reading flow is natural. However, it's not perfect: the large number of imports at the top (while organized) could be seen as lengthy, and the constructor relies on repetitive default-value handling (`data = [] if data is None else data`) rather than using more concise patterns. The class attributes before `__init__` are helpful but add length. The `prepare()` method is simple and clear, but could be slightly more concise. The nesting is minimal, and the intent is clear — this is a `Request` object that prepares an HTTP request. Overall, it's highly readable but has minor opportunities for conciseness.
Run 1
Code Structure: The class is logically organized into documentation, attribute annotations, initialization, representation, and preparation, although the extensive import block distracts from the small implementation. Nesting: Control flow is shallow, with only one simple loop. Clarity of intent: Descriptive names, type annotations, parameter documentation, and a usage example make the request object's purpose clear; the abbreviated variable p and externally defined types and mixin require some context. Code length: The implementation is concise, but lengthy documentation, imports, and repeated parameter forwarding increase scanning effort. Action granularity: Statements generally perform one action per line, and multiline calls are easy to inspect. Reading flow: Initialization proceeds naturally from default normalization to hook registration and attribute assignment, followed by representation and preparation. Overall, the code is highly readable, with minor overhead from boilerplate and dependencies not defined in the excerpt.
Run 2
Code Structure: The class is logically organized into documentation, attribute annotations, initialization, representation, and preparation, though the extensive import block distracts from the small implementation. Nesting: Control flow is shallow, with only a simple loop. Clarity of intent: Descriptive method names, type hints, parameter documentation, and a usage example clearly communicate purpose; the abbreviated variables p, k, and v are less expressive, and several referenced types and base classes are not defined in the excerpt. Code length: The implementation is concise, but imports and repeated parameter declarations add considerable visual overhead. Action granularity: Statements generally perform one action per line, and multiline arguments remain easy to scan. Reading flow: Initialization proceeds naturally from defaults to hooks to attribute assignments, followed by preparation; consistent formatting supports readability, although missing surrounding definitions make the excerpt less self-contained.
Run 3
Code Structure: The class is logically organized into documentation, attribute annotations, initialization, representation, and preparation, though the extensive imports include many unused in this snippet. Nesting: Control flow is nearly flat, with only a simple hook-registration loop. Clarity of intent: Descriptive names, type annotations, and detailed documentation make the request object's purpose clear; unresolved references such as RequestHooksMixin slightly reduce standalone clarity. Code length: The implementation is concise, but imports, repeated field declarations, and parameter forwarding add substantial boilerplate. Action granularity: Statements generally perform one action per line, and multiline calls are easy to scan. Reading flow: Initialization proceeds naturally from defaults to hooks to attributes, followed by preparation; the long import section delays reaching the relevant logic.