Sample
pyint-ba6ef54631c0-I01
Remove comments and docstrings
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.87 | 0–1; higher is more readable |
| Mi | 0.504 | 0–1; higher is more readable |
| LLOC | 30 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.754 | 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. | 1785.296 | −58.915 |
| Source linesThe number of non-empty source lines. | 72 | +28.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.651 | −6.977 |
Intercept 8.87 + feature contributions = -28.221 (log-odds).
Score = sigmoid(-28.221) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 72 | +1.753 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 73 | −1.548 |
| 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. | 61.973 | +1.04 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 71.937 | +0.596 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.056 | +0.398 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 1.903 (log-odds).
Score = sigmoid(1.903) = 0.87.
| Score | 0.504 |
|---|
| Score | 30 |
|---|
Run 1
The code has clear imports and type hints, which aid readability, but it suffers from several issues. The structure is disorganized: an excessive number of imports are grouped without clear rationale, and the class definition is sparse with no meaningful logic, making it hard to evaluate intent. The nesting is flat, which is good, but the action granularity is poor—empty methods exist only to raise NotImplementedError, and the class has no cohesive purpose shown. The reading flow is broken by blank lines and a lack of comments or docstrings explaining the class's role. Overall, it is readable at a basic syntax level but fails to convey clear intent or structure.
Run 2
The code is generally readable with good organization of imports and clean type hints. However, it loses points for several issues: the class has an unnecessary super().__init__() call with no inheritance, method bodies contain only 'raise NotImplementedError' with excessive blank lines, and there's confusing use of both forward reference types (PreparedRequest, Response) and _t-prefixed type aliases without visible imports. The code is concise but lacks meaningful documentation, making intent unclear. Import structure is logical and well-grouped, but the unused imports at top (socket, os.path) would confuse readers. The nesting is flat which is good, and reading flow is natural, but there's insufficient context to understand the class's purpose or relationships. Mixing private module aliases (_t.TimeoutType) with plain type hints creates inconsistency. While readable at a syntax level, the code could be improved with docstrings, removal of unused imports, and clearer type definitions.
Run 3
The code is a Python module with imports and a base adapter class. Structure is logical with grouped imports, but there are many unused imports (warnings, socket, typing, etc.) and multiple import styles from urllib3 and local modules. The class has clear intent but lacks docstrings and meaningful implementation. The send method has many parameters, reducing readability. Nesting is flat, which is good, but the code is overly verbose due to redundant imports and aliasing. Action granularity is appropriate, but reading flow is disrupted by the excessive import block. Overall, it is a skeleton with room for cleanup and documentation.
Run 1
Code Structure: Imports are broadly grouped and the adapter class has clearly separated methods, but the disproportionately large import block obscures the small interface. Nesting: Very flat, with no nested control flow. Clarity of intent: BaseAdapter, send, close, and NotImplementedError communicate an interface, although missing documentation and unresolved PreparedRequest and _t references make the annotations harder to interpret. Code length: Method definitions are concise, but many imports are unused in this snippet, the constructor adds little, and excess blank lines create unnecessary length. Action granularity: Each statement performs one action, and the multiline signature is easy to scan. Reading flow: The class reads naturally from initialization to sending and cleanup, but inconsistent whitespace and the lengthy imports interrupt the overall flow.
Run 2
Code Structure: Imports precede a clearly organized adapter class, but the extensive unused imports obscure the small implementation. Nesting: Very flat, with no complex branches or nested logic. Clarity of intent: BaseAdapter, send, close, and NotImplementedError clearly signal an interface for subclasses; however, missing documentation and unresolved PreparedRequest and _t references reduce clarity. Code length: Methods are concise, but the import list and excessive blank lines are disproportionate to the functionality shown. Action granularity: Each statement performs one action, and the multiline signature makes parameters easy to scan. Reading flow: The class reads naturally from initialization to sending and cleanup, although inconsistent whitespace and distracting imports interrupt the flow.
Run 3
Code Structure: Imports are grouped before a simple adapter class, but many imports are unused in this snippet. Nesting: Very shallow, with no nested control flow. Clarity of intent: BaseAdapter and its abstract-style send and close methods communicate their roles, but missing docstrings and unresolved PreparedRequest and _t references reduce clarity. Code length: The class is concise, although the lengthy import section overwhelms its small implementation and the constructor adds little value. Action granularity: Each statement performs one action, and multiline signatures improve scanning. Reading flow: Method ordering is natural, but excessive blank lines, trailing whitespace, and inconsistent import organization interrupt an otherwise straightforward presentation.