Sample
int-e24027389304-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.649 | 0–1; higher is more readable |
| Dorn | 0.699 | 0–1; higher is more readable |
| Mi | 0.097 | 0–1; higher is more readable |
| LLOC | 44 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.43 | 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. | 4869.167 | −160.682 |
| Source linesThe number of non-empty source lines. | 116 | +46.4 |
| 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.754 | −7.131 |
Intercept 8.87 + feature contributions = -112.544 (log-odds).
Score = sigmoid(-112.544) = 0.
| Score | 0.649 |
|---|
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. | 117 | −3.106 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 103 | +2.826 |
| 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. | 134.94 | −2.05 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 133.803 | +1.354 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 115.912 | +1.21 |
| 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.083 | +0.14 |
Intercept 0.07 + feature contributions = 0.842 (log-odds).
Score = sigmoid(0.842) = 0.699.
| Score | 0.097 |
|---|
| Score | 44 |
|---|
Run 1
The code is highly readable with a clear, logical structure. The class hierarchy and field declarations are well-organized, and method implementations are concise. Nesting is minimal—only conditional/ternary and try-catch blocks are used. Intent is clear from descriptive method/field names and Javadoc. Action granularity is excellent: most operations take one line, except for concise one-liners in `configure` and `fromConnectData` that still remain readable. Reading flow is natural, with methods grouped by interface responsibilities. Minor deductions: the `cast` method suppresses a warning and has a potentially confusing generic T parameter; the `configure` method has a blank line before the closing brace; and the constructor uses assertions instead of explicit argument validation, which slightly obscures runtime intent.
Run 2
The code is well-structured and readable. It has a clear single responsibility (number conversion), follows a flat class layout, and uses meaningful names like NumberConverter, cast, fromConnectData, and toConnectData. Nesting is minimal, with only small try-catch blocks that are easy to follow. Most methods perform a single logical action or a short sequence. The constructor uses assertions to document non-null expectations, and Javadocs add clarity. Minor issues: some methods (e.g., configure) could be slightly more compact, and the cast method's @SuppressWarnings is necessary but slightly noisy. Overall, the code is highly maintainable and understandable.
Run 3
The code is generally readable and well-structured. It has a clear purpose (number conversion), flat methods with good action granularity, and descriptive naming. The constructor and methods are concise, and error handling is centralized. Minor deductions include the use of `assert` for argument validation (which can be disabled in production) instead of `Objects.requireNonNull`, a slightly overloaded ternary in `fromConnectData`, and an unnecessary empty line in `configure`. Additionally, the `cast` method is simple but relies on unchecked casting, which is acceptable given the `@SuppressWarnings`. Overall, the reading flow is logical, and the code is easy to follow.
Run 1
Code Structure: Fields, construction, configuration, conversion, and cleanup are logically organized into focused methods. Nesting: Minimal nesting; short try/catch blocks keep control flow straightforward. Clarity of intent: Descriptive names, interface overrides, and documentation make the converter's purpose clear. The unchecked generic cast and use of StringConverterConfig in a numeric converter introduce minor ambiguity. Code length: Concise overall, with header methods delegating to existing conversion logic rather than duplicating it. Action granularity: Statements generally perform one action per line, although nested calls and a ternary expression slightly compress serialization logic. Reading flow: Natural and consistent, with minor formatting issues such as missing separation between methods and an extra blank line. Long signatures and error-message expressions slightly reduce scanability.
Run 2
Code Structure: Well-organized class with focused methods for configuration, conversion, header delegation, and cleanup. Nesting: Minimal; only straightforward try/catch blocks and inline conditionals. Clarity of intent: Descriptive names, explicit types, and useful documentation make the purpose clear, though the unchecked generic cast and StringConverterConfig reference require extra interpretation. Code length: Concise overall, with delegation avoiding duplicated conversion logic. Action granularity: Generally one action per line; a few long expressions combine casting, serialization, or configuration selection. Reading flow: Natural progression from initialization to configuration, conversion, and cleanup. Minor formatting inconsistencies, such as missing spacing between methods and an extra blank line in configure, slightly reduce polish.
Run 3
Code Structure: Responsibilities are organized into small, focused methods, with header conversion delegating to data conversion to avoid duplication. Nesting: Very shallow; only straightforward try/catch blocks and inline conditional expressions. Clarity of intent: Descriptive names, interface overrides, and useful documentation make the converter's purpose clear. The unchecked cast and reference to StringConverterConfig within a numeric converter slightly reduce clarity. Code length: Concise for the functionality provided, with little unnecessary code. Action granularity: Statements generally perform one action per line; serialization expressions combine a few closely related operations without becoming difficult to follow. Reading flow: Fields, construction, configuration, conversion, and cleanup follow a natural sequence. Minor formatting inconsistencies, including missing separation between methods and an extra blank line, slightly interrupt the otherwise clean presentation.