Sample
int-7b44d9101902-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.632 | 0–1; higher is more readable |
| Dorn | 0.613 | 0–1; higher is more readable |
| Mi | 0.465 | 0–1; higher is more readable |
| LLOC | 12 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.584 | 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. | 1868.13 | −61.648 |
| Source linesThe number of non-empty source lines. | 50 | +20 |
| 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.593 | −6.89 |
Intercept 8.87 + feature contributions = -39.668 (log-odds).
Score = sigmoid(-39.668) = 0.
| Score | 0.632 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 43 | +0.75 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 50 | −0.734 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 89.961 | +0.647 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 43 | −0.566 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.956 | +0.288 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.081 | +0.153 |
| 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. | 90 | −0.147 |
Intercept 0.07 + feature contributions = 0.462 (log-odds).
Score = sigmoid(0.462) = 0.613.
| Score | 0.465 |
|---|
| Score | 12 |
|---|
Run 1
The code is well-structured and highly readable. It follows a logical server bootstrap pattern with a clear main method, configuration, and resource cleanup in a try-finally block. Imports are comprehensive and the class/method names are descriptive. The builder pattern for ServerBootstrap is formatted consistently with one method call per line, aiding readability. Nesting is minimal, limited to an anonymous ChannelInitializer inner class that contains a single pipeline setup. Comments clarify key steps, and unused code is appropriately commented out. The code is concise and dense without being overcrowded. Minor deductions: hard-coded port constant and slightly long import list are acceptable for an example. Overall, this is approachable even for developers unfamiliar with Netty SCTP specifics.
Run 2
The code is generally well-structured and readable. It follows a clear logical flow: configure the event loop group, set up the server bootstrap with channel options and handler, bind to the port, and wait for shutdown. Nesting is minimal, with only one anonymous inner class for the child handler initializer. The intent is straightforward for anyone familiar with Netty SCTP — echo server setup. Lines are concise and focused, with method chaining improving clarity rather than hurting it. Action granularity is mostly one action per line within the try-finally block, except for the chained bootstrap configuration which is idiomatic. Reading flow is natural: comment sections guide the reader through the steps. Minor deductions: the commented-out handler adds slight noise, and the static PORT initialization via `Integer.parseInt` on the same line is slightly dense. Overall, it's clear, maintainable example code.
Run 3
The code is highly readable. It follows a clear and logical structure: package declaration, imports, class definition, constant, and main method. The main method is organized into configuration, startup, and shutdown sections, each marked with concise comments. Nesting is minimal, with only one anonymous inner class for channel initialization. The purpose of each section is clear, and the code is concise without being overly terse. Actions are generally one per line, especially in the fluent builder pattern, which enhances readability. The reading flow is natural, moving from setup to execution to cleanup. Minor deductions: the commented-out logging handler adds slight clutter, and the anonymous inner class could be replaced with a lambda for modern Java style, but these are very minor issues.
Run 1
Code Structure: Clearly separates configuration, startup, waiting, and cleanup, with reliable resource cleanup in a finally block. Nesting: Mostly shallow, although the anonymous ChannelInitializer inside the fluent configuration adds moderate nesting. Clarity of intent: The class documentation and lifecycle comments explain the purpose well; abbreviated variables b, f, and ch are less descriptive, and echo behavior resides in an external handler. Code length: Concise overall, with a commented-out logging statement and an unnecessarily split addLast call adding minor clutter. Action granularity: Statements generally express one logical action; chained configuration calls are placed on separate lines for easy scanning. Reading flow: Follows the server lifecycle naturally, and consistent indentation makes the fluent configuration readable.
Run 2
Code Structure: Logically separates server configuration, startup, waiting, and cleanup, with reliable cleanup expressed through try/finally. Nesting: Moderate nesting from the anonymous channel initializer inside the try block, but still easy to follow. Clarity of intent: The class name, documentation, and lifecycle comments clearly convey an SCTP echo server; abbreviated variables b, f, and ch are less descriptive. Code length: Concise overall, although the commented-out logging handler adds unnecessary clutter. Action granularity: Statements generally express one action each, and the fluent configuration chain places each configuration step on its own line. Reading flow: Execution follows a natural lifecycle from setup through shutdown, with consistent indentation. The multiline addLast call and lack of spacing after the package declaration slightly reduce polish.
Run 3
Code Structure: Logically organized into configuration, startup, waiting, and cleanup, with resource shutdown clearly placed in finally. Nesting: Mostly shallow, although the anonymous ChannelInitializer inside the fluent configuration adds moderate nesting. Clarity of intent: The class documentation and lifecycle comments communicate the server's purpose; abbreviated names b, f, and ch are less descriptive, and echo behavior is delegated to an external handler. Code length: Compact and appropriate, with little unnecessary code; the commented-out logging statement adds minor clutter. Action granularity: Statements generally perform one action, and fluent configuration operations occupy separate lines. Reading flow: Execution follows a natural server lifecycle, aided by consistent indentation and useful spacing. Missing separation between the package declaration and imports, along with the awkward multiline addLast call, slightly reduces polish.