Sample
pyint-66f8adc13010-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.105 | 0–1; higher is more readable |
| Dorn | 0.758 | 0–1; higher is more readable |
| Mi | 0.628 | 0–1; higher is more readable |
| LLOC | 20 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.727 | 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. | 638.793 | −21.08 |
| Source linesThe number of non-empty source lines. | 43 | +17.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.755 | −7.133 |
Intercept 8.87 + feature contributions = -2.143 (log-odds).
Score = sigmoid(-2.143) = 0.105.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.034 | +0.607 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 44 | −0.522 |
| 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. | 75.977 | +0.447 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 33 | +0.404 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 33 | −0.336 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 67.455 | +0.284 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 42.805 | +0.189 |
Intercept 0.07 + feature contributions = 1.143 (log-odds).
Score = sigmoid(1.143) = 0.758.
| Score | 0.628 |
|---|
| Score | 20 |
|---|
Run 1
The code is well-structured with clear logical organization: imports are grouped by source (futures, stdlib, third-party/local), and constants/functions are ordered sensibly. Minimal nesting is present with flat if/return patterns. Intent is evident through descriptive names and comments explaining non-obvious behavior like the _CacheHashWrapper pickling workaround. Code is concise without unnecessary verbosity. Action granularity follows Python conventions—one logical operation per expression while maintaining readability. Reading flow is natural, though the import section is long due to many dependencies, which slightly impacts initial scanning. Overall, the module demonstrates strong adherence to clean code principles with only minor room for improvement in import organization clarity.
Run 2
The code is modular and organized well at a high level, with imports grouped logically and a single class defined. However, readability is significantly impacted by unclear intent: the class `_CacheHashWrapper` subclasses `int` but pickles as `None`, which is non-obvious from the name alone and requires extensive comments to explain. The `__reduce__` method uses mutable default arguments (`a=type(None)`, `b=()`) which is misleading despite the noqa comment, and parameter names `a` and `b` are ambiguous. Annotation extraction and compatibility imports add cognitive overhead without immediate clarity. Nesting is flat and action granularity is good, but they don't offset the lost clarity. The reading flow is interrupted by needing to cross-reference the comment to understand behavior. The length is appropriate, but the code relies heavily on implicit behavior, making it less approachable for developers unfamiliar with the internal logic.
Run 3
The code is well-structured and readable. It opens with a logical import grouping (standard library, third-party, local modules), uses clear naming conventions, and includes a docstring that explains the purpose and rationale of `_CacheHashWrapper`. The class has a single responsibility, low nesting, and concise implementation. A minor deduction is applied because the `__reduce__` method uses non-descriptive parameter names (`a`, `b`) and includes a `# noqa` comment without clarifying why the warning is suppressed. The `extend` of `int` with a custom reduce logic is slightly abstract, but overall the intent is clear and the code flow is natural.
Run 1
Code Structure: Imports are grouped sensibly, followed by a small, self-contained class. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The descriptive class name and detailed docstring clearly explain why cached hashes reset during copying or pickling; however, the parameter names a and b obscure the reduction mechanism. Code length: The implementation is concise, although the import list is extensive relative to the shown functionality. Action granularity: Each statement performs one action, with no compressed multi-action lines. Reading flow: The progression from imports to documentation to implementation is natural. Additional blank lines around import groups and the top-level class would improve visual separation.
Run 2
Code Structure: Imports are grouped before a small, focused class, although the extensive import list adds clutter relative to the shown functionality. Nesting: Minimal, with only one method inside the class. Clarity of intent: The descriptive class name and detailed docstring clearly explain why cached hashes reset during copying or pickling; however, the terse parameter names and specialized __reduce__ defaults require familiarity with Python serialization. Code length: The implementation is concise, and the documentation provides useful context. Action granularity: Each statement performs one action, with no compressed multi-operation lines. Reading flow: The progression from imports to class documentation to implementation is natural, though extra spacing between import groups and the class would improve visual separation.
Run 3
Code Structure: Imports are grouped logically, followed by a focused class definition. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The descriptive class name and detailed docstring clearly explain why cached hashes reset during copying or pickling; however, the parameters a and b obscure the implementation slightly. Code length: The implementation is concise, though the extensive imports are unrelated to the displayed class. Action granularity: Each statement performs a single action. Reading flow: The progression from imports to documentation to the short method is natural, with minor readability costs from the specialized __reduce__ protocol and compact parameter naming.