Sample
pyint-2115b34e2716-I10
Deterministically remove some optional blank lines and bracketed line breaks
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.652 | 0–1; higher is more readable |
| Mi | 0.401 | 0–1; higher is more readable |
| LLOC | 25 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs |
| BTTF | 0.471 | 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. | 1248.238 | −41.192 |
| Source linesThe number of non-empty source lines. | 32 | +12.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.546 | −6.819 |
Intercept 8.87 + feature contributions = -26.341 (log-odds).
Score = sigmoid(-26.341) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 109 | +0.954 |
| 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. | 109 | −0.952 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 31 | +0.335 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.109 | −0.116 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 32 | −0.097 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 31.709 | +0.033 |
Intercept 0.07 + feature contributions = 0.626 (log-odds).
Score = sigmoid(0.626) = 0.652.
| Score | 0.401 |
|---|
| Score | 25 |
|---|
Run 1
The code is generally clear and well-structured, following common patterns for a descriptor class. It uses type hints effectively, and methods have clear, single responsibilities. The constructor's unusual spacing slightly hurts readability, and the fragmented class structure (with scattered methods) adds minor visual clutter. The overloaded __get__ signatures are clear for type-aware readers. Overall, the code is concise with good logical organization and natural reading flow, but small formatting and structural choices prevent a perfect score.
Run 2
The code is generally clean and well-structured, with clear intent and type hints. However, a few issues reduce readability: the constructor's parameter list is split across multiple lines awkwardly, the `te.Self` reference appears undefined (likely a typo for `typing.Self`), and `__get__` and `__set__` are on adjacent lines without a blank line between them. The overloads add clarity but also increase visual clutter. Overall, it is concise and logically organized but has minor formatting inconsistencies.
Run 3
The code is generally readable and follows common patterns for descriptors, but has several issues that reduce clarity. The conditional return in __get__ creates multiple exit paths and the converter check is nested. There's an undefined 'te' namespace used for 'Self' type hints, and inconsistent formatting with unusual line breaks in __init__. The lack of docstrings on methods (aside from the class) and no type checking on the config access makes the intent slightly ambiguous. The reading flow is disrupted by awkward line breaks and missing whitespace between methods. The overall structure is logical but the implementation could be more concise and consistent.
Run 1
Code Structure: The descriptor class is logically organized into initialization, retrieval, and assignment, but spacing between methods is inconsistent and several imports appear unused. Nesting: Control flow is shallow, with straightforward conditionals and early return. Clarity of intent: The docstring, method names, and type annotations clearly communicate configuration forwarding and optional conversion, although T, te, and App are not defined in the snippet, and rv is a vague name. Code length: The implementation is concise without unnecessary logic, though imports add clutter. Action granularity: Each executable line performs a single action. Reading flow: Operations follow a natural sequence, but excessive spacing in the constructor signature and tightly packed overload declarations interrupt readability.
Run 2
Code Structure: The descriptor class logically groups initialization, retrieval, and assignment, though missing definitions for T, te, and App and unused imports make the snippet less self-contained. Nesting: Shallow conditionals keep the implementation easy to follow. Clarity of intent: The docstring and config access clearly convey attribute forwarding; annotations communicate expected types, although rv is a vague name. Code length: The implementation is concise, with some unnecessary imports. Action granularity: Statements generally perform one action per line; compact overload declarations remain understandable. Reading flow: Retrieval follows a natural sequence of checking the instance, accessing configuration, optionally converting, and returning. However, irregular spacing in __init__ and missing blank lines between some methods reduce visual consistency.
Run 3
Code Structure: The descriptor class is logically organized into initialization, retrieval, and assignment, but missing spacing between methods weakens separation. Nesting: Shallow conditionals and an early return keep complexity low. Clarity of intent: The docstring and config access make the forwarding behavior clear, although the undefined names T, te, and App obscure typing context, and rv is a vague variable name. Code length: The implementation is concise, but several unused imports introduce clutter. Action granularity: Statements generally perform one action per line; compact overload declarations remain understandable. Reading flow: Operations follow a natural sequence, but irregular whitespace in the constructor, tightly packed overloads, and inconsistent blank lines interrupt scanning.