Sample
int-c09ad0884ffd-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.387 | 0–1; higher is more readable |
| Dorn | 0.093 | 0–1; higher is more readable |
| Mi | 0.344 | 0–1; higher is more readable |
| LLOC | 30 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.293 | 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. | 3813.052 | −125.831 |
| Source linesThe number of non-empty source lines. | 76 | +30.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.702 | −7.054 |
Intercept 8.87 + feature contributions = -93.614 (log-odds).
Score = sigmoid(-93.614) = 0.
| Score | 0.387 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 76 | +1.892 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 77 | −1.69 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 76 | −1.323 |
| 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. | 110.961 | −1.035 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 75.857 | +0.651 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.101 | −0.038 |
Intercept 0.07 + feature contributions = -2.278 (log-odds).
Score = sigmoid(-2.278) = 0.093.
| Score | 0.344 |
|---|
| Score | 30 |
|---|
Run 1
The code is generally well-structured with clear intent and reasonable granularity. It follows standard Java conventions, uses try-finally for resource cleanup, and breaks logic into small methods. However, readability is reduced by a meaningless standalone block at the start of the test method that toggles an unused variable, which is confusing and appears to be dead code. The test method also includes extra blank lines and an awkward empty child handler instantiation. The `newFactories` method uses a long generic type name repeatedly, making lines verbose. Nesting is shallow overall, action granularity is mostly one action per line, and the flow from setup to assertion is logical. Minor improvements would include removing the dead block, using local variable type inference (var) for generics, and adding comments to explain why the NIO type check is needed.
Run 2
The code has several readability issues. The most glaring is the dead code block at the start of testMultipleConnect (the featureEnabled loop) which serves no purpose and confuses intent. The test method structure is overloaded - same name used for test wrapper and actual implementation adds ambiguity. Deeply nested anonymous Runner class reduces clarity. Multiple operations are chained on single lines (syncUninterruptibly().channel()), making it harder to follow execution flow. Resource cleanup in finally is reasonable but could use try-with-resources. The newFactories method has long lines and mixed concerns between filtering and list building. However, the code does follow some good practices: clean package structure, clear variable naming (sc/cc), explicit assertions, and logical separation of test setup and execution. The filtering loop in newFactories is straightforward despite verbosity. Overall the code is functional but suffers from unnecessary complexity, dead code, and overly compact expressions that reduce readability.
Run 3
The code has significant readability issues. There is a stray, meaningless block with a dead code loop that toggles a boolean three times, which is confusing and serves no purpose. The test method delegates to an inner Runner, adding indirection. The main test logic uses syncUninterruptibly() repeatedly, keeping operations on single lines but with long method chains that hamper clarity. The intent of checking AlreadyConnectedException is present but buried. Variable names like 'sc' and 'cc' are short and ambiguous. The newFactories method has nested generics and long type declarations, reducing readability. Overall, structure, intent, and flow are poor.
Run 1
Code Structure: Test execution, connection checks, and factory selection are sensibly separated, but the unrelated featureEnabled block disrupts organization. Nesting: Mostly moderate; the anonymous runner, try/finally cleanup, and factory filtering add manageable depth. Clarity of intent: The repeated-connect test and expected exception are clear, but abbreviated names (sb, cb, sc, cc) and the unused toggle obscure intent. Code length: Generally compact, though the toggle block and verbose generic declarations add unnecessary length. Action granularity: Most statements perform one action per line; chained connection calls remain understandable. Reading flow: Setup, execution, assertion, and cleanup follow a natural sequence, but inconsistent indentation in the toggle block and dense imports interrupt scanning.
Run 2
Code Structure: Test execution, connection assertions, cleanup, and factory filtering are logically separated, but an unrelated toggle block disrupts organization. Nesting: Mostly moderate, with understandable try/finally and conditional cleanup; the anonymous runner and redundant block add depth. Clarity of intent: The test name and AlreadyConnectedException assertion clearly communicate the purpose, while abbreviated variables (sb, cb, sc, cc) and the unused featureEnabled loop obscure intent. Code length: Generally compact, but the toggle loop is unnecessary and repeated generic types add verbosity. Action granularity: Statements mostly perform one action per line, although chained setup calls combine several operations. Reading flow: The main test follows a natural setup-connect-assert-cleanup sequence, but inconsistent indentation in the toggle block and dense generic declarations interrupt readability.
Run 3
Code Structure: Methods logically separate test execution, connection checks, and factory selection, but the unrelated featureEnabled block disrupts organization. Nesting: Mostly shallow, with manageable try/finally, conditionals, and an anonymous runner. Clarity of intent: The test name and AlreadyConnectedException assertion clearly communicate purpose; abbreviated variables sb, cb, sc, and cc and the unused toggle loop reduce clarity. Code length: Reasonably concise overall, though the toggle block is unnecessary and repeated generic types add verbosity. Action granularity: Most lines contain one statement, but chained bootstrap and connection calls combine several operations. Reading flow: Setup, execution, assertion, and cleanup follow a natural sequence; inconsistent indentation in the toggle block and dense generic declarations interrupt that flow.