Sample
pyint-961a064bda70-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.832 | 0–1; higher is more readable |
| Mi | 0.52 | 0–1; higher is more readable |
| LLOC | 23 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.369 | 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. | 1269.981 | −41.909 |
| Source linesThe number of non-empty source lines. | 37 | +14.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.629 | −6.943 |
Intercept 8.87 + feature contributions = -25.182 (log-odds).
Score = sigmoid(-25.182) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.921 | +0.598 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 34 | +0.439 |
| 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.32 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 38 | −0.309 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 36.841 | +0.105 |
| 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. | 87 | −0.02 |
Intercept 0.07 + feature contributions = 1.601 (log-odds).
Score = sigmoid(1.601) = 0.832.
| Score | 0.52 |
|---|
| Score | 23 |
|---|
Run 1
The code is difficult to read due to inconsistent and disorganized import formatting, excessive whitespace within and between import lines, and a misspelled 'LexemeCombinable' vs 'CombinedLexeme' reference. The class definition is somewhat clear but the overall structure feels tangled. Nesting is minimal, which is positive, but clarity of intent is undermined by the formatting and lack of spacing between methods. Code length is reasonable, though the import block is unnecessarily long and visually noisy. Action granularity is mostly one action per line, improving readability, but the reading flow is disrupted by the unformatted imports and missing blank lines between methods. Overall, the code would benefit greatly from running a formatter and fixing minor naming inconsistencies.
Run 2
The code is functional but has several readability issues. Import formatting is inconsistent, with multiple items on a single line followed by oddly spaced multiline imports. The LexemeCombinable class is logically structured, but the _combine method has unnecessary parentheses after the f-string and inconsistent spacing before the closing parenthesis. Action granularity is acceptable, with one operation per line in most cases. The reading flow is interrupted by the import section's erratic formatting and the misplaced closing parenthesis in the TypeError. The class methods are concise and the intent is mostly clear, particularly for bitwise operators. However, the overall structure could be improved with more consistent formatting, proper line breaks in imports, and cleaner error message formatting. The code is understandable but not exemplary in terms of style and clarity.
Run 3
The code is moderately readable but has formatting inconsistencies. The import block is poorly organized with irregular spacing and alignment, though it clearly lists needed imports. The LexemeCombinable class is logically structured with a private _combine method handling shared logic, reducing duplication. Nesting is minimal and clarity of intent is good—the bitwise operator overloading is explained in comments, and the TypeError message is descriptive. However, the closing parenthesis in the error message is awkwardly aligned, and several method definitions lack blank lines between them, disrupting reading flow. Action granularity is mostly one action per line, but the import formatting and inconsistent spacing hurt readability. The code is concise but would benefit from consistent formatting (e.g., PEP 8 spacing).
Run 1
Code Structure: The class logically groups operator constants, a shared combination helper, and operator overloads, but import formatting and missing blank lines weaken organization. Nesting: Shallow conditionals make control flow easy to follow. Clarity of intent: Descriptive names, explicit type validation, and an explanatory comment clarify logical combination; the parameter name 'reversed' shadows a built-in. Code length: Concise, with a shared helper avoiding duplication, though several imports are unused in this snippet. Action granularity: Statements generally perform one action per line, but crowded import entries reduce scanability. Reading flow: The helper followed by paired operator methods is natural; inconsistent whitespace, awkward parenthesis placement, and uneven method spacing interrupt an otherwise straightforward read.
Run 2
Code Structure: Imports precede a focused class, and shared combination logic is sensibly centralized in _combine; inconsistent spacing weakens organization visually. Nesting: Shallow conditionals and early returns keep control flow easy to follow. Clarity of intent: Descriptive names, an explicit type-check error, and a contextual comment explain lexeme combination, though the meaning of the reversed flag requires some interpretation. Code length: Concise, with minimal duplication beyond necessary operator wrappers. Action granularity: Statements generally perform one action per line, but several imports share awkwardly formatted lines. Reading flow: Methods follow a natural progression from shared logic to operator implementations, but missing blank lines and irregular import and parenthesis formatting interrupt scanning.
Run 3
Code Structure: The class logically groups operator constants, a shared combination helper, and operator overloads, although imports and class boundaries lack consistent formatting. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Descriptive names, an informative error message, and a comment explaining operator behavior make the purpose clear. Code length: The implementation is concise, with duplication appropriately centralized in _combine; several imports are unused in the provided snippet. Action granularity: Most statements perform one action, though multiple imports share inconsistently spaced lines. Reading flow: Methods follow a natural sequence, but irregular whitespace, the awkward closing parenthesis, and missing blank lines interrupt scanning.