Sample
pyint-70ce6caf7638-I10
Deterministically remove some optional blank lines and bracketed line breaks
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.045 | 0–1; higher is more readable |
| Mi | 0.524 | 0–1; higher is more readable |
| LLOC | 73 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs |
| BTTF | 0.359 | 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. | 5522.817 | −182.253 |
| Source linesThe number of non-empty source lines. | 218 | +87.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.366 | −6.549 |
Intercept 8.87 + feature contributions = -92.732 (log-odds).
Score = sigmoid(-92.732) = 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. | 219 | −6.718 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 147 | +4.347 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 147 | −2.952 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 217.966 | +2.637 |
| 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. | 146.977 | −2.56 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 146.991 | +1.567 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.041 | +0.543 |
Intercept 0.07 + feature contributions = -3.066 (log-odds).
Score = sigmoid(-3.066) = 0.045.
| Score | 0.524 |
|---|
| Score | 73 |
|---|
Run 1
This code is difficult to read due to inconsistent formatting, poor spacing, and tangled structure. The import block lacks organization with awkward line breaks. The Attribute class constructor takes 16+ parameters without clear grouping, and the function body mixes multiple actions per line with confusing multi-line statements. The use of bound_setattr for every assignment adds unnecessary complexity and obscures intent. Docstrings are lengthy and placed before critical code, disrupting flow. The metadata handling has deep conditional nesting and inconsistent indentation. While the class has a logical purpose, the implementation shows poor action granularity, with multiple assignments and conditionals crammed together. Variable naming is generally clear but the overall structure and formatting make comprehension slow and error-prone. The code would benefit greatly from consistent line breaks, extracted helper methods, and simplification of the attribute-setting mechanism.
Run 2
The code has clear documentation and logical organization at the class level, but implementation details significantly hurt readability. Many lines contain multiple statements or poorly aligned expressions, violating the 'one action per line' principle. Nesting is moderate but inconsistent in formatting makes it harder to follow. Variable names and intent are mostly clear, but the use of cryptic abbreviations (e.g., 'ca', '_OBJ_SETATTR') and dense argument passing reduces clarity. The class is long with many repetitive bound_setattr calls, though some could be condensed. Reading flow is disrupted by uneven whitespace, mixed indentation styles in expressions, and compact alignment choices. While docstrings are thorough and helpful, the actual code layout feels tangled and overly verbose in places.
Run 3
The code has good documentation and clear intent for an internal library class, but its layout severely undermines readability. Structure is monolithic with imports and class definition cramped together. The constructor signature and body contain inconsistent indentation, compressed multi-argument lines, and multiple statements on one line. Nesting is shallow but line wrapping is erratic, making control flow hard to follow. Action granularity is violated repeatedly (e.g., multiple bound_setattr calls on one line, tuple packing inline). Reading flow is disrupted by scattered alignment and dense expressions, especially in methods like __getstate__ and _setattrs. While naming is descriptive and the class purpose is clear, formatting inconsistencies and overly compact code make it difficult to scan and maintain.
Run 1
Code Structure: Methods are logically grouped within a cohesive class, but inconsistent spacing and limited separation between definitions obscure organization. Nesting: Mostly shallow, with straightforward conditionals and loops; multiline expressions add visual complexity rather than deep nesting. Clarity of intent: Descriptive method names, extensive documentation, and explanatory comments clarify immutability, copying, and serialization. Internal helpers and long positional constructor calls require extra effort to interpret. Code length: Generally justified by functionality, although lengthy documentation and repetitive attribute assignments slow scanning. Action granularity: Most executable statements perform one action, but multiple parameters and slot names crowded onto lines reduce readability. Reading flow: Method order is natural, yet erratic alignment, awkward wrapping, and dense argument lists frequently interrupt reading.
Run 2
Code Structure: Methods are logically grouped within a single class, but inconsistent spacing and weak separation between imports and definitions obscure organization. Nesting: Mostly shallow, with straightforward conditionals and loops; embedded expressions add some complexity. Clarity of intent: Descriptive method names, extensive documentation, and explanatory comments make responsibilities clear, although internal helpers and long positional argument lists require extra interpretation. Code length: Generally justified by initialization, serialization, and compatibility handling, but repetitive assignments and lengthy documentation slow scanning. Action granularity: Most executable statements perform one action per line, though multiple parameters and slot names are crowded onto individual lines. Reading flow: Method ordering is coherent, but irregular indentation, excessive inline whitespace, awkward wrapping, and compressed argument lists repeatedly interrupt natural reading.
Run 3
Code Structure: Methods are logically organized around attribute construction, copying, immutability, and serialization, but inconsistent spacing and limited separation weaken organization. Nesting: Generally shallow, with straightforward conditionals and loops; multiline expressions add visual complexity rather than deep nesting. Clarity of intent: Descriptive method names, extensive documentation, and explanatory comments clarify purpose, although internal helpers and long positional constructor calls require additional context. Code length: Mostly justified by functionality, but lengthy documentation and repetitive field assignments make scanning slower. Action granularity: Executable statements generally perform one action per line; however, multiple parameters and slot names crowded onto single lines obscure individual elements. Reading flow: Method progression is natural, but irregular indentation, excessive inline whitespace, awkward wrapping, and dense argument lists repeatedly interrupt reading.