Sample
pyint-9876f9abaca5-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable |
| Dorn | 0.696 | 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 | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.639 | 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.52 | −6.78 |
Intercept 8.87 + feature contributions = -6.734 (log-odds).
Score = sigmoid(-6.734) = 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.039 | +0.559 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 65.821 | +0.51 |
| 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.97 | +0.405 |
| 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.827 (log-odds).
Score = sigmoid(0.827) = 0.696.
| Score | 0.535 |
|---|
| Score | 29 |
|---|
Run 1
The code is well-structured and highly readable. The Factory class is logically organized with clear separation of attributes, initialization, and serialization methods. Docstrings succinctly explain purpose and arguments. Nesting is minimal — the __getstate__ and __setstate__ methods use flat comprehensions and straightforward loops, avoiding deep indentation. Intent is explicit: the class name, parameter names, and version notes make its role in attrs clear. Code length is appropriate, with no unnecessary boilerplate. Action granularity is good — each line performs one logical operation, such as assigning attributes or iterating with zip. Reading flow is natural: imports, class definition, __slots__, constructor, then pickle support methods in a logical sequence. The use of __slots__ and strict=True in zip show modern, intentional Python. Overall, the code is concise, self-documenting, and maintainable.
Run 2
The code is well-structured: imports are clearly organized (stdlib, third-party, local) and the class has a clear single purpose with good docstrings. Nesting is minimal — only two flat loops in __getstate__/__setstate__, with no deep conditional branching. Intent is clear: the Factory class stores a callable and handles pickling. Code length is appropriate; no unnecessary verbosity or redundancy. Action granularity is reasonable: __getstate__ packs a tuple comprehension into one line but remains readable; __setstate__ uses one action per line with a zip loop. Reading flow is natural: class definition, docstring, slots, init, then pickle methods. Minor deductions: the __getstate__ comprehension slightly reduces readability; parameter names (fac, sta, nam, nam2) are terse but still understandable in context. Overall, concise and maintainable code with clean structure.
Run 3
The code is highly readable. It has a clear structure with imports organized logically, a single class with a well-documented purpose, and methods that follow a consistent pattern. Nesting is minimal, and each action is generally on its own line. The class docstring clearly explains parameters and version notes. The only slight deductions are due to abbreviated parameter names like 'fac' and 'nam2' which are less descriptive than the rest of the code, and the use of `__slots__` with string tuples can be slightly opaque to beginners. Overall, the intent is unambiguous and the reading flow is natural.
Run 1
Code Structure: Imports and a single class are logically organized, although many imports are unused in this snippet. Nesting: Methods are flat, with only one simple loop. Clarity of intent: The class docstring clearly explains factory behavior, and standard serialization method names convey purpose; abbreviated parameters and variables such as fac, takes, sta, nam, and nam2 reduce clarity. Code length: The implementation is concise, though the import block is disproportionately long relative to the class. Action granularity: Statements generally perform one action per line; the generator expression is compact and understandable. Reading flow: The progression from documentation and slots to initialization and serialization is natural. Minor distractions include the mismatch between documented argument names and constructor parameters, plus limited spacing between imports and the class.
Run 2
Code Structure: The class is logically organized into initialization and serialization methods, although numerous imports are unused in this snippet. Nesting: Minimal nesting makes the methods easy to follow. Clarity of intent: The class docstring clearly explains its purpose, but abbreviated parameter and variable names (fac, takes, sta, nam, nam2) reduce clarity and differ from documented argument names. Code length: The implementation is concise; documentation is longer but useful. Action granularity: Statements generally perform one action per line, with a straightforward generator expression for serialization. Reading flow: Methods follow a natural order, though the large import block and inconsistent naming slightly interrupt readability.
Run 3
Code Structure: The class is logically organized into initialization and serialization methods, although many imports are unused in this snippet. Nesting: The code is flat, with only a simple loop in __setstate__. Clarity of intent: The class docstring clearly explains its purpose, but abbreviated parameter and variable names such as fac, sta, nam, and nam2 reduce clarity; the documented argument names also differ from the constructor signature. Code length: The implementation is concise, though the import block is disproportionately large for the shown functionality. Action granularity: Each statement performs a single clear action. Reading flow: Methods follow a natural order, and formatting is consistent, but the extensive imports and inconsistent naming slightly interrupt readability.