Sample
pyint-5ac04f18e448-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.871 | 0–1; higher is more readable |
| Mi | 0.442 | 0–1; higher is more readable |
| LLOC | 40 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.439 | 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. | 2149.209 | −70.924 |
| Source linesThe number of non-empty source lines. | 60 | +24 |
| 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.366 | −6.549 |
Intercept 8.87 + feature contributions = -44.603 (log-odds).
Score = sigmoid(-44.603) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 57 | +1.234 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 61 | −1.123 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86 | +0.583 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 59.885 | +0.427 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.301 |
| 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. | 86 | +0.023 |
Intercept 0.07 + feature contributions = 1.913 (log-odds).
Score = sigmoid(1.913) = 0.871.
| Score | 0.442 |
|---|
| Score | 40 |
|---|
Run 1
The code is generally well-structured and readable, with clear class organization and logical method separation. The __init__ method follows a consistent pattern for optional parameters, and __call__ has a clear validation flow with minimal nesting. However, readability is slightly reduced by abbreviated parameter names (reg, mes, cod, inverse, fla, oth) that obscure intent, though they are conventional in Django's codebase. The validation logic is concise with one primary action per line, and the __eq__ method is straightforward despite its multi-line boolean expression. Overall, the code demonstrates good structure, flat nesting, and clear control flow, making it maintainable and understandable.
Run 2
The code is generally readable with clear class structure and good use of standard Django patterns. However, the __init__ method uses overly abbreviated parameter names (reg, mes, cod, inverse, fla) that significantly reduce clarity. The method is unnecessarily long with repetitive conditional checks for each parameter. The __call__ method is concise and clear, with good variable naming. The __eq__ method has a logical structure but could be simplified. Import statements are well-organized. Overall, the code could be improved with better parameter naming and a more concise initialization approach, but the structure and logic flow are adequate.
Run 3
The code is generally readable with clear class structure and reasonable method organization. It uses descriptive variable names (registry, message, code) but abbreviations like 'reg', 'mes', 'cod', 'inverse', 'fla', 'val', and 'oth' reduce clarity. The __init__ method has flat, linear parameter checking which is good for readability. The __call__ method is concise with clear intent, though the regex2/invalid logic could be clearer. The __eq__ method is well-structured but could benefit from better parameter naming. Overall nesting is minimal, action granularity is appropriate, and the reading flow is natural. Main improvements would be full parameter names and slightly clearer variable naming in the __call__ method.
Run 1
Code Structure: The class is logically organized into defaults, initialization, validation, and equality checking, though numerous unused imports add clutter. Nesting: Shallow conditionals and early exceptions keep the code easy to follow. Clarity of intent: Descriptive class attributes and the validation docstring explain the purpose, but abbreviated parameters such as reg, mes, cod, fla, and oth, plus the vague regex2 name, reduce clarity. Code length: The implementation is reasonably concise; repeated initialization checks are straightforward rather than unnecessarily verbose. Action granularity: Each statement generally performs one action, and the multiline equality expression is clearly separated. Reading flow: Methods follow a natural sequence and formatting is consistent, although the unnecessarily split short constructor signature and distracting imports slightly interrupt the flow.
Run 2
Code Structure: The class is logically organized into configuration, initialization, validation, and equality checks, although unused imports add clutter. Nesting: Shallow conditionals keep control flow easy to follow. Clarity of intent: Descriptive class attributes and the validation docstring explain the purpose, but abbreviated parameters such as reg, mes, cod, fla, and oth, plus the vague name regex2, reduce clarity. Code length: The implementation is reasonably concise, though unused imports and unnecessary parentheses slightly inflate it. Action granularity: Statements generally perform one action per line, and multiline expressions are clearly separated. Reading flow: Methods follow a natural sequence and formatting is consistent overall, but the awkwardly split constructor signature and abbreviated identifiers interrupt otherwise smooth reading.
Run 3
Code Structure: The class logically separates initialization, validation, and equality checks, though several unused imports add clutter. Nesting: Shallow conditionals keep the code easy to follow. Clarity of intent: Descriptive class attributes and the validation docstring clarify purpose, but abbreviated parameters such as reg, mes, cod, fla, and oth, plus the vague regex2 variable, reduce clarity. Code length: The implementation is reasonably concise, although unused imports and unnecessary parentheses in equality comparisons add noise. Action granularity: Each statement performs a single clear action, with a readable multiline equality expression. Reading flow: Methods follow a natural progression and use consistent indentation, but the awkwardly wrapped constructor signature and lack of import grouping slightly disrupt scanning.