Sample
pyint-07a38e1f22c4-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable |
| Dorn | 0.834 | 0–1; higher is more readable |
| Mi | 0.553 | 0–1; higher is more readable |
| LLOC | 16 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.629 | 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. | 626.468 | −20.673 |
| Source linesThe number of non-empty source lines. | 28 | +11.2 |
| 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.41 | −6.614 |
Intercept 8.87 + feature contributions = -7.218 (log-odds).
Score = sigmoid(-7.218) = 0.001.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 88 | +0.615 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.052 | +0.44 |
| 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. | 26 | +0.162 |
| 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. | 88 | −0.062 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 27.742 | −0.022 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 29 | +0.01 |
Intercept 0.07 + feature contributions = 1.611 (log-odds).
Score = sigmoid(1.611) = 0.834.
| Score | 0.553 |
|---|
| Score | 16 |
|---|
Run 1
The code is highly readable due to its clear structure, flat nesting, and concise implementation. It follows a logical organization with imports, class definition, and methods in a natural order. The single-level nesting in __call__ keeps the logic straightforward, and the use of a docstring clarifies intent. The __repr__ method is concise and informative. Minor deductions arise from the slightly verbose error message formatting that could be split for readability and the unused imports (operator, re, Pattern, contextmanager, and get_run_validators) that add noise without affecting function. Overall, the code is well-structured and easy to understand.
Run 2
The code is generally readable with clear structure and intent. It uses a class as a validator, imports are organized, and the __call__ method has a straightforward flow. Nesting is minimal, and action granularity is reasonable. However, there is an unnecessary blank line before the raise statement, and the TypeError arguments could be slightly clearer. The docstring is helpful but concise. The code length is appropriate, and the reading flow is natural. Overall, it is fairly readable but could benefit from minor formatting cleanup and slightly more explicit error handling context.
Run 3
The code is well-structured and readable. Import organization is clean, with standard library, third-party, and local imports grouped logically. The class definition is concise with appropriate use of the `attrs` decorator for boilerplate reduction. The `__call__` method has a clear single responsibility: validating subclass relationships. Nesting is minimal—only one conditional with an early raise, maintaining flat structure. The error message is informative and readable, though the multi-line f-string with tuple arguments could be slightly flattened. Action granularity is appropriate, with one logical action per line except for the raise statement which bundles several related values. The docstring succinctly explains the design choice of using a callable class. The `__repr__` method is clear and returns a descriptive string. Minor deductions are for the unnecessary blank line before the raise and the slightly dense error message construction, but overall this is well-crafted, maintainable code with clear intent.
Run 1
Code Structure: The validator is logically organized into initialization metadata, validation behavior, and representation, though several imports are unused in this snippet. Nesting: Minimal nesting makes the control flow easy to follow. Clarity of intent: The class name, issubclass check, and descriptive error clearly communicate its purpose; however, the call-method docstring explains representation customization rather than validation, and abbreviated parameters slightly reduce clarity. Code length: The implementation is concise, with minor unnecessary parentheses and whitespace. Action granularity: Each statement performs a single clear action, and the multiline exception arguments remain readable. Reading flow: The sequence is natural and straightforward, but the blank line before raise and limited separation around top-level definitions slightly weaken formatting consistency.
Run 2
Code Structure: Imports and a small validator class are logically organized, though several imports are unused in this snippet. Nesting: Shallow nesting makes control flow easy to follow. Clarity of intent: Class and method names clearly convey subclass validation, and the error message is informative; however, the __call__ docstring explains the callable-class design rather than the method's validation behavior. Code length: The implementation is concise, with minor clutter from an unnecessary blank line and redundant parentheses around the f-string. Action granularity: Each statement performs one clear action, and the exception arguments are neatly separated. Reading flow: The progression from configuration to validation to representation is natural, although framework-specific decorators and attrib() require some background knowledge.
Run 3
Code Structure: The validator is logically organized into an attribute, validation method, and representation method, though several unused imports add clutter. Nesting: Only one conditional level keeps the code easy to follow. Clarity of intent: The class name, issubclass check, and descriptive error make its purpose clear; however, the __call__ docstring explains the callable-class design rather than validation behavior. Code length: The implementation is concise, with minor unnecessary parentheses and a stray blank line. Action granularity: Each statement performs one clear action, and the multiline exception arguments are readable. Reading flow: The progression from configuration to validation to representation is natural, slightly disrupted by excess imports and inconsistent whitespace.