Sample
int-5c1b0abcf56b-I13
Lower every eligible classic and enhanced for loop to a while loop
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.536 | 0–1; higher is more readable |
| Dorn | 0.09 | 0–1; higher is more readable |
| Mi | 0.119 | 0–1; higher is more readable |
| LLOC | 53 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.307 | 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. | 8568.021 | −282.745 |
| Source linesThe number of non-empty source lines. | 167 | +66.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.722 | −7.083 |
Intercept 8.87 + feature contributions = -214.158 (log-odds).
Score = sigmoid(-214.158) = 0.
| Score | 0.536 |
|---|
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. | 168 | −4.912 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 144 | +4.244 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 144 | −2.884 |
| 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.976 | −2.56 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 166.973 | +1.924 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 146.952 | +1.567 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.072 | +0.24 |
Intercept 0.07 + feature contributions = -2.311 (log-odds).
Score = sigmoid(-2.311) = 0.09.
| Score | 0.119 |
|---|
| Score | 53 |
|---|
Run 1
The code is a mix of readable and problematic sections. The class structure and method breakdown are reasonably logical, but several issues hurt readability. The processExtraArgs method contains unnecessary nested blocks and a non-idiomatic while loop with manual index management, where a for-each would be clearer. Conditional blocks lack braces in places, creating merge risks and reduced clarity. Multiple actions are squeezed into single lines, especially in putConnectorConfig calls. The parseConnectorConfigurationFile method has a clear purpose but becomes lengthy, with three parse attempts that could be extracted or documented better. Variable names are mostly good, but the unusual loop style and extra nesting in processExtraArgs disrupt natural reading flow. The code would benefit significantly from cleaner iteration, consistent bracing, and breaking compound statements into separate lines for better granularity. The error handling is reasonable but adds length.
Run 2
The code is generally readable with clear intent, appropriate method decomposition, and useful Javadoc. The class structure is logical and methods like parseConnectorConfigurationFile are well-organized. However, there are notable readability issues: the processExtraArgs method contains an unnecessary nested block with a manual while loop using loopIndex and loopArray instead of a simpler for-each loop, which hurts clarity. The empty type references (new TypeReference<>() { }) are slightly ambiguous. Multi-line string concatenations in error messages are somewhat awkward. The createHerder method has a long parameter list that could be simplified. Overall, the code is maintainable but has some structural quirks that prevent a higher score.
Run 3
The code has reasonable method decomposition but contains significant readability issues. The processExtraArgs method has unnecessary nesting (redundant braces) and a contrived while-loop that mimics a for-loop with manual index management. Multiple actions are packed into single lines, and the lambda callback is dense. The parseConnectorConfigurationFile method is overly long and tries three parsing strategies in sequence with repeated error handling, making the flow difficult to follow. While imports are organized and class-level Javadoc is good, the method-level implementations lack clear separation of concerns. Variable names are generally descriptive, but the code would benefit from extracting helper methods, using standard for-each loops, and simplifying the JSON/properties parsing logic into smaller, focused methods.
Run 1
Code Structure: Well-separated methods organize CLI execution, configuration parsing, and runtime setup. Nesting: Mostly moderate, but the redundant block and indexed while loop in processExtraArgs add unnecessary depth; nested name validation could also be simplified. Clarity of intent: Descriptive names, documentation, and logging clearly explain responsibilities and parsing order, though the callback name cb is terse. Code length: Generally appropriate, but repeated mandatory-name checks and manual loop bookkeeping introduce avoidable verbosity. Action granularity: Most statements perform one action; indexing combined with incrementing slightly obscures iteration. Reading flow: Sequential parsing fallbacks and small setup methods provide a natural progression, but inconsistent indentation, tightly packed imports, long expressions, and omitted conditional braces reduce visual consistency.
Run 2
Code Structure: Well-separated methods organize CLI behavior, configuration parsing, and runtime creation; parsing fallbacks follow a documented order. Nesting: Mostly moderate, but the redundant block and manual while-loop bookkeeping in processExtraArgs add unnecessary depth, and connector-name validation uses nested conditionals. Clarity of intent: Descriptive names, useful Javadoc, and contextual logging make the purpose clear; the abbreviated callback variable cb is less expressive. Code length: Generally appropriate, though repeated mandatory-name validation and verbose loop setup could be simplified. Action granularity: Most statements perform one action, but array access combined with index increment slightly complicates reading. Reading flow: Startup and parsing sequences are natural, with early returns aiding comprehension; inconsistent indentation, tightly packed imports, and long expressions create minor friction.
Run 3
Code Structure: Well-separated methods organize CLI setup, connector creation, configuration parsing, and runtime construction. Nesting: Mostly moderate, but the redundant block and manual indexed loop in processExtraArgs add unnecessary depth; nested name validation could be flattened. Clarity of intent: Descriptive identifiers, useful documentation, and contextual logging make the purpose and parsing fallback order clear. Code length: Generally appropriate, although repeated mandatory-name validation and verbose loop scaffolding add avoidable length. Action granularity: Most statements perform one action, but array access combined with index increment slightly obscures iteration. Reading flow: Methods follow a logical lifecycle, and sequential parsing attempts are easy to follow. Inconsistent indentation, long signatures and expressions, ungrouped imports, and exception-driven fallbacks introduce minor friction.