Sample
pyint-24fafcbfc18b-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.883 | 0–1; higher is more readable |
| Mi | 0.521 | 0–1; higher is more readable |
| LLOC | 41 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.489 | 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. | 2318.706 | −76.517 |
| Source linesThe number of non-empty source lines. | 67 | +26.8 |
| 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.535 | −6.802 |
Intercept 8.87 + feature contributions = -47.65 (log-odds).
Score = sigmoid(-47.65) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 62 | +1.407 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 68 | −1.371 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 66.929 | +0.526 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 81.765 | +0.515 |
| 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.064 | +0.324 |
| 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. | 82.985 | +0.15 |
Intercept 0.07 + feature contributions = 2.018 (log-odds).
Score = sigmoid(2.018) = 0.883.
| Score | 0.521 |
|---|
| Score | 41 |
|---|
Run 1
The code has good imports and structure, but the methods are poorly named and the logic is convoluted. Functions like 'cle' and 'has' are abbreviated and ambiguous, failing to convey intent. The '__init__' method is moderately readable but mixes concerns (parent instance handling and superclass setup). The 'cle' method contains confusing variable names ('ori', 'kwa', 'arg', 'dat', 'ini') that obscure purpose. Nesting is flat, which is positive, but action granularity is inconsistent. The 'has' method is unexplained. Overall, the code lacks clarity and proper naming conventions, making it difficult to understand at a glance despite reasonable organization and import structure.
Run 2
The code imports are organized and the class docstring is helpful. However, readability suffers due to several factors: the `__init__` and `cle` methods contain multiple actions per line and unclear abbreviations (`pk2`, `kwa`, `ori`, `cle`, `has`), violating naming clarity. The `cle` method has moderate nesting and comment placement disrupts flow. `has` method name is misleading. While line length is reasonable and structure is logically grouped, action granularity and clarity of intent are weak. Overall, the code is functional but ambiguous for new readers.
Run 3
The code has a clear structure with logical imports and a focused class definition, and the docstring and error messages aid clarity. However, readability is reduced by abbreviated parameter names ('arg', 'kwa', 'pk2', 'cle', 'has'), inconsistent method naming, and a typo in 'cle' instead of 'clean'. The constructor mixes conditional logic with attribute assignment, and the 'cle' method contains moderate nesting and inline comments that could be clearer. Action granularity is mostly good but could be improved by separating validation logic into helper methods. Overall, the code is maintainable but would benefit from more descriptive naming and less terse parameters.
Run 1
Code Structure: The class logically separates initialization, validation, and change detection, but many unused imports clutter the snippet. Nesting: Mostly shallow, with modest nested conditionals in initialization and empty-value handling. Clarity of intent: The class docstring and validation comments help, but abbreviated names such as cle, has, pk2, kwa, and ori obscure meaning. Renaming expected Django methods also makes their framework role unclear. Code length: The class is reasonably concise, though the import block is disproportionately long and contains unused dependencies. Action granularity: Statements generally perform one action per line, and multiline expressions are formatted clearly. Reading flow: Initialization followed by validation is natural, but cryptic identifiers and the unexplained always-false has method interrupt understanding.
Run 2
Code Structure: Imports and a focused class provide logical organization, though many unused imports add clutter. Nesting: Conditional nesting is shallow and manageable, with early returns simplifying validation. Clarity of intent: The class docstring, descriptive attributes, and error message explain its purpose, but abbreviated names such as cle, has, pk2, kwa, and ori obscure method roles and parameter meanings. Code length: The class is reasonably concise, but the extensive unrelated imports unnecessarily lengthen the snippet. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Initialization followed by validation and change detection creates a natural sequence, but cryptic method names and vague comments interrupt comprehension.
Run 3
Code Structure: The class logically separates initialization, validation, and change detection, but numerous unused imports add clutter. Nesting: Conditional nesting is shallow and manageable, with early returns simplifying validation. Clarity of intent: The class docstring, descriptive attributes, and comments help, but abbreviated names such as cle, has, pk2, kwa, and ori obscure meaning; method names also hide their apparent Django field roles. Code length: The implementation is reasonably concise, although imports are disproportionate to the functionality shown. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Initialization followed by validation provides a natural sequence, but inconsistent naming and the unexplained always-false has method interrupt understanding.