Sample
int-a5b482fd7696-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.545 | 0–1; higher is more readable |
| Scalabrino | 0.853 | 0–1; higher is more readable |
| Dorn | 0.73 | 0–1; higher is more readable |
| Mi | 0.734 | 0–1; higher is more readable |
| LLOC | 10 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 5 | 0–20; mean of three runs |
| GPT-6.1 Sol | 11.33 | 0–20; mean of three runs |
| BTTF | 0.171 | 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. | 598.547 | −19.752 |
| Source linesThe number of non-empty source lines. | 45 | +18 |
| 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.625 | −6.937 |
Intercept 8.87 + feature contributions = 0.181 (log-odds).
Score = sigmoid(0.181) = 0.545.
| Score | 0.853 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 46 | −0.592 |
| 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.935 | +0.576 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 35 | +0.473 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 35 | −0.382 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 73 | +0.373 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.07 | +0.259 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 44.838 | +0.217 |
Intercept 0.07 + feature contributions = 0.994 (log-odds).
Score = sigmoid(0.994) = 0.73.
| Score | 0.734 |
|---|
| Score | 10 |
|---|
Run 1
The code is partially readable. It has a logical class structure with appropriate constructors and documentation, and the nesting is shallow. However, there is a major flaw: a block of unrelated code is embedded inside the `EncoderException(String message)` constructor, before its closing brace. This introduces an incorrect method body and an extra closing brace, breaking the code structure and making intent ambiguous. The embedded loop is not relevant to the exception class, harming clarity and reading flow. Otherwise, the exception class features are clear, concise, and follow standard patterns for a custom exception. The code would be much more readable and correct if the erroneous embedded block were removed.
Run 2
The code contains a critical syntax error: a random block of Java code is inserted inside the EncoderException(String message) constructor, breaking the class structure. This makes the code uncompilable and completely unreadable. Additionally, while the original Netty exception class follows good practices such as clear naming, flat structure, and concise constructors, the erroneous inserted loop and misplaced braces destroy all readability. The code structure is tangled, nesting is broken, clarity of intent is lost, and action granularity is violated due to multiple unrelated statements placed arbitrarily. Reading flow is severely disrupted. No score above zero is justified until the stray code is removed and the constructor's closing brace is restored.
Run 3
The code is severely undermined by a malformed block inserted into the EncoderException(String) constructor. This block contains unrelated logic (counting even numbers) that is neither valid Java nor appropriate in this context, creating a syntax error and breaking the logical structure. The surrounding exception class is otherwise minimal and clear, with standard constructors and Javadoc, but the embedded loop destroys the reading flow, clarity of intent, and code structure. Action granularity is also harmed since the loop's purpose is disconnected from the class. Overall, this appears to be an accidental paste or generated mistake, making the code unreadable and non-functional despite the rest being simple and idiomatic.
Run 1
Code Structure: The exception class and constructor overloads are logically organized, but an unrelated counting block disrupts the message constructor. Nesting: Most code is flat; the extra block, loop, and conditional introduce unnecessary nesting. Clarity of intent: The exception wrapper's purpose is clear, but counting even numbers serves no apparent purpose and the result is unused. Code length: The class is otherwise concise, but the counting block adds needless length and repetitive constructor comments offer little value. Action granularity: Statements generally perform one action per line, with only the conventional loop header combining control operations. Reading flow: Constructor ordering is natural, but inconsistent indentation and the unexpected counting logic interrupt the flow.
Run 2
Code Structure: The exception class and constructor overloads are logically organized, but an unrelated counting block disrupts one constructor. Nesting: Most code is flat, while the inserted block adds unnecessary block, loop, and conditional nesting. Clarity of intent: The class purpose and super calls are clear; counting even numbers without using the result has no apparent purpose. Code length: The exception boilerplate is concise, but the counting logic and repetitive generic comments add unnecessary length. Action granularity: Statements generally perform one action per line, though the loop header combines initialization, testing, and incrementing conventionally. Reading flow: Constructor ordering is easy to follow, but inconsistent indentation and the unexpected counting block interrupt the otherwise natural flow.
Run 3
Code Structure: The exception class and constructor overloads are logically organized, but an unrelated counting block disrupts the message constructor. Nesting: Most code is flat; the inserted block adds unnecessary block, loop, and conditional nesting. Clarity of intent: The class purpose and superclass delegation are clear, but counting even numbers without using the result has no apparent purpose. Code length: The exception implementation is concise, while the counting block and repetitive constructor documentation add unnecessary length. Action granularity: Statements generally perform one action per line, with a conventional multi-part loop header. Reading flow: Constructor ordering is easy to follow, but inconsistent indentation and the unexpected counting block interrupt an otherwise natural flow.