Sample
pyint-971d0316dd39-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable |
| Dorn | 0.695 | 0–1; higher is more readable |
| Mi | 0.535 | 0–1; higher is more readable |
| LLOC | 29 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.709 | 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. | 1067.397 | −35.224 |
| Source linesThe number of non-empty source lines. | 66 | +26.4 |
| 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.508 | −6.762 |
Intercept 8.87 + feature contributions = -6.716 (log-odds).
Score = sigmoid(-6.716) = 0.001.
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. | 67 | −1.336 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 46 | +0.854 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 46 | −0.635 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.04 | +0.552 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 65.872 | +0.511 |
| 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.94 | +0.406 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 74.612 | +0.399 |
Intercept 0.07 + feature contributions = 0.822 (log-odds).
Score = sigmoid(0.822) = 0.695.
| Score | 0.535 |
|---|
| Score | 29 |
|---|
Run 1
The code has good structure with clear imports and a well-documented class. The Factory class uses __slots__ efficiently and has reasonable method separation. However, readability is undermined by several factors: poor naming (a, b, c, d, e, f instead of descriptive names like factory and takes_self), inconsistent documentation (docstring says 'factory' and 'takes_self' but parameters are 'a' and 'b'), and the pickle methods use cryptic variable names that obscure intent. The nesting is flat and action granularity is acceptable, but the reading flow breaks when encountering single-letter variables that require mental mapping back to the docstring. The class docstring is helpful but mismatched with the actual implementation, creating ambiguity about what parameters actually represent. Overall, the skeleton is readable but the variable naming choices significantly reduce clarity and maintainability.
Run 2
The code has good overall organization, with clear imports, a well-documented class, and simple methods. However, readability is hurt by the use of non-descriptive parameter names (`a`, `b`) in `Factory.__init__`, which makes intent unclear and reduces self-documentation. The `__getstate__` and `__setstate__` methods use loop-based logic with generic variable names (`c`, `d`, `e`, `f`), making them harder to follow at a glance; a simpler, more explicit approach would improve clarity. The nesting is shallow and action granularity is generally fine, but the lack of meaningful names in key places prevents a higher score.
Run 3
The code is generally well-structured with clear sections: imports, class definition, docstrings, and methods. Nesting is minimal. The Factory class has a clear purpose and its docstring explains both parameters and notes the versionadded tag. However, readability is reduced by cryptic variable names: `a` and `b` in __init__, `c` and `d` in __getstate__/__setstate__, and `e`/`f` in the loop. These single-letter names obscure intent and force the reader to infer meaning from context. The __getstate__/__setstate__ methods use comprehensions and zip, which are concise but could be clearer with explicit assignments. The class itself is short and flat, but the naming choices across methods create unnecessary cognitive load, preventing a higher score.
Run 1
Code Structure: The class is logically organized, with initialization followed by serialization methods, though numerous unused imports clutter the snippet. Nesting: Minimal nesting makes the methods easy to follow. Clarity of intent: The class docstring and descriptive attribute names explain its purpose, but generic parameter and variable names (a–f) obscure meaning; the documented factory and takes_self names also differ from the constructor signature. Code length: The implementation is concise, but the import block is disproportionate to the functionality shown. Action granularity: Statements generally perform one action per line; the generator expression remains compact and understandable. Reading flow: Method ordering is natural, but irrelevant imports and uninformative local names interrupt comprehension.
Run 2
Code Structure: The class logically groups initialization and pickle support, although many imports are unused in this excerpt. Nesting: Methods are flat, with only a single shallow loop. Clarity of intent: The class docstring, descriptive attribute names, and standard method names explain its purpose, but parameters and local variables named a through f obscure meaning; constructor names also do not match the documented arguments. Code length: The implementation is concise, though the extensive import block adds clutter relative to the small class. Action granularity: Statements generally perform one action per line, and the generator expression remains manageable. Reading flow: Methods follow a natural order, but generic variable names require readers to infer relationships, and minimal separation between imports and the class slightly weakens visual organization.
Run 3
Code Structure: The class is logically organized into initialization and serialization methods, but numerous unused imports distract from this snippet. Nesting: Minimal nesting makes control flow easy to follow. Clarity of intent: The class docstring and descriptive attribute names explain its purpose, while single-letter parameters and variables (a through f) obscure meaning; constructor names also fail to match the documented arguments. Code length: The implementation is concise, though the extensive import block is disproportionate to the shown functionality. Action granularity: Each statement performs a focused action, with no crowded multi-statement lines. Reading flow: Methods follow a natural order, but opaque variable names, generic pickle docstrings, and limited spacing between major sections reduce readability.