Sample
pyint-97f4f25ca805-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.629 | 0–1; higher is more readable |
| Mi | 0.726 | 0–1; higher is more readable |
| LLOC | 29 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.337 | 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. | 1435.503 | −47.372 |
| Source linesThe number of non-empty source lines. | 40 | +16 |
| 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.521 | −6.781 |
Intercept 8.87 + feature contributions = -29.282 (log-odds).
Score = sigmoid(-29.282) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 39 | +0.612 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 85.976 | +0.583 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 39 | −0.474 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 40 | −0.38 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 39.667 | +0.145 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.102 | −0.054 |
| 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. | 85.951 | +0.025 |
Intercept 0.07 + feature contributions = 0.526 (log-odds).
Score = sigmoid(0.526) = 0.629.
| Score | 0.726 |
|---|
| Score | 29 |
|---|
Run 1
The code uses clear typing, docstrings, and logical organization, but has several readability issues. The unused loop counting even numbers in __init__ serves no purpose and confuses intent. Nesting is minimal and reading flow is generally natural, but the overloaded __get__ methods and type annotations add complexity. Action granularity is mostly one action per line, though the even-number loop could be condensed. Missing imports (te, App) reduce clarity unless assumed from context. Overall, the structure is sound but the dead code and ambiguous annotations detract from readability.
Run 2
The code is mostly readable but has a confusing, unrelated loop at the start of the __init__ method that distracts from its purpose. The class structure and type hints are clear, and actions are well-separated. However, the dead code reduces clarity and adds unnecessary length. The nested conditionals are shallow, and the intention of ConfigAttribute is evident despite the flaw. Overall readability is moderate.
Run 3
The code shows reasonable structure and type hints, but contains a confusing, unrelated loop (counting even numbers) inside `__init__` that has no apparent purpose and significantly harms clarity. Nesting is generally flat, and the descriptor pattern is recognizable, but the dead code blocks the reading flow. Action granularity is mostly fine, though the redundant counting loop adds unnecessary length and distracts from the config-forwarding intent. The overloads are clear once understood, but the initial constructor contains unexplained logic that violates the principle of clear intent. Overall, the code is readable in parts but undermined by a meaningless block that looks like test residue or accidental insertion.
Run 1
1. Code Structure: The descriptor class is logically organized into initialization, retrieval, and assignment, but the unrelated counting loop disrupts cohesion. 2. Nesting: Mostly shallow, with straightforward guard clauses; the unnecessary loop adds avoidable nesting. 3. Clarity of intent: The docstring, method names, and converter make the configuration-forwarding purpose clear. However, undefined names T, te, and App obscure dependencies, and rv is less descriptive than value. 4. Code length: Generally concise, but the unused even-number calculation adds distracting lines. 5. Action granularity: Each statement performs a single action, and overload declarations are compact without being confusing. 6. Reading flow: Standard descriptor ordering and whitespace support natural reading, although the irrelevant initialization logic interrupts it.
Run 2
Code Structure: The descriptor is logically organized into initialization, getter overloads, retrieval, and assignment, but the unrelated even-number counting loop disrupts cohesion. Nesting: Mostly flat, with only a shallow loop and conditional in the constructor. Clarity of intent: The docstring and method names clearly express config forwarding, but undefined names T, te, and App make the snippet less self-contained; rv is also vague. Code length: Compact overall, although the unused counting logic is unnecessary. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Methods follow a natural lifecycle and the getter uses a clear early return, but unused imports, extraneous constructor work, and missing type definitions interrupt comprehension.
Run 3
Code Structure: The descriptor is logically organized into initialization, retrieval, and assignment methods, but the unrelated even-number counting loop disrupts cohesion. Nesting: Mostly flat, with only a shallow loop and conditional in the constructor. Clarity of intent: The docstring, method names, and conversion logic make configuration forwarding clear; undefined T, te, and App references and the unused count introduce ambiguity. Code length: Compact overall, but the counting loop and several unused imports add unnecessary content. Action granularity: Statements generally perform one action per line, supporting easy scanning. Reading flow: The standard descriptor layout and early return provide a natural progression, although irrelevant initialization work and unexplained type dependencies interrupt it.