Sample
int-5f78302568fd-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.007 | 0–1; higher is more readable |
| Scalabrino | 0.789 | 0–1; higher is more readable |
| Dorn | 0.852 | 0–1; higher is more readable |
| Mi | 0.713 | 0–1; higher is more readable |
| LLOC | 7 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.675 | 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. | 548.833 | −18.111 |
| Source linesThe number of non-empty source lines. | 28 | +11.2 |
| 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.635 | −6.953 |
Intercept 8.87 + feature contributions = -4.995 (log-odds).
Score = sigmoid(-4.995) = 0.007.
| Score | 0.789 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 72.966 | +0.575 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 72.966 | +0.373 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.074 | +0.22 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 25 | +0.128 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 27.649 | −0.023 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 29 | +0.01 |
Intercept 0.07 + feature contributions = 1.749 (log-odds).
Score = sigmoid(1.749) = 0.852.
| Score | 0.713 |
|---|
| Score | 7 |
|---|
Run 1
The code has a clear structure with a single class and separated methods, but it appears to contain errors. The method names 'channel', 'channel2', and 'exception' do not match standard Netty handler method names like 'channelRead', 'channelReadComplete', and 'exceptionCaught', suggesting the code may not compile or function correctly. If these are typos, clarity of intent suffers significantly. Nesting depth is minimal and action granularity is mostly one action per line, which improves readability. However, the abbreviated parameter name 'cau' in the exception method is ambiguous and reduces clarity. The code is concise but possibly too abbreviated, and the incorrect method names disrupt natural reading flow for developers familiar with Netty. Overall, the structure is logical but the naming issues and potential typos lower the readability score.
Run 2
The code has a clear class structure and basic documentation, but several issues reduce readability. The method names are incorrect for Netty handlers — 'channel', 'channel2', and 'exception' should be 'channelRead', 'channelReadComplete', and 'exceptionCaught', which makes the intent ambiguous. The parameter name 'cau' is unclear. Naming aside, the code is flat and concise with one action per line, which is positive. However, the 'channel' method writes but doesn't flush, relying on a separate oddly-named method to complete the action — this fragments the logic and hurts reading flow. The exception handler is straightforward. Overall, the organization is logical but the incorrect naming and fragmented write/flush pattern significantly reduce clarity.
Run 3
The code has good structural elements like package declaration, imports, class annotation, and Javadoc, but the method naming and implementation show significant readability problems. Methods named 'channel' and 'channel2' are ambiguous and fail to convey intent - they appear to be incorrectly named overrides of channelRead and channelReadComplete. The 'channel2' method name is particularly problematic. The exception parameter 'cau' is an unclear abbreviation. While the code is flat with no nesting and has one action per line, the disorganized method names break the natural reading flow and make the code's purpose unclear. A reader familiar with Netty would expect standard lifecycle method names. The code is concise but at the cost of clarity. The missing @Override annotations on what appear to be lifecycle methods suggest these are not correct overrides, further confusing intent. Overall structure is logical but execution details undermine readability.
Run 1
Code Structure: A single handler class cleanly separates writing, flushing, and exception handling. Nesting: Methods are flat, with no conditional or loop nesting. Clarity of intent: The class name and documentation identify an echo server, but channel, channel2, and exception are vague callback names; cau is also less clear than cause. These names do not match the standard ChannelInboundHandlerAdapter callbacks, making the overrides misleading. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs one action on its own line. Reading flow: The progression from message handling to flushing to error handling is natural, though a blank line between the package declaration and imports would improve formatting.
Run 2
Code Structure: The class is logically organized into three short event-handling methods. Nesting: There is no nested control flow, making the code easy to scan. Clarity of intent: The class name, documentation, and write/flush/close operations convey an echo handler, but method names channel, channel2, and exception are vague; cau is also less descriptive than cause. The @Override annotations are confusing because these names do not match the usual ChannelInboundHandlerAdapter callbacks. Code length: The implementation is concise without unnecessary logic. Action granularity: Each executable line performs one action. Reading flow: The sequence from writing to flushing to exception handling is natural, although clearer callback names and a blank line after the package declaration would improve readability.
Run 3
Code Structure: The class is logically organized into three small handlers, with clear imports and an explanatory class comment. Nesting: No nested control flow, making each method easy to scan. Clarity of intent: Writing, flushing, and closing on an exception are understandable, but generic method names such as channel and channel2 obscure lifecycle roles, and cau is less clear than cause. The @Override annotations appear inconsistent with standard Netty callback names, adding confusion about intended behavior. Code length: Concise, without unnecessary implementation detail. Action granularity: Each statement performs one action on its own line. Reading flow: Methods follow a natural progression from message handling to flushing and exception handling, although a blank line between the package declaration and imports would improve visual separation.