Sample
pyint-8a2fe7d7510e-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.523 | 0–1; higher is more readable |
| Mi | 0.729 | 0–1; higher is more readable |
| LLOC | 36 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.67 | 0–20; mean of three runs |
| BTTF | 0.326 | 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. | 1854.194 | −61.188 |
| Source linesThe number of non-empty source lines. | 84 | +33.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.491 | −6.737 |
Intercept 8.87 + feature contributions = -25.455 (log-odds).
Score = sigmoid(-25.455) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 85 | −1.973 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 57 | +1.234 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 57 | −0.887 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 83.875 | +0.763 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.976 | +0.599 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.304 |
| 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.953 | −0.018 |
Intercept 0.07 + feature contributions = 0.092 (log-odds).
Score = sigmoid(0.092) = 0.523.
| Score | 0.729 |
|---|
| Score | 36 |
|---|
Run 1
The code has a clear structure with class-level attributes and methods, but readability is undermined by misleading names (e.g., 'validateAddress' parses a version string, 'updateAccount' transforms comparison tuples). Several method and variable names are inconsistent with their purpose ('map', 'price', 'age', 'user'), reducing clarity. The code is moderately nested and has decent flow, but variable naming and ambiguous method names obscure intent. Some methods are concise, but the confusion in naming and comments that don't match the actual logic (e.g., 'validateAddress' says 'Parse *s*' but doesn't accept an 's' parameter) lower the score. The use of decorators and docstrings is positive, but documentation examples reference 'attr.VersionInfo' which is inconsistent with the class name.
Run 2
The code has reasonable structure and decorators, but clarity suffers from misleading names. 'validateAddress', 'updateAccount', 'age', 'user', 'price', 'map', 'date', and 'index' do not reflect version-related concepts, making intent hard to follow. The class is relatively flat and concise, but methods mix validation logic with transformation, and exception handling is duplicated across __eq__ and __lt__. The 'updateAccount' method handles multiple concerns, and variable names like 'map' and 'date' obscure the tuple comparison logic. Docstrings are present but unrelated to actual behavior. Physical layout is fine, but reading flow is disrupted by unclear naming and inconsistent abstraction levels.
Run 3
The code is poorly readable. It has misleading names that obscure intent: attributes like 'map', 'price', 'index', 'entry', 'age', and 'user' have no connection to versioning. Method names like 'validateAddress' and 'updateAccount' suggest unrelated domains, while the docstrings refer to different parameters ('s', 'other') than those used. There is also repeated NotImplementedError handling and inconsistent parameter names across methods. The structure is reasonable — flat, concise, using attrs — but the obfuscated naming and semantic mismatch between docstrings and code severely hurt clarity, intent, and reading flow. Logic like appending 'final' and slicing tuples is simple, but the reader cannot easily map names or actions to their purpose.
Run 1
Code Structure: The class logically groups version fields, parsing, comparison preparation, comparison operators, and hashing. Nesting: Shallow conditionals and simple try/except blocks keep complexity low. Clarity of intent: The class docstring and examples explain version comparisons well, but misleading names such as validateAddress, updateAccount, price, age, user, map, and date obscure their actual roles. Docstrings also reference nonexistent parameter names and a differently named class, while map shadows a built-in. Code length: Compact overall, with useful documentation and little unnecessary code. Action granularity: Most lines perform one action; the constructor arguments and hash tuple are reasonably grouped. Reading flow: Methods follow a natural progression, but inconsistent terminology forces readers to repeatedly reinterpret variables and method calls. Clear version-specific naming and accurate docstrings would substantially improve readability.
Run 2
Code Structure: The class is logically organized around version fields, parsing, comparison normalization, and comparison methods. Nesting: Shallow conditionals and short try/except blocks keep complexity low. Clarity of intent: The class documentation and comparison examples help, but misleading names such as validateAddress, updateAccount, price, age, and date obscure version-related operations. Docstrings reference nonexistent parameter names and a different class name; map also shadows a built-in. Code length: Methods are concise, and the examples provide useful context rather than unnecessary bulk. Action granularity: Most lines perform one action, although the constructor places several keyword arguments on one line. Reading flow: The overall progression is natural, but unrelated naming and inconsistent terminology repeatedly interrupt comprehension.
Run 3
Code Structure: The class is logically organized into fields, parsing, comparison preparation, comparison operators, and hashing. Nesting: Shallow conditionals and short try/except blocks keep complexity low. Clarity of intent: The main weakness is misleading naming: validateAddress parses versions, updateAccount prepares comparisons, and variables such as map, age, price, user, and date obscure their roles. Docstrings reference nonexistent parameter names and a different class name, further reducing clarity. Code length: Methods are concise, and the longer class docstring provides useful comparison examples rather than unnecessary verbosity. Action granularity: Statements generally perform one action per line; the multi-keyword constructor call remains understandable. Reading flow: Method ordering and early checks support a natural flow, but inconsistent terminology forces readers to mentally translate names into version-related concepts.