Sample
pyint-9e709fdc4302-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.277 | 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 | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17.33 | 0–20; mean of three runs |
| BTTF | 0.782 | 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. | 242.899 | −8.016 |
| 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.411 | −6.616 |
| Source linesThe number of non-empty source lines. | 12 | +4.8 |
Intercept 8.87 + feature contributions = -0.961 (log-odds).
Score = sigmoid(-0.961) = 0.277.
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 has a clear structure and short length, with simple intent. However, readability is reduced by redundant imports (`attr` and `attrs` both imported, though only one is used) and an unnecessary explicit `__init__` method that duplicates what `@attr.s(auto_detect=True)` would generate. The `re` and `typing` imports are unused, adding noise. There is minimal nesting and one action per line, but the mixed use of `attr` and `attrs` creates ambiguity. Overall, it is understandable but contains clutter that slightly obscures purpose.
Run 2
The code is concise and logically organized, with clear imports and a single class definition. The class uses decorators appropriately and maintains flat structure with no nesting or ambiguous intent. The 'AutoDetect' class and its 'x' attribute are self-explanatory. However, the inclusion of both 'attr' and 'attrs' imports appears redundant or potentially conflicting, slightly reducing clarity. The redundant explicit __init__ method also adds unnecessary length since 'attr.s(auto_detect=True)' would generate it automatically. Overall, the code is highly readable but could be slightly improved by removing the redundant import and __init__ method.
Run 3
The code is clean, concise, and well-structured. It has minimal nesting, clear intent (defining a simple class with auto-detection attributes), and no unnecessary complexity. Each action is on its own line, and the reading flow is natural. Minor deductions for a redundant explicit __init__ since attrs auto-generates it, and unused imports (re, Dict, List, Tuple, Any) which slightly reduce clarity.
Run 1
Code Structure: Imports and a single class are logically organized, though unused imports add clutter. Nesting: Shallow, with only a class and its initializer. Clarity of intent: The typed attribute and straightforward assignment clearly show initialization, but the generic class name and unexplained auto-detection decorator provide limited context. Code length: Very concise, although unnecessary imports reduce economy. Action granularity: Each statement performs one action. Reading flow: Natural progression from imports to class declaration to initialization; additional spacing between import groups and the class would improve visual separation.
Run 2
Code Structure: Imports and the class are logically organized, although several imports are unused and importing both attr and attrs is distracting. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: The typed field and explicit constructor clearly show initialization, but the generic class name and auto_detect decorator require some library knowledge. Code length: Very concise, with minor clutter from unused imports. Action granularity: Each line performs a single action. Reading flow: Natural top-to-bottom flow; an additional blank line before the top-level class would improve formatting.
Run 3
Code Structure: Imports and the class are logically organized, 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 typed attribute and straightforward assignment clearly describe initialization, but the generic class name and unexplained auto_detect setting leave the broader purpose unclear. Code length: Very concise, although unused imports are unnecessary. Action granularity: Each statement performs one action. Reading flow: Natural top-to-bottom flow, with minor formatting issues: imports are not grouped by source, and the top-level class would conventionally have two blank lines before it.