Sample
int-1bf79c9c0543-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.676 | 0–1; higher is more readable |
| Dorn | 0.873 | 0–1; higher is more readable |
| Mi | 0.822 | 0–1; higher is more readable |
| LLOC | 36 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 18 | 0–20; mean of three runs |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs |
| BTTF | 0.74 | 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. | 2903.683 | −95.822 |
| Source linesThe number of non-empty source lines. | 126 | +50.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. | 5.023 | −7.535 |
Intercept 8.87 + feature contributions = -44.086 (log-odds).
Score = sigmoid(-44.086) = 0.
| Score | 0.676 |
|---|
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. | 127 | −3.46 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 119 | +3.379 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 125.805 | +1.349 |
| 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. | 116.969 | −1.289 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 116.961 | +1.083 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.056 | +0.398 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 1.927 (log-odds).
Score = sigmoid(1.927) = 0.873.
| Score | 0.822 |
|---|
| Score | 36 |
|---|
Run 1
The code is highly readable due to its clear structure: it is organized into logical sections (WebSocketContainer methods and ServerContainer methods) with comments separating them. Nesting is completely flat, with no conditional blocks or deep indentation. Each method has a clear, single purpose—either returning a simple value or throwing an UnsupportedOperationException—making the intent unambiguous. The code is concise and avoids unnecessary verbosity, with one action per line for throws and returns. Reading flow is natural, following the interface method order and grouping related functionality. Import statements and class-level Javadoc are clean. The only minor deduction is the slight repetition in exception messages, which could be refactored to a helper method, but this does not significantly harm readability.
Run 2
The code is highly readable. It follows a consistent structure, grouping methods by interface sections (WebSocketContainer, ServerContainer) with clear comments. Nesting is minimal, with no deep conditional blocks. Each method has a single clear purpose, typically returning a field or throwing an UnsupportedOperationException. Action granularity is appropriate—one logical operation per line. The reading flow is natural, with getters/setters paired logically and unsupported operations grouped together. The code is concise, avoiding unnecessary verbosity while maintaining clarity. Minor deductions: repetitive UnsupportedOperationException messages could be extracted to constants, and some methods signatures are long, but overall readability is excellent.
Run 3
The code is highly readable. It follows a clean, consistent structure with clear section comments separating WebSocketContainer and ServerContainer method groups. Nesting is flat—no conditional or loop complexity. Each method's intent is unambiguous, simply returning defaults or throwing UnsupportedOperationException with descriptive messages. The code is concise; no excessive boilerplate beyond what the interface requires. Action granularity is appropriate, with one operation per line. Reading flow is natural, with methods logically ordered and grouped. Minor deductions: some import lines are unused (Map, Set are used, but jakarta.websocket.Endpoint, ServerContainer imports are used; actually all imports appear used except possibly none). Very minor line-wrapping in method signatures slightly affects flow but remains clear. Overall, it is exemplary straightforward mock implementation code.
Run 1
Code Structure: Fields and methods are logically organized, with comments separating WebSocketContainer and ServerContainer responsibilities. Nesting: Methods are flat, with no nested control flow. Clarity of intent: The class documentation, descriptive field names, and explicit exception messages clearly communicate the mock's supported and unsupported behavior; abbreviated parameters such as cec and sec are slightly less clear. Code length: The implementation is concise for the required interface, although repetitive accessors and exception statements add unavoidable boilerplate. Action granularity: Each statement performs a single action, making individual methods easy to inspect. Reading flow: Consistent formatting and paired getters/setters provide a natural progression; a few long signatures and wrapped exception messages mildly interrupt scanning.
Run 2
Code Structure: Fields and methods are logically organized, with comments separating WebSocketContainer and ServerContainer responsibilities. Nesting: Methods are flat, with no nested control flow. Clarity of intent: The class documentation, descriptive names, and explicit exception messages clearly communicate the mock's supported configuration behavior and unsupported operations. Code length: Methods are concise; repeated exception statements and accessors add length but largely reflect interface requirements. Action granularity: Each statement performs a single action, making behavior easy to inspect. Reading flow: Consistent annotations, indentation, spacing, and predictable getter/setter ordering support natural reading. Minor drawbacks include long signatures and exception messages, abbreviated parameter names such as cec and sec, and the lack of spacing between the package declaration and imports.
Run 3
Code Structure: Fields and methods are logically organized, with comments separating WebSocketContainer and ServerContainer responsibilities. Nesting: All methods are flat, with no nested control flow. Clarity of intent: The class documentation, descriptive field names, standard accessor methods, and explicit unsupported-operation messages clearly communicate the mock's behavior; abbreviated parameters such as cec and sec are slightly less clear. Code length: Methods are minimal, although interface-required overloads and repeated exception messages add unavoidable boilerplate. Action granularity: Each statement performs one action, and methods generally contain a single statement. Reading flow: Consistent formatting and paired getters/setters make the code easy to scan; long signatures and exception messages cause minor line-wrapping interruptions.