Sample
pyint-f5d853759509-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.666 | 0–1; higher is more readable |
| Mi | 0.419 | 0–1; higher is more readable |
| LLOC | 31 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 13 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.56 | 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. | 1455.767 | −48.04 |
| 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.666 | −6.999 |
Intercept 8.87 + feature contributions = -28.969 (log-odds).
Score = sigmoid(-28.969) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 43 | +0.75 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 43 | −0.566 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 83 | +0.535 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 44 | −0.522 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 42.821 | +0.189 |
| 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. | 83 | +0.15 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.088 | +0.082 |
Intercept 0.07 + feature contributions = 0.688 (log-odds).
Score = sigmoid(0.688) = 0.666.
| Score | 0.419 |
|---|
| Score | 31 |
|---|
Run 1
The code is functional but has several readability issues. The overloads use confusing parameter names ('use', 'use2', 'use3', 'pas', 'pas2', 'pas3') that obscure intent and break consistency. The __eq__ method wraps a simple boolean check in an unnecessary list with 'all()', adding noise. Parameter names like 'oth', 'oth2', and 'r2' are abbreviated and unclear. Type hints are present but inconsistent (e.g., basestring imported but unused). The class purpose is clear, and methods are short with flat nesting, but the poor naming undermines clarity. Structure is logical but the overload implementation is awkward. The reading flow is interrupted by cryptic identifiers, making the code harder to follow than necessary despite its brevity.
Run 2
The code demonstrates good structure with a clear class definition and logical method organization. However, there are several readability issues: parameter names are ambiguous (use3, pas3, r2, oth2) and inconsistent across overloads (use/pas vs use2/pas2 vs use3/pas3). The overloads add complexity without clear benefit. The __eq__ method unnecessarily wraps a simple comparison in a list inside all(). While the code is relatively flat and concise, the poor parameter naming significantly impacts clarity of intent. Type hints are present and helpful, and the docstring is clear. The action granularity is appropriate, with one operation per line in most cases. Overall, it's readable but would benefit from consistent, descriptive parameter names and simplified equality logic.
Run 3
The code has a clear overall structure with a single class and clean method separation, but readability is undermined by several issues. The __init__ overloads use confusing parameter names (use, pas, use2, pas2, use3, pas3) that obscure intent—these should be 'username' and 'password' consistently. The __eq__ method uses getattr unnecessarily and wraps a simple comparison in a list with all(), adding complexity. The __ne__ method has an inconsistent parameter name (oth2) and could use __eq__ more directly. Magic methods (__call__, __eq__, __ne__) are present without clear contextual explanation, making the class's purpose less immediately apparent. While the code is concise and flat (low nesting), the action granularity is acceptable, but the natural reading flow is disrupted by the parameter naming inconsistency and redundant constructs. The class appears to be an authentication handler, but the intent could be clearer with better naming and simplified logic.
Run 1
Code Structure: The class logically groups initialization, comparison, and request authentication, but numerous unused imports clutter the snippet. Nesting: Minimal nesting makes the methods easy to follow. Clarity of intent: The class name, docstring, attributes, and Authorization assignment clearly communicate its purpose; inconsistent parameter names such as use3, pas3, oth2, and r2 reduce clarity. Code length: Methods are concise, although the overloads and list-based all() comparison add visual overhead. Action granularity: Statements generally perform one action per line; compact overload declarations slightly depart from this style. Reading flow: Method order is natural, but sparse spacing around imports and overloads, inconsistent naming, and externally defined symbols interrupt otherwise straightforward reading.
Run 2
Code Structure: The class is logically organized into initialization, comparison, and request authentication methods, though many unrelated imports clutter the excerpt. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class docstring, attribute names, and Authorization assignment clearly convey its purpose, but parameter names such as use3, pas3, oth2, and r2 are vague and inconsistent. AuthBase, PreparedRequest, and _basic_auth_str are not defined in the excerpt, limiting standalone understanding. Code length: Methods are concise, although the list-based all() comparison and duplicated overload declarations add some verbosity. Action granularity: Most lines perform a single clear action; compact overload declarations remain understandable. Reading flow: The method sequence is natural, but dense imports, inconsistent naming, and limited spacing between overloads interrupt an otherwise straightforward flow.
Run 3
Code Structure: The class is logically organized into initialization, comparison, and request authentication methods, though numerous unused imports add clutter. Nesting: Methods are flat, with no deeply nested control flow. Clarity of intent: The class docstring, descriptive attributes, and type annotations clarify its purpose, but parameter names such as use3, pas3, oth2, and r2 are unnecessarily cryptic. AuthBase, PreparedRequest, and _basic_auth_str are not defined or imported in the provided snippet, weakening standalone clarity. Code length: The implementation is short, although the import block and list-based all() comparison introduce avoidable verbosity. Action granularity: Each statement generally performs one action, making individual operations easy to follow. Reading flow: The method sequence is natural, but inconsistent parameter naming, compact overload declarations, and limited spacing around imports and class boundaries slightly disrupt readability.