Sample
pyint-4bdf396f2be7-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.872 | 0–1; higher is more readable |
| Mi | 0.508 | 0–1; higher is more readable |
| LLOC | 33 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 10.33 | 0–20; mean of three runs |
| BTTF | 0.697 | 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. | 1816.539 | −59.946 |
| Source linesThe number of non-empty source lines. | 85 | +34 |
| 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.645 | −6.967 |
Intercept 8.87 + feature contributions = -24.043 (log-odds).
Score = sigmoid(-24.043) = 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. | 86 | −2.009 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 71 | +1.719 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 84.938 | +0.777 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 94.965 | +0.728 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.036 | +0.59 |
| 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. | 94.977 | −0.358 |
Intercept 0.07 + feature contributions = 1.916 (log-odds).
Score = sigmoid(1.916) = 0.872.
| Score | 0.508 |
|---|
| Score | 33 |
|---|
Run 1
The code is generally clear and well-structured with logical imports grouped by source (stdlib, third-party, local) and a simple class definition. Nesting is flat, intent is explicit through type hints and docstrings, and length is reasonable. However, readability is slightly reduced by several naming mismatches: the method `sort` should logically be `send`, and its parameters (`summary`, `config`, `address`, `source`, `date`, `channel`) do not match the documented names (`request`, `stream`, `timeout`, `verify`, `cert`, `proxies`), creating ambiguity. Method `write` likely should be `close`. Action granularity and reading flow are otherwise fine, but the parameter/docstring discrepancy prevents a higher score.
Run 2
The code has good structure with clear imports and a well-organized class definition. Naming is inconsistent and confusing: the BaseAdapter class has methods named 'sort' and 'write' that do not match their docstrings ('Sends PreparedRequest', 'Cleans up adapter'). The 'send' method's parameters are obfuscated (summary, config, address, source, date, channel instead of request, stream, timeout, verify, cert, proxies). Docstrings are thorough and helpful, but they describe the original parameter names, not the obfuscated ones. The code is relatively flat with minimal nesting, and each method has a single clear action (raise NotImplementedError). Imports are logical and well-grouped. Overall, the structure is clean but the misleading naming hurts clarity of intent significantly.
Run 3
The code has clear strengths: organized imports (orderly groups from stdlib to third-party to local), short simple classes, one action per line, and reasonable docstrings. The BaseAdapter class is structurally clean with flat methods and good separation. However, significant readability issues hurt the score. The `sort` method has misleading parameter names (summary, config, address, source, date, channel) that do not match what the implementation suggests (request, stream, timeout, verify, cert, proxies), creating a severe clarity-of-intent problem. The docstring references parameters that do not align with the actual signature, further confusing readers. Type hints are inconsistent, with some parameters using `_t.TimeoutType` and `_t.VerifyType` while others use inline types. The unused `socket` import with `# noqa` adds noise. The `from __future__ import annotations` and `typing` import appear at top level without clear necessity. Both methods raise `NotImplementedError`, which may be intentional for an abstract base, but the class does not inherit from `ABC` or use `@abstractmethod`, creating ambiguity about its intended usage. Overall, structure is decent but naming inconsistencies and docstring mismatches undermine readability.
Run 1
1. Code Structure: Imports and a small adapter class are logically separated, but numerous unused imports overwhelm the implementation. 2. Nesting: Methods are flat, with no nested control flow, making them easy to scan. 3. Clarity of intent: The adapter abstraction is recognizable, but names such as sort, write, summary, and date obscure transport operations. The docstring describes parameter names absent from the signature, and PreparedRequest and _t are not defined or imported in the snippet. 4. Code length: Method bodies are concise, but excessive imports and mismatched documentation add unnecessary reading. 5. Action granularity: Each statement performs one action, and the multiline signature is readable. 6. Reading flow: Conventional formatting helps, but readers must reconcile misleading names, documentation, and unresolved type references.
Run 2
1. Code Structure: Imports and the adapter class are logically separated, but many imports are unused in this snippet, obscuring its small scope. 2. Nesting: Flat methods with no nested control flow are easy to scan. 3. Clarity of intent: The abstract transport-adapter purpose is recognizable, but names such as sort, write, summary, and date are misleading. The sort docstring describes different parameter names from those in its signature, and PreparedRequest and _t are not defined or imported here. 4. Code length: Method bodies are concise, but extensive imports and mismatched documentation disproportionately lengthen this minimal interface. 5. Action granularity: Each statement performs one action, and multiline signatures and imports remain readable. 6. Reading flow: Conventional formatting helps, but readers must reconcile naming, annotations, and documentation to understand the intended API.
Run 3
Code Structure: Imports are grouped and the adapter class is logically organized, but many imports are unused in this snippet, and PreparedRequest and _t lack visible definitions. Nesting: Very flat, with no complex control flow. Clarity of intent: The largest weakness; sort and write obscure the intended send and cleanup operations, while parameters such as summary, address, and date conflict with the request, timeout, and certificate terminology in the docstring. Code length: The class is concise, but the extensive import block and mismatched documentation add reading overhead. Action granularity: Statements generally perform one action per line, and multiline signatures are easy to scan. Reading flow: Conventional layout helps, but readers must reconcile misleading names, documentation, and unresolved type references to understand the interface.