Sample
int-7af3fa38f519-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.407 | 0–1; higher is more readable |
| Dorn | 0.098 | 0–1; higher is more readable |
| Mi | 0.325 | 0–1; higher is more readable |
| LLOC | 28 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs |
| BTTF | 0.367 | 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. | 3723.947 | −122.89 |
| Source linesThe number of non-empty source lines. | 71 | +28.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.674 | −7.011 |
Intercept 8.87 + feature contributions = -92.632 (log-odds).
Score = sigmoid(-92.632) = 0.
| Score | 0.407 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 71 | +1.719 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 72 | −1.513 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 71 | −1.208 |
| 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.931 | −1.033 |
| 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. | 70.839 | +0.58 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.1 | −0.032 |
Intercept 0.07 + feature contributions = -2.222 (log-odds).
Score = sigmoid(-2.222) = 0.098.
| Score | 0.325 |
|---|
| Score | 28 |
|---|
Run 1
The code demonstrates clear structure with logical separation of concerns, appropriate try-finally resource cleanup, and flat nesting. Variable names like 'sb', 'cb', 'sc', 'cc' are concise but slightly cryptic, though context makes them understandable. The intent of testing multiple connect attempts is clear. The odd use of '(a + b)' for port calculation (which equals 0) appears unnecessarily convoluted and reduces readability. The factory filtering logic uses long generic type declarations that create verbose lines. Overall, the code follows good practices: one action per line, natural reading flow, and proper exception handling. Minor improvements could include better variable naming and simplifying the port calculation.
Run 2
The code has a clear overall structure with test setup and teardown, but readability is reduced by several factors. The lambda wrapper in testMultipleConnect(TestInfo) adds indirection. Magic numbers a=1 and b=-1 obscure the intent of binding to port 0. The variable names 'sb', 'cb', 'sc', 'cc' are terse and not self-documenting. The method testMultipleConnect contains multiple actions per line in some cases and mixes connection logic with assertions. The newFactories method has long generic type declarations and a condition that is difficult to parse quickly. However, nesting is shallow, exception handling is clean with try/finally, and the test flow is logically organized.
Run 3
The code is generally readable with a clear structure: test method, business logic, and factory method are separated. The main test method has a reasonable linear flow with proper resource cleanup in a finally block. However, several issues reduce readability: the variables 'a' and 'b' are unnecessary abstractions (bind address calculation is obscured); the nested anonymous Runner class adds boilerplate that could be simplified; the magic numbers and cryptic variable names (sb, cb, sc, cc) require mental mapping; the 'newFactories' method contains deep nesting with generics and a conditional check that could be extracted. The intent of testing multiple connect attempts is clear, and each major action is on its own line, but the overall code could benefit from better naming and reduced abstraction overhead.
Run 1
Code Structure: Methods logically separate test execution, connection checks, and factory filtering, with cleanup in finally. Nesting: Mostly shallow, though the anonymous runner and loop conditional add some indentation. Clarity of intent: The test name and AlreadyConnectedException assertion clearly communicate the purpose; abbreviated variables (sb, cb, sc, cc) and the unnecessary a + b calculation obscure details. Code length: Reasonably concise, but anonymous-class boilerplate and repeated generic types add verbosity. Action granularity: Statements generally perform one logical action per line, although chained asynchronous calls combine several operations. Reading flow: Setup, connection, assertion, and cleanup follow a natural sequence; dense imports, long generic declarations, and the distracting port calculation slightly interrupt readability.
Run 2
Code Structure: Methods cleanly separate test execution, connection verification, and factory selection; cleanup is organized in finally. Nesting: Mostly shallow, with modest nesting from the anonymous runner, cleanup checks, and factory filtering. Clarity of intent: The test name and AlreadyConnectedException assertion clearly communicate the expected behavior, but abbreviations such as sb, cb, sc, and cc reduce clarity. Computing port zero through a + b unnecessarily obscures intent. Code length: Reasonably compact, though the anonymous runner and repeated generic types add verbosity. Action granularity: Most lines express one logical action; fluent chains combine related operations coherently. Reading flow: Setup, connection attempts, assertion, and cleanup follow a natural sequence. Dense imports, long generic declarations, and the compound type-check condition slightly interrupt readability.
Run 3
Code Structure: Methods cleanly separate test execution, connection assertions, and factory selection; cleanup is organized in finally. Nesting: Mostly shallow, with modest nesting in the anonymous runner and factory filtering. Clarity of intent: The test name and AlreadyConnectedException assertion clearly communicate the purpose, but abbreviated identifiers (sb, cb, sc, cc) and computing port zero as a + b obscure otherwise simple operations. Code length: Reasonably concise, though the anonymous runner and repeated generic types add verbosity, and the two constants are unnecessary. Action granularity: Most lines perform one logical action; chained channel operations remain understandable. Reading flow: Setup, connection, repeated connection, assertion, and cleanup follow a natural sequence. Dense generic declarations, minimally separated imports, and the indirect port expression slightly interrupt readability.