Sample
pyint-c6320e27caff-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.84 | 0–1; higher is more readable |
| Mi | 0.368 | 0–1; higher is more readable |
| LLOC | 17 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.591 | 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. | 578.587 | −19.093 |
| Source linesThe number of non-empty source lines. | 23 | +9.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.6 | −6.899 |
Intercept 8.87 + feature contributions = -7.923 (log-odds).
Score = sigmoid(-7.923) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.051 | +0.443 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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. | 78 | +0.361 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 68.667 | +0.303 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 24 | +0.187 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 22.823 | −0.091 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 21 | −0.011 |
Intercept 0.07 + feature contributions = 1.661 (log-odds).
Score = sigmoid(1.661) = 0.84.
| Score | 0.368 |
|---|
| Score | 17 |
|---|
Run 1
The code is highly readable. It is well-structured as a small, focused validator class using attrs. Nesting is minimal (only one conditional inside __call__). Intent is clear from the class and method names, and the docstring clarifies the design choice of using a callable class. Code length is concise. Action granularity is reasonable: the length check, message formatting, and exception raising are separated appropriately, though some minor consolidation might be possible. Reading flow is natural and logical. Minor deductions: variable names like 'a', 'b', 'c', and 'd' are uninformative, and the flow steps in __call__ could be slightly more explicit. Overall, it is very readable.
Run 2
The code is generally clear and well-structured. The use of a frozen dataclass-like validator with a callable class is logical. Naming is partially unclear (a, b, c in __call__), but the docstring explains intent. Nesting is minimal, and action granularity is one per line. Length is concise. Reading flow is decent, but parameter names reduce immediate clarity.
Run 3
The code is generally readable but has some clarity issues. The structure is logical, importing only what is needed, and the class is cleanly defined with a clear purpose. Nesting is minimal, with only one conditional inside the __call__ method. The code length is appropriate for the functionality. However, the parameter names 'a', 'b', and 'c' in __call__ are ambiguous and hurt readability; they should be descriptive like 'instance', 'attribute', and 'value'. Additionally, the variable 'd' for the error message is not descriptive. The __repr__ method is concise but the string format is slightly inconsistent with typical naming. Reading flow is natural, but the placeholder names and generic variable 'd' disrupt understanding. Action granularity is fine, with one main action per line. Overall, the code is understandable but would benefit from clearer variable naming.
Run 1
Code Structure: The validator class is logically organized, with configuration, validation, and representation separated, though numerous unused imports clutter the snippet. Nesting: A single conditional keeps the code shallow and easy to follow. Clarity of intent: The class name, min_length attribute, and error message clearly express minimum-length validation, but parameter names a, b, c and temporary variable d obscure their roles. The docstring explains the callable-class design rather than the method's validation behavior. Code length: The implementation is concise, aside from unused imports. Action granularity: Each statement performs one clear action. Reading flow: The progression from stored constraint to validation and representation is natural, although descriptive parameter names and cleaner imports would improve readability.
Run 2
Code Structure: The validator class logically groups its configuration, validation behavior, and representation, though numerous unused imports add clutter. Nesting: A single conditional keeps the code shallow and easy to follow. Clarity of intent: The class name, min_length attribute, and error message clearly convey minimum-length validation, but parameters a, b, c and variable d are cryptic; the docstring explains the callable-class design rather than the method's behavior. Code length: The implementation is concise, although the unused imports unnecessarily lengthen the snippet. Action granularity: Each statement performs one clear action, with error construction and raising separated. Reading flow: Configuration, validation, and representation appear in a natural order, but opaque variable names and framework-specific decorators slightly interrupt comprehension.
Run 3
Code Structure: Imports and a focused validator class are logically organized, although several imports are unused in this snippet. Nesting: Only a single conditional keeps the code easy to follow. Clarity of intent: The class name, min_length attribute, and error message clearly communicate minimum-length validation, but parameters a, b, c and temporary variable d are cryptic. The docstring explains the callable-class design rather than the method's behavior. Code length: The implementation is concise without unnecessary complexity. Action granularity: Each line performs one clear action. Reading flow: Validation followed by a custom representation is natural, though descriptive parameter names and better spacing between imports and the class would improve readability.