Sample
pyint-209c667d3995-I09
Select one of ten low-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.672 | 0–1; higher is more readable |
| Mi | 0.535 | 0–1; higher is more readable |
| LLOC | 33 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.33 | 0–20; mean of three runs |
| BTTF | 0.436 | 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. | 1277.029 | −42.142 |
| Source linesThe number of non-empty source lines. | 70 | +28 |
| 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.623 | −6.934 |
Intercept 8.87 + feature contributions = -12.206 (log-odds).
Score = sigmoid(-12.206) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 71 | −1.478 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 50 | +0.992 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 50 | −0.727 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 69.859 | +0.567 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.045 | +0.503 |
| 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. | 76.93 | +0.407 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 73.676 | +0.384 |
Intercept 0.07 + feature contributions = 0.719 (log-odds).
Score = sigmoid(0.719) = 0.672.
| Score | 0.535 |
|---|
| Score | 33 |
|---|
Run 1
The code demonstrates mixed readability. The imports, class docstring, and Factory class structure follow standard Python conventions and are clear. However, the '__init__' method contains an obfuscated block of meaningless variable assignments ('lI0O_dc7d9ce4') that serve no functional purpose and severely damage clarity. This artificial complexity violates the criteria for clarity of intent, action granularity, and reading flow. The remaining methods ('__getstate__', '__setstate__') are concise and readable. Overall, the code is understandable but marred by a puzzling, unnecessary segment that reduces its readability score.
Run 2
The code generally shows decent structure with clear class definition, docstrings, and a simple Factory class. However, readability is undermined by several issues: an unnecessary and confusing bit-manipulation block of meaningless variable assignments in __init__, poor variable naming (lI0O_dc7d9ce4), and an unused import list that adds noise. The logic is straightforward but the injected obfuscation and dead code harm clarity. Nesting is minimal, and actions are mostly one per line, but intent is obscured by the contrived variable name and redundant operations. The class is concise except for the irrelevant code. Overall, it reads as if someone inserted junk code into otherwise clean code, reducing readability significantly.
Run 3
The code shows mixed readability. The imports, Factory class docstring, and pickle-related methods (__getstate__, __setstate__) are clear and follow good practices. However, the __init__ method contains obfuscated, dead code (the lI0O_dc7d9ce4 variable with bitwise operations) that does nothing, severely damaging clarity of intent and action granularity. This section is unnecessary length, adds confusing nesting, and breaks reading flow. While the overall structure is logical and the class simple, the presence of this garbled logic makes the code hard to trust and understand at a glance, justifying a low score.
Run 1
Code Structure: The class is logically organized into initialization and serialization methods, but numerous unused imports and unrelated initialization statements add clutter. Nesting: Mostly flat, with only a shallow conditional and loop. Clarity of intent: The class docstring, descriptive fields, and serialization methods communicate their purposes clearly; the cryptic variable and meaningless bitwise operations obscure initialization. Code length: The useful implementation is concise, but excessive imports and redundant calculations unnecessarily lengthen the snippet. Action granularity: Statements generally perform one action per line, though the compound bitwise expression increases cognitive load. Reading flow: Method ordering and documentation support a natural progression, but the obfuscated block interrupts an otherwise straightforward constructor.
Run 2
Code Structure: The class is logically organized into initialization and serialization methods, but numerous unused imports distract from its purpose. Nesting: Mostly flat, with only a shallow conditional and loop. Clarity of intent: The class docstring and descriptive field names clearly explain the factory wrapper, while the cryptic variable and pointless bitwise operations in __init__ obscure an otherwise simple initialization. Code length: Excessive imports and no-op statements unnecessarily lengthen a small class; the documentation is useful. Action granularity: Statements generally perform one action per line, although the compound bitwise expression adds needless complexity. Reading flow: Method ordering is natural and serialization logic is straightforward, but the unrelated computation interrupts the flow before the meaningful assignments.
Run 3
Code Structure: The class is logically organized into initialization and serialization methods, but numerous unused imports distract from the relevant code. Nesting: Mostly flat, with only a shallow conditional and loop. Clarity of intent: The docstring and descriptive member names explain the factory's purpose, while the opaque variable and meaningless bitwise operations obscure initialization. Code length: The class is otherwise concise, but redundant arithmetic and unused imports add unnecessary length. Action granularity: Each statement occupies its own line, although the bitwise expression combines several operations without an apparent purpose. Reading flow: Method ordering is natural and serialization is straightforward, but the unrelated initialization block interrupts the flow and forces readers to investigate dead logic.