Sample
int-4bc6af703235-I13
Lower every eligible classic and enhanced for loop to a while loop
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.685 | 0–1; higher is more readable |
| Dorn | 0.167 | 0–1; higher is more readable |
| Mi | 0.291 | 0–1; higher is more readable |
| LLOC | 31 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.617 | 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. | 5569.855 | −183.805 |
| Source linesThe number of non-empty source lines. | 182 | +72.8 |
| 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.627 | −6.941 |
Intercept 8.87 + feature contributions = -109.076 (log-odds).
Score = sigmoid(-109.076) = 0.
| Score | 0.685 |
|---|
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. | 183 | −5.443 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 143 | +4.209 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 143 | −2.861 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 181.991 | +2.134 |
| 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. | 115.962 | −1.246 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 114.656 | +1.045 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.047 | +0.482 |
Intercept 0.07 + feature contributions = -1.609 (log-odds).
Score = sigmoid(-1.609) = 0.167.
| Score | 0.291 |
|---|
| Score | 31 |
|---|
Run 1
The code is highly readable. The structure is logical, with a clear hierarchy of constructors delegating to a main implementation, following a standard Netty pattern. Nesting is minimal; the deepest block is a straightforward iterator in 'rebuildSelectors'. The intent of each constructor is documented with Javadoc, and the deprecated class clearly points to a replacement. Code length is moderate and consistent with providing a comprehensive API. Action granularity is generally one action per line. The 'newChild' method uses simple index-based argument parsing that is concise but slightly less explicit compared to named parameters, though it remains understandable.
Run 2
The code is generally readable, but suffers from constructor overload proliferation and some inconsistencies. Class structure is logical, with clear imports and deprecation notices. However, the many delegating constructors add length and repetitive logic. Nesting is shallow, which is good; the only extra block in `rebuildSelectors` is unnecessary. Intent is mostly clear: this class is a deprecated NIO event loop group that delegates to a newer API. Code length is high due to 12 constructors, many doing similar delegation. Action granularity is strong—each parameter and statement is on its own line. Reading flow is natural from public API to implementation, but the `newChild` method has argument-array parsing that breaks type safety and clarity. The `@deprecated` messages are helpful. Overall, it is readable but feels bloated by compatibility overloads and raw `Object[]` args.
Run 3
The code is generally readable but has some structural and clarity issues. The constructor overloading is logical but creates redundancy—multiple constructors call each other with slightly different arguments, which can be hard to follow. The class structure is mostly flat, which is good, but the `rebuildSelectors` method has an unnecessary nested block, and its loop variable types rely on casting, reducing clarity. The `newChild` method manually parses varargs with type casts and index checks, making intent less obvious than using a clearer parameter object or explicit constructor. Naming is consistent, and documentation on public constructors is helpful, but some constructors lack Javadoc. Code length is somewhat excessive due to many constructors, though each is concise. Action granularity is mostly one action per line, but some method calls wrap awkwardly. Overall, the code is maintainable but could be improved by reducing constructor duplication, removing unnecessary nesting, and using stronger typing for varargs.
Run 1
Code Structure: Logically organized into constructors and lifecycle methods, with consistent delegation rather than tangled logic. Nesting: Mostly flat; rebuildSelectors adds an unnecessary block around its loop. Clarity of intent: Descriptive names and Javadoc explain configuration and behavior, but positional Object... arguments and casts in newChild obscure type expectations. Code length: Individual methods are concise, although numerous similar constructor overloads and repetitive documentation make the class lengthy to scan. Action granularity: Statements generally perform one action each; nested factory calls remain understandable. Reading flow: Constructor ordering progresses naturally from defaults to advanced options, followed by operational methods. Inconsistent indentation, redundant parentheses, and a fully qualified iterator type in rebuildSelectors interrupt otherwise clean formatting.
Run 2
Code Structure: Constructors are logically grouped and delegate consistently, followed by operational methods and child creation. Nesting: Mostly flat, although rebuildSelectors contains an unnecessary block around its loop. Clarity of intent: Descriptive names and Javadoc explain configuration and behavior; positional Object... arguments and casts in newChild reduce transparency. Code length: Numerous constructor overloads and repeated documentation make the class lengthy, though most support legitimate configuration options. Action granularity: Statements generally perform one action each; nested factory calls remain understandable. Reading flow: Organization is natural overall, but inconsistent indentation, long signatures, and the fully qualified iterator, redundant parentheses, and explicit casts in rebuildSelectors interrupt an otherwise clean style.
Run 3
Code Structure: Constructors are grouped logically and delegate consistently, followed by operational methods and child creation. Nesting: Mostly flat, although rebuildSelectors adds an unnecessary block around its loop. Clarity of intent: Descriptive names and Javadoc explain configuration and behavior; positional Object... arguments and casts in newChild reduce transparency. Code length: Numerous constructor overloads and repetitive documentation make the class lengthy, though most support useful configuration options. Action granularity: Statements generally perform one action each; nested factory calls in superclass invocations remain understandable. Reading flow: Consistent delegation and short method bodies support natural reading, but uneven indentation, long parameter lists, and the awkward explicit iterator implementation interrupt it.