Sample
int-b53c49324e5d-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.752 | 0–1; higher is more readable |
| Dorn | 0.321 | 0–1; higher is more readable |
| Mi | 0.654 | 0–1; higher is more readable |
| LLOC | 69 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.358 | 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. | 5072.508 | −167.393 |
| Source linesThe number of non-empty source lines. | 154 | +61.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.767 | −7.151 |
Intercept 8.87 + feature contributions = -104.074 (log-odds).
Score = sigmoid(-104.074) = 0.
| Score | 0.752 |
|---|
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. | 154 | −4.416 |
| 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. | 153.856 | +1.741 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 95.948 | +0.744 |
| 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. | 95.961 | −0.399 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.085 | +0.117 |
Intercept 0.07 + feature contributions = -0.749 (log-odds).
Score = sigmoid(-0.749) = 0.321.
| Score | 0.654 |
|---|
| Score | 69 |
|---|
Run 1
The code has a confusing if/else structure in newHasher() with an empty if block and inverted logic, which severely impacts readability. The use of `if (!((supportsClone))) {} else {` is unnecessarily convoluted and should be `if (supportsClone)`. Dead code (unused variable) and an empty catch block also reduce clarity. Some positive aspects: methods are generally small and focused, variable names are mostly clear, and serialization is handled in a separate class. However, the illogical conditional structure, empty blocks, and awkward nesting make the flow difficult to follow. Action granularity is mostly fine (one operation per line), but the overall structure suffers from the confusing cloning logic and unnecessary syntactic complexity. The code would benefit from flattening the conditional logic, removing empty blocks, and clarifying the fallthrough behavior with comments or restructuring.
Run 2
The code is well-structured and generally readable. It has clear class organization, reasonable nesting, and good naming conventions. Methods like `supportsClone`, `checkNotDone`, and `hash` demonstrate clear intent and appropriate action granularity. The constructors are concise, and serialization handling is properly separated. Minor readability issues prevent a perfect score: the `newHasher` method contains an awkward empty `if` block with an `else` that inverts the logic unnecessarily, and the `MessageDigestHasher.hash()` method crams a ternary operation into a return statement, slightly reducing clarity. The `supportsClone` method uses a throwaway `unused` variable, which is understandable but not ideal. Overall, the code follows good practices for readability with only minor areas for improvement.
Run 3
The code has clear intent and logical organization, with purposeful classes and methods. However, readability is reduced by inconsistent formatting, particularly the `newHasher()` method: it contains an empty if block with an else clause, which is confusing and unnatural. The condition `if (!((supportsClone))) {} else { ... }` is awkwardly structured and adds unnecessary nesting. Additionally, the constructor logic is somewhat duplicated and could be more concise. While the overall flow is understandable, the action granularity suffers in a few places due to packed conditions and the weird empty branch. The code is not deeply nested overall, but the `newHasher()` structure disrupts the reading flow and clarity of intent. The use of `MessageDigest` and serialization is handled correctly, but the weird empty if block and inconsistent formatting lower the score. A cleaner refactor of `newHasher()` to use a straightforward if condition would improve clarity significantly.
Run 1
Code Structure: Well-organized adapter with separate nested classes for serialization and hashing, plus focused helper methods. Nesting: Generally shallow, though newHasher unnecessarily nests a try/catch inside an else following an empty if. Clarity of intent: Descriptive names, explicit state checks, and brief comments make the purpose clear; the inverted, redundantly parenthesized supportsClone condition obscures intent, and the validation message says '<' while the check permits equality. Code length: Mostly concise, with reasonable boilerplate and minor constructor duplication. Action granularity: Statements generally perform one action per line; the empty if/else on one line is an awkward exception. Reading flow: Methods follow a coherent progression, but the unusual clone branch interrupts otherwise natural control flow.
Run 2
Code Structure: Well organized into focused helpers, a serialization proxy, and a dedicated hasher class. Nesting: Generally shallow, although newHasher unnecessarily nests a try/catch inside an awkward empty if/else. Clarity of intent: Descriptive names, explicit validation, and short methods make digest creation, updates, and finalization clear; the negated, over-parenthesized supportsClone condition obscures an otherwise simple decision. Code length: Mostly concise, with reasonable repetition across constructors and update overloads. Action granularity: Nearly every line performs one action, except the compressed empty conditional; the final ternary remains manageable. Reading flow: Consistent formatting and cohesive method grouping support natural reading, but newHasher interrupts that flow. Minor distractions include the unused clone variable and a validation message stating '<' when the condition permits equality.
Run 3
Code Structure: Well organized into an adapter, serialization proxy, and dedicated hasher, with small, focused methods. Nesting: Generally shallow; the conditional and try/catch in newHasher add modest complexity. Clarity of intent: Descriptive names, overrides, and validation make the purpose clear, but the negated condition with excessive parentheses and an empty branch obscures the clone fallback. Code length: Mostly concise; constructor duplication and serialization boilerplate add some length without seriously hindering comprehension. Action granularity: Almost every statement performs one action, although the compressed empty if/else formatting is distracting. Reading flow: Consistent formatting and cohesive method grouping support natural reading, with minor interruptions from the unusual newHasher conditional and the multiline ternary in hash().