Sample
pyint-82e778280098-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.899 | 0–1; higher is more readable |
| Mi | 0.605 | 0–1; higher is more readable |
| LLOC | 20 | 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.598 | 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. | 664.856 | −21.94 |
| Source linesThe number of non-empty source lines. | 27 | +10.8 |
| 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.496 | −6.744 |
Intercept 8.87 + feature contributions = -9.015 (log-odds).
Score = sigmoid(-9.015) = 0.
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. | 67.964 | +0.787 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.429 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 68 | +0.293 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 26 | +0.162 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 27 | +0.08 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 26.725 | −0.036 |
Intercept 0.07 + feature contributions = 2.182 (log-odds).
Score = sigmoid(2.182) = 0.899.
| Score | 0.605 |
|---|
| Score | 20 |
|---|
Run 1
The code has reasonable structure with a single class declaration and clear import organization, but readability suffers from poor naming conventions. Variables 'a', 'b', 'c', 'd', and 'e' are cryptic and give no indication of their purpose, violating clarity of intent. The `__call__` method uses a try/except/else pattern that, while flat and not deeply nested, obscures the logic flow—the 'continue on exception, return on success' pattern could be clearer. The method signature with three parameters and exception handling inside a loop makes the action granularity unclear. On the positive side, the code is concise, has flat nesting, and the class structure with `attrs` decorator is logical. The repr method is simple and clear. Overall, the code is maintainable but would benefit significantly from descriptive variable names and clearer comments or logic restructuring.
Run 2
The code shows reasonable structure with clear class definition and logical method organization. Nesting is minimal with only one level within the for loop and try/except block. Intent is generally clear, though single-letter variables (a, b, c, d, e) reduce clarity significantly - these could be named more descriptively like self, attribute, value, validator, error_msg. Code length is concise and action granularity is appropriate with one action per line. Reading flow is natural with validation logic flowing from iteration to exception handling. The main deductions come from unclear variable naming and slightly opaque error message construction. The contextmanager imports and some unused imports (operator, re, Pattern, etc.) appear unnecessary for this snippet, potentially indicating broader module complexity. Overall, readable but could benefit from better variable names.
Run 3
The code imports are clean and organized, and the class structure is logical with clear responsibility. The __call__ method is relatively flat with only one nesting level in the try/except/else. However, readability suffers from non-descriptive variable names like a, b, c, d, and e, which obscure intent. The __repr__ method is concise and clear. Action granularity is mostly one action per line, but the f-string and return statements could be split for clarity. The validation loop logic is understandable yet could benefit from a helper or more explicit naming. Overall, the structure is decent but variable naming and slightly compressed logic reduce clarity.
Run 1
Code Structure: The validator class is logically organized into validation and representation methods, though numerous unused imports add clutter. Nesting: The loop and try/except/else introduce moderate nesting, but the short body remains easy to follow. Clarity of intent: The class name, validators field, and error message convey OR-style validation, but single-letter parameters and local variables obscure their roles. Catching every Exception also leaves the intended failure handling ambiguous. Code length: The implementation is concise, although imports and an intermediate error-message variable add unnecessary length. Action granularity: Each line generally performs one action, with no compressed statements. Reading flow: Validation proceeds naturally through candidates, returns on success, and raises after all fail; opaque names and the dense suppression comment slightly disrupt readability.
Run 2
Code Structure: The small class logically groups validation behavior and its representation, but numerous unused imports distract from its purpose. Nesting: The loop and try/except/else introduce moderate nesting, though continue and return keep execution straightforward. Clarity of intent: _OrValidator, validators, and the error message communicate the overall purpose, but single-letter parameters and local variables obscure their roles. Catching every Exception also makes intended failure handling ambiguous. Code length: The implementation is concise, although the imports add unnecessary bulk. Action granularity: Each line generally performs one action, making individual operations easy to follow. Reading flow: The progression from trying validators to returning on success or raising on total failure is natural; cryptic names and the dense suppression comment slightly interrupt readability.
Run 3
Code Structure: The class is logically organized into state, validation behavior, and representation, although several imports are unused in this snippet. Nesting: The loop and try/except/else introduce moderate nesting, but the early return keeps control flow manageable. Clarity of intent: The class name, validators field, and error message communicate that any validator may succeed; however, single-letter parameters and local variables obscure their roles, and catching every Exception blurs expected validation failures versus unexpected errors. Code length: The implementation is compact without substantial unnecessary code beyond unused imports. Action granularity: Statements generally perform one action per line. Reading flow: The progression from trying validators to returning on success or raising after all failures is natural, though meaningful variable names would make it easier to follow.