Sample
int-3cd3f649fd95-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.405 | 0–1; higher is more readable |
| Dorn | 0.098 | 0–1; higher is more readable |
| Mi | 0.223 | 0–1; higher is more readable |
| LLOC | 25 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.421 | 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. | 3539.561 | −116.806 |
| Source linesThe number of non-empty source lines. | 69 | +27.6 |
| 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.679 | −7.018 |
Intercept 8.87 + feature contributions = -87.353 (log-odds).
Score = sigmoid(-87.353) = 0.
| Score | 0.405 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 69 | +1.65 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 70 | −1.442 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 69 | −1.163 |
| 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.986 | −1.036 |
| 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. | 68.875 | +0.553 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.102 | −0.046 |
Intercept 0.07 + feature contributions = -2.218 (log-odds).
Score = sigmoid(-2.218) = 0.098.
| Score | 0.223 |
|---|
| Score | 25 |
|---|
Run 1
The code is generally readable with clear structure: imports are organized, methods are logically separated, and error handling uses a try-finally block. Naming is mostly clear (sb, cb, sc, cc are somewhat abbreviated but understandable in context). The test method follows a typical Netty test pattern, making the purpose clear. Nesting is minimal, with only one anonymous inner class and one if statement. The main readability issue is the long line in assertTrue, which combines multiple operations (connect, await, cause check) and makes the intent slightly harder to parse. Also, some variable names could be more descriptive. The newFactories method is reasonably structured but uses long generic type declarations. Overall, the code is maintainable and follows established Netty testing conventions, with minor opportunities for improvement in line length and variable naming.
Run 2
The code is well-structured with clear separation between test setup, execution, and teardown. The main test logic is flat with minimal nesting, using try-finally for clean resource management. Variables are named descriptively (sc, cc, sb, cb). Each line generally performs one action, though the assertion line combines connect, await, and cause extraction. The factory method is straightforward but could be more concise with streams. The reading flow is natural: setup, execute, verify, cleanup. Points deducted for the long generic type declarations, the slightly complex assertion line, and the verbose loop in newFactories that could use a stream filter. Overall, the code demonstrates good readability practices despite some minor verbosity in type declarations.
Run 3
The code is well-structured and readable for a Netty test class. It has clear logical organization, minimal nesting, and good separation of concerns. Method names are descriptive, and the test follows a clear setup-execute-assert pattern. The use of try-finally for resource cleanup is proper. However, there are a few minor issues: the assertTrue line is long with nested method calls, the anonymous inner class Runner adds slight complexity, and the newFactories method could benefit from more line breaks for clarity. The single long assert statement could be split into multiple lines for better readability. Overall, the code is concise, follows good practices, and clearly expresses its intent, making it accessible to developers familiar with Netty testing patterns.
Run 1
Code Structure: Clearly separates test execution, connection verification, and bootstrap factory filtering. Nesting: Mostly shallow; the anonymous runner and try/finally cleanup add modest nesting without becoming tangled. Clarity of intent: The test name and AlreadyConnectedException assertion communicate the purpose, but abbreviated variables (sb, cb, sc, cc) and the unexplained factory filter reduce clarity. Code length: Reasonably concise, though verbose generic declarations and the anonymous runner add boilerplate; ChannelFuture is an unused import. Action granularity: Statements generally perform one logical action per line, although chained asynchronous operations and the assertion combine several steps. Reading flow: Setup, connection, verification, and cleanup follow a natural sequence. Long generic signatures, redundant assertion parentheses, and limited explanation of transport filtering slightly interrupt readability.
Run 2
Code Structure: Well-organized methods separate test execution, connection behavior, and factory selection. Nesting: Mostly shallow; the anonymous runner and cleanup checks add modest nesting. Clarity of intent: The test name and AlreadyConnectedException assertion clearly communicate the purpose, but abbreviated names such as sb, cb, sc, and cc require extra interpretation. Code length: Reasonably concise, although the anonymous runner and repeated generic types are verbose, and ChannelFuture is unused. Action granularity: Statements generally perform one logical action per line, though chained asynchronous operations and the inline assertion combine several steps. Reading flow: Setup, connection, assertion, and cleanup follow a natural sequence; long generic declarations and the compound factory-filter condition slightly interrupt scanning.
Run 3
Code Structure: Clearly separates the test entry point, connection test, and bootstrap factory filtering. Nesting: Mostly shallow; the anonymous runner and try/finally cleanup introduce manageable nesting. Clarity of intent: The test name and AlreadyConnectedException assertion communicate the purpose, but abbreviated names (sb, cb, sc, cc) and the unexplained factory restriction reduce clarity. Code length: Reasonably concise, though verbose generic declarations and the anonymous runner add boilerplate; ChannelFuture is an unused import. Action granularity: Most statements perform one logical action, but chained registration/binding calls and the connect-await-cause assertion combine several operations. Reading flow: Setup, connection, verification, and cleanup follow a natural sequence. Factory filtering is straightforward, although long type declarations and the compound type-check condition slow scanning.