Sample
pyint-ec2b6c2211fa-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.01 | 0–1; higher is more readable |
| Dorn | 0.873 | 0–1; higher is more readable |
| Mi | 0.497 | 0–1; higher is more readable |
| LLOC | 17 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.688 | 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. | 422.873 | −13.955 |
| Source linesThe number of non-empty source lines. | 19 | +7.6 |
| 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.708 | −7.062 |
Intercept 8.87 + feature contributions = -4.547 (log-odds).
Score = sigmoid(-4.547) = 0.01.
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. | 64.7 | +0.925 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.035 | +0.6 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 20 | +0.328 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 65 | +0.244 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 18.894 | −0.146 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 19 | −0.08 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 19 | −0.015 |
Intercept 0.07 + feature contributions = 1.927 (log-odds).
Score = sigmoid(1.927) = 0.873.
| Score | 0.497 |
|---|
| Score | 17 |
|---|
Run 1
The code is highly readable. It begins with clear future import and standard imports, organized logically (standard library, then local modules). Constants like `Final` are properly imported. The `AuthBase` class has a clear docstring and a single, focused method with a descriptive parameter type hint and return type. Nesting is non-existent, action granularity is one action per line, and overall structure is flat. The only minor deduction is that some imported names (e.g., `overload`, `cast`, `Any`) are not used in the shown code, which slightly reduces clarity of intent for a reviewer seeing only this fragment.
Run 2
The code is highly readable. It begins with clear future imports and standard library imports, followed by a logical grouping of internal imports, demonstrating good structure. The class AuthBase has a single clear purpose with a descriptive docstring. The method __call__ is concise, uses clean type hints, and raises NotImplementedError with a clear message. There is no unnecessary nesting, and each statement is concise and serves a single purpose. The reading flow is natural, from imports to the class definition and method implementation. Overall, the code is well-organized, concise, and unambiguous.
Run 3
This code is highly readable. The structure is logical and clean, with all imports grouped at the top and organized into standard library, third-party, and local modules. The class definition is simple and focused. Nesting is minimal—there is no conditional or loop nesting, just a single class with a single method. The intent is very clear: AuthBase defines a base class for authentication implementations that must be callable, and the NotImplementedError message reinforces this purpose. The code is concise, with no unnecessary length or redundancy. Action granularity is appropriate, with each import and method on its own line. Reading flow is natural—imports first, then a docstring, then the method definition. Type hints and future annotations indicate thoughtful design for maintainability. Minor deductions only because the abstract method could use the abc module for formal abstractness, and there are no inline comments explaining the broader authentication architecture.
Run 1
Code Structure: Imports are followed by a small, logically organized base class, though numerous unused imports add clutter. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class name, docstring, type annotations, and explicit NotImplementedError clearly communicate the authentication-hook interface; the parameter name 'r' is less descriptive, and PreparedRequest is not defined or imported in the snippet. Code length: The implementation is concise, but the imports are disproportionate to its functionality. Action granularity: Each statement occupies its own line. Reading flow: The progression from imports to class documentation to the callable contract is natural, although additional spacing between import groups and the class would improve visual organization.
Run 2
Code Structure: Imports followed by a small base class provide clear organization, although many imports are unused in the shown snippet. Nesting: Minimal, with only a class and method. Clarity of intent: The class name, docstring, type annotations, and explicit NotImplementedError clearly communicate an authentication interface; the parameter name 'r' is less descriptive, and PreparedRequest is not defined or imported here. Code length: The implementation is concise, but the numerous imports add visual overhead. Action granularity: Each statement occupies its own line. Reading flow: The progression from imports to class documentation to method is natural, though separating import groups and adding another blank line before the class would improve readability.
Run 3
Code Structure: Imports precede a clearly defined base class, providing logical organization, though many imports are unused in this snippet. Nesting: Minimal, with only a class and its method. Clarity of intent: The class name, docstring, type annotations, and explicit NotImplementedError clearly establish an authentication interface. PreparedRequest is not defined or imported in the excerpt, slightly reducing self-contained clarity. Code length: The implementation is concise, but the import block is disproportionately long for the functionality shown. Action granularity: Each statement occupies its own line. Reading flow: The progression from imports to class documentation to the callable contract is natural; additional spacing between import groups and before the class would improve scanning.