Sample
pyint-aedffb489c12-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable |
| Dorn | 0.848 | 0–1; higher is more readable |
| Mi | 0.317 | 0–1; higher is more readable |
| LLOC | 17 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.517 | 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. | 635.312 | −20.965 |
| 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.402 | −6.602 |
Intercept 8.87 + feature contributions = -7.498 (log-odds).
Score = sigmoid(-7.498) = 0.001.
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.444 |
| 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. | 77.966 | +0.363 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 67.759 | +0.289 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 26 | +0.162 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 27.873 | −0.02 |
| 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.715 (log-odds).
Score = sigmoid(1.715) = 0.848.
| Score | 0.317 |
|---|
| Score | 17 |
|---|
Run 1
The code is generally readable: it uses clear naming (_SubclassOfValidator), a single-purpose class, and a concise __call__ method. The structure is flat, with minimal nesting, and each line performs one logical action. The custom __repr__ improves debugging clarity, and the type annotation for `type` is straightforward. However, readability is hindered by the cryptic parameter names `a`, `b`, and `c` in __call__, which obscure intent. The error message construction is slightly awkward due to the f-string and rendering, and the class docstring is minimal despite the unusual callable-class design. Overall, the code is maintainable but could benefit from more descriptive parameter names and a clearer docstring explaining the validator’s role.
Run 2
The code is generally readable with clear intent: a validator class enforcing subclass relationships. The structure is logical, using a callable class and __repr__ override. Nesting is minimal (one 'if' inside __call__). However, parameter names 'a', 'b', 'c' are opaque, obscuring the roles of instance, attribute, and value. The multi-line TypeError construction with 'd' variable is slightly awkward. The class decorator and imports are concise. Overall, readable but could be improved with descriptive parameter names and simplified error raising.
Run 3
The code is moderately readable. It is logically organized with a single class and clear imports. Nesting is shallow, with one conditional inside __call__. The intent of the validator is clear, and action granularity is appropriate—each line does one thing. However, the use of single-letter parameter names (a, b, c) obscures meaning and hurts clarity of intent. The __call__ method bodies are concise, but the exception construction is verbose and could be simplified. The reading flow is natural enough, but the cryptic parameters force the reader to infer context from attribute/validator internals. Overall, it is understandable but not immediately obvious without deeper knowledge of the underlying framework.
Run 1
Code Structure: The validator is logically organized into attribute declaration, validation, and representation methods, though numerous unused imports add clutter. Nesting: A single conditional keeps control flow shallow and easy to follow. Clarity of intent: The class name, issubclass check, and error message clearly communicate the purpose, but generic parameter names a, b, c and temporary variable d obscure their roles. Code length: The implementation is compact, although unused imports and the expanded exception argument list increase its visual length. Action granularity: Each statement performs one clear action. Reading flow: The class reads naturally from configuration to behavior, but sparse spacing around top-level definitions and the repr-focused docstring inside the validation method slightly interrupt the flow.
Run 2
Code Structure: The validator class logically separates validation from representation, but numerous unused imports add clutter. Nesting: A single conditional keeps nesting shallow and easy to follow. Clarity of intent: The class name, issubclass check, and descriptive error message communicate its purpose, while parameter names a, b, c and temporary variable d obscure their roles. The docstring explains the callable-class design rather than the method's behavior. Code length: The implementation is concise, although unused imports and the expanded exception arguments add unnecessary visual length. Action granularity: Each statement performs one clear action, with no compressed multi-action lines. Reading flow: The sequence from type declaration to validation and representation is natural, but opaque identifiers and distracting imports interrupt comprehension.
Run 3
Code Structure: The class is logically organized into configuration, validation, and representation methods, although numerous unused imports add clutter. Nesting: A single conditional keeps the validation logic shallow and easy to follow. Clarity of intent: The class name, issubclass check, and error message clearly express the purpose, 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 compact, though unused imports and the expanded exception arguments introduce some unnecessary length. Action granularity: Each statement performs one clear action, with message construction separated from raising the exception. Reading flow: The progression from checking the value to constructing an error and raising it is natural; descriptive parameter names and import cleanup would improve readability.