Sample
int-e38351ed7aaf-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.666 | 0–1; higher is more readable |
| Dorn | 0.292 | 0–1; higher is more readable |
| Mi | 0.833 | 0–1; higher is more readable |
| LLOC | 41 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.385 | 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. | 3169.402 | −104.59 |
| Source linesThe number of non-empty source lines. | 135 | +54 |
| 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.025 | −7.537 |
Intercept 8.87 + feature contributions = -49.258 (log-odds).
Score = sigmoid(-49.258) = 0.
| Score | 0.666 |
|---|
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. | 136 | −3.779 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 128 | +3.69 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 128 | −2.516 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 134.831 | +1.475 |
| 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.941 | −1.288 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 116.963 | +1.083 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.058 | +0.38 |
Intercept 0.07 + feature contributions = -0.886 (log-odds).
Score = sigmoid(-0.886) = 0.292.
| Score | 0.833 |
|---|
| Score | 41 |
|---|
Run 1
The code has clear structure with proper field declarations and a consistent getter/setter pattern, but it contains a critical readability flaw: a block of dead code (startingPosition/endingPosition/travelDistance) inexplicably inserted inside setDefaultMaxSessionIdleTimeout(). This unrelated code breaks logical organization and clarity of intent. Nesting is minimal and flat, which is good, as each method performs a single action. The unsupported operation methods are clear but repetitive, inflating code length with similar exception-throwing patterns. Action granularity is generally one action per line, but the dead code introduces multiple unrelated operations. Reading flow follows interface method groupings (WebSocketContainer then ServerContainer), which is logical, but the anomalous block interrupts it severely. Naming is conventional and clear. Overall, the code would be quite readable for a mock implementation if the injected dead code were removed, but as presented it is confusing and fails to maintain intent.
Run 2
The code has a clear structure with a mock class implementing an interface, and it follows basic Java conventions. However, it contains a major readability problem: an unrelated code block about travel distance calculation appears in the middle of the setDefaultMaxSessionIdleTimeout method. This breaks the reading flow and creates confusion about intent. Additionally, the class uses a mix of direct field access ('this.defaultAsyncSendTimeout') and simple assignments, but the repeated 'UnsupportedOperationException' patterns are verbose. Nesting is mostly flat, and action granularity is reasonable, but the accidental code block significantly reduces clarity. The imports are clean and the class is logically organized, but this extraneous code and some redundancy keep the score low.
Run 3
The code is generally readable with clear naming and logical structure (getters/setters, then connect methods, then server container methods). However, it contains an unexplained, dead-code block inside setDefaultMaxSessionIdleTimeout that is completely unrelated to the method’s purpose, breaking reading flow and clarity. Nesting is minimal, and most methods are one-line throw statements, which is concise but repetitive. Action granularity is fine, but the stray block disrupts intent. Without it, the score would be higher.
Run 1
Code Structure: Fields and methods are logically grouped by interface, but an unrelated distance-calculation block disrupts the timeout setter. Nesting: Most methods are flat; the stray block adds unnecessary scope and conditional nesting. Clarity of intent: Descriptive names, documentation, and explicit exception messages clearly communicate the mock's behavior, except for the unused distance calculation. Code length: Methods are concise; repeated unsupported-operation implementations are understandable interface boilerplate, while the inserted calculation is unnecessary. Action granularity: Each statement performs one clear action, generally on its own line. Reading flow: Consistent method patterns and section comments make scanning easy, but the inserted block's inconsistent indentation and irrelevant logic interrupt an otherwise natural flow.
Run 2
Code Structure: Fields and interface methods are logically grouped, but an unrelated calculation disrupts the idle-timeout setter. Nesting: Most methods are flat; the stray block introduces unnecessary nesting and a conditional. Clarity of intent: Descriptive names, documentation, and explicit unsupported-operation messages make the mock's purpose clear, while the unused travel-distance calculation is confusing. Code length: Methods are concise; most repetition follows interface requirements, but the unrelated block adds needless length. Action granularity: Statements generally perform one action per line. Reading flow: Consistent accessor patterns and section comments support natural scanning, although the stray block's inconsistent indentation and irrelevant logic interrupt that flow.
Run 3
Code Structure: Fields and methods are logically grouped by interface, but an unrelated distance-calculation block disrupts one setter. Nesting: Most methods are flat; the unnecessary block and conditional introduce avoidable nesting. Clarity of intent: Descriptive names, overrides, documentation, and explicit unsupported-operation messages clearly convey the mock's purpose, except for the unused distance calculation. Code length: Methods are concise; repeated exception handling is reasonable interface boilerplate, while the inserted calculation adds needless length. Action granularity: Each statement performs one action, making individual operations easy to follow. Reading flow: Consistent getter/setter patterns and section comments support natural reading, but the calculation block's inconsistent indentation and irrelevant logic interrupt that flow.