Sample
pyint-cfc19c147dfb-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.265 | 0–1; higher is more readable |
| Dorn | 0.853 | 0–1; higher is more readable |
| Mi | 0.751 | 0–1; higher is more readable |
| LLOC | 9 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17.33 | 0–20; mean of three runs |
| BTTF | 0.783 | 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. | 245.345 | −8.096 |
| 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.397 | −6.596 |
| Source linesThe number of non-empty source lines. | 12 | +4.8 |
Intercept 8.87 + feature contributions = -1.023 (log-odds).
Score = sigmoid(-1.023) = 0.265.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 40.846 | +1.935 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 13 | +0.576 |
| 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. | 12 | −0.322 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 11.786 | −0.245 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.082 | +0.148 |
Intercept 0.07 + feature contributions = 1.755 (log-odds).
Score = sigmoid(1.755) = 0.853.
| Score | 0.751 |
|---|
| Score | 9 |
|---|
Run 1
The code is short and mostly clear, but has several issues. The redundant imports (attr and attrs, List/Tuple/Any/Dict but unused, re unused) reduce clarity. The custom __init__ in an attrs class alongside auto_detect=True is confusing—it partially defeats the library’s purpose and may mislead readers about intended behavior. Structure is logical but imports are disorganized. Nesting is flat, which is good. Action granularity and reading flow are acceptable, though the unused imports and redundant constructor hurt intent clarity. Length is concise but the extra lines add noise.
Run 2
The code is short and technically valid, but its readability suffers from several major issues. The class definition is confusing: it uses both `@attr.s(auto_detect=True)` and an explicit `__init__`, which conflicts and undermines clarity of intent. The `auto_detect=True` parameter is redundant since type annotations are present. Unused imports (`re`, `typing`, `attrs`) add clutter and ambiguity about intended functionality. The class name `AutoDetect` is vague and does not reflect its actual role. While nesting is non-existent and the code is concise, it fails to provide meaningful context or purpose. Overall, the excessive imports, contradictory decorator usage, and unclear naming significantly reduce readability.
Run 3
The code is concise and clearly structured. It imports only what is needed, defines a single class with a straightforward purpose, and uses explicit type annotations. The class is small and flat with no nested logic. The use of `@attr.s(auto_detect=True)` alongside a manual `__init__` is slightly redundant, but not unclear. There is one action per line and the reading flow is natural. Minor deductions are for the duplicate `import attr` and `import attrs`, and the unused imports (`re`, `Any`, `Dict`, `List`, `Tuple`), which slightly reduce clarity. Overall, the code is highly readable.
Run 1
Code Structure: A straightforward class with logically arranged imports, annotation, and initializer, though several imports are unused and importing both attr and attrs adds clutter. Nesting: Minimal, with only a class and its initializer. Clarity of intent: The assignment is clear, but generic names AutoDetect, x, and a provide little domain context, and the decorator's auto-detection behavior requires library knowledge. Code length: Very concise, apart from unnecessary imports. Action granularity: Each line performs a single action. Reading flow: Natural top-to-bottom progression, though an additional blank line before the class decorator would improve standard Python formatting.
Run 2
Code Structure: Imports and the class are logically organized, although several imports are unused. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: The class clearly stores an integer, but generic names such as AutoDetect, x, and a provide little domain context, and the decorator requires familiarity with attr. Code length: The implementation is concise, though unused imports add clutter. Action granularity: Each line performs a single action. Reading flow: The flow from imports to class declaration to initialization is natural; additional blank lines between import groups and before the class would improve formatting.
Run 3
Code Structure: Imports and the class are logically organized, although several imports are unused and importing both attr and attrs adds clutter. Nesting: Minimal, with only a class and its initializer. Clarity of intent: The class clearly stores an integer in x, though generic names AutoDetect, a, and x provide little domain context, and auto_detect requires familiarity with the library. Code length: Very concise, but unnecessary imports reduce focus. Action granularity: Each statement performs one action. Reading flow: Straightforward from imports to class definition to initialization; additional spacing between imports and the class would improve visual separation.