Sample
pyint-286ac8ac564a-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable |
| Dorn | 0.854 | 0–1; higher is more readable |
| Mi | 0.749 | 0–1; higher is more readable |
| LLOC | 22 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.33 | 0–20; mean of three runs |
| BTTF | 0.701 | 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. | 765.065 | −25.247 |
| Source linesThe number of non-empty source lines. | 40 | +16 |
| 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.66 | −6.99 |
Intercept 8.87 + feature contributions = -7.367 (log-odds).
Score = sigmoid(-7.367) = 0.001.
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. | 44.927 | +1.762 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 38 | +0.577 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 38 | −0.451 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.054 | +0.416 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 41 | −0.415 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 28.976 | −0.337 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 39.848 | +0.147 |
Intercept 0.07 + feature contributions = 1.769 (log-odds).
Score = sigmoid(1.769) = 0.854.
| Score | 0.749 |
|---|
| Score | 22 |
|---|
Run 1
The code structure is clean with a clear separation of imports and class definition, and the import grouping is logical. Nesting is minimal—the only indentation is a simple for-loop within the `__call__` method. The class purpose is documented with a concise docstring, making intent clear. The code is concise overall, though `__call__` uses non-descriptive names (`a`, `b`, `c`, `d`) that slightly reduce clarity. Action granularity is good—one logical operation per line. Reading flow is mostly natural, but the use of short variable names in the validator method and the lack of type hints on `a`, `b`, `c` interrupt comprehension. The import of many typing and compatibility symbols may exceed the needs of this snippet but does not affect readability significantly.
Run 2
The code demonstrates organized imports and a simple validator class, but suffers from poor naming and unclear intent. The loop variable names 'a', 'b', 'c', and 'd' are meaningless, obscuring the validator's purpose. The class structure is flat and concise, but the methods lack docstrings explaining the call signature. While the code avoids deep nesting, the action granularity is mixed—'__call__' compresses iteration into a loop without clarifying error propagation. The reading flow follows a logical top-down order, yet the abstract nature and non-descriptive arguments reduce clarity. Overall, the structure is clean but the clarity of intent and naming significantly hinder readability.
Run 3
The code imports are organized and the use of `__future__` annotations shows modern Python practices. The decorator and class structure are logically arranged with minimal nesting and single-purpose actions. The class `_AndValidator` is concise, with a clear `__call__` method that delegates to each validator. However, parameter names `a`, `b`, `c`, and loop variable `d` are ambiguous, reducing clarity of intent. The `@attrs(...)` decorator and `attrib()` usage rely on external library knowledge, which may confuse readers unfamiliar with attrs. While the code is short and flat, the lack of descriptive naming and internal documentation hinders readability. A minor improvement would be to rename parameters and loop variable to reflect their roles (e.g., `instance`, `attribute`, `value`, `validator`).
Run 1
Code Structure: Imports are grouped sensibly, and the validator class is logically organized, though most imports are unused in this snippet and attrs/attrib are not visibly defined or imported. Nesting: Very shallow, with only a loop inside a method. Clarity of intent: The class name, docstring, and _validators field clearly indicate validator composition, but parameter names a, b, c and loop variable d obscure their roles. Code length: The implementation is concise, although the extensive import section overwhelms the small class. Action granularity: Each statement performs one clear action. Reading flow: The class reads naturally from declaration to stored validators to invocation, but the disproportionate imports and unexplained decorator dependencies interrupt understanding.
Run 2
Code Structure: The validator class is logically organized, but the large import block is mostly unrelated to the shown implementation. Nesting: A single loop inside a method keeps nesting shallow. Clarity of intent: The class name, docstring, and _validators attribute clearly indicate validator composition, but a, b, c, and d obscure argument and validator roles. The origins of attrs and attrib are not shown, reducing self-contained clarity. Code length: The implementation is concise, although imports dominate this short snippet. Action granularity: Each statement performs one action, with no compressed multi-operation lines. Reading flow: The class reads naturally from description to stored validators to invocation, but excessive imports and vague parameter names interrupt comprehension.
Run 3
Code Structure: Imports are grouped before a small, logically organized validator class, though many imports appear unrelated to this excerpt and attrs/attrib are not defined here. Nesting: Minimal nesting makes the loop easy to follow. Clarity of intent: The class name, docstring, and _validators field communicate validator composition, but parameter names a, b, c and loop variable d obscure their roles. Code length: The implementation is concise, while the extensive import block adds distraction relative to the shown functionality. Action granularity: Each line performs a single clear action. Reading flow: The class reads naturally from documentation to state to behavior, but import clutter and unexplained decorator dependencies interrupt comprehension.