Sample
int-5a7b0fe51749-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.627 | 0–1; higher is more readable |
| Dorn | 0.416 | 0–1; higher is more readable |
| Mi | 0.057 | 0–1; higher is more readable |
| LLOC | 23 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.364 | 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. | 2480.533 | −81.858 |
| Source linesThe number of non-empty source lines. | 63 | +25.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.62 | −6.93 |
Intercept 8.87 + feature contributions = -54.717 (log-odds).
Score = sigmoid(-54.717) = 0.
| Score | 0.627 |
|---|
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. | 118 | −1.333 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 58 | +1.269 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 64 | −1.23 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 117.891 | +1.098 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 58 | −0.91 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 62.874 | +0.469 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.074 | +0.227 |
Intercept 0.07 + feature contributions = -0.339 (log-odds).
Score = sigmoid(-0.339) = 0.416.
| Score | 0.057 |
|---|
| Score | 23 |
|---|
Run 1
The code has a simple, mostly clear structure with method delegations, but has several readability issues. The variable names 'a' and 'b' are meaningless; the constant '15' should be named (e.g., JAVA_VERSION_WITH_PROTOCOL_FAMILY). The method name 'findOpenMethod' is confusing because it returns a Method object rather than opening anything, so 'findSelectorProviderMethod' would be clearer. The nested `if (family != null && method != null)` adds minor nesting but is acceptable. Action granularity is reasonable, though the null-return pattern for error/missing cases is not immediately obvious and forces readers to trace call hierarchies. Mixed method ordering (private helper placed between public methods) breaks natural reading flow. Comments are useful but the factory method naming ('newChannel') and generic casting could be simplified to improve clarity without excessive length.
Run 2
The code is generally readable due to clear method names, concise helpers, and flat structure with minimal nesting. However, some issues reduce clarity: the odd 'a' and 'b' constants obscure the java version check, and the overloaded newChannel methods have nuanced null-handling that makes intent slightly ambiguous. Additionally, the reflection-based logic and duplicated null checks add complexity.
Run 3
The code has clear structure with logical method separation and descriptive names. However, readability is diminished by several issues: the 'a' and 'b' variables are meaningless (should be a single constant like JAVA_15), the overloaded newChannel methods create confusion about which version is being called, and the findOpenMethod has a catch block that silently swallows Throwable. The generic type handling with @SuppressWarnings adds complexity. The code is relatively flat with minimal nesting, and each line generally performs one action. Intent is mostly clear but the magic numbers and method overloading reduce clarity. The private constructor prevents instantiation properly. Overall it's maintainable but could be improved with better variable naming and less method overloading.
Run 1
Code Structure: Well-organized utility class with focused methods and a private constructor. Nesting: Shallow conditional and try/catch nesting keeps control flow manageable. Clarity of intent: Method names, types, and documentation generally explain the purpose, but computing Java version 15 through variables a and b unnecessarily obscures the compatibility check. Reflection, generic casts, and null-based fallback behavior require some interpretation. Code length: Compact overall, with a few redundant elements such as the version variables and temporary channel variable. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Methods progress naturally from method discovery to channel creation and specialized wrappers, though inconsistent parameter indentation and the somewhat awkward documentation interrupt readability.
Run 2
Code Structure: Well-organized utility class with focused methods and a private constructor. Nesting: Shallow conditionals and try/catch blocks keep complexity manageable. Clarity of intent: Descriptive method names and documentation explain channel creation, but a = 7 and b = 8 obscure the Java 15 requirement; reflection, the Object family parameter, and null fallback behavior require interpretation. Code length: Compact overall, though the version constants and temporary channel variable add minor verbosity. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Related overloads are grouped logically, and delegation is natural. However, inconsistent continuation indentation, tightly packed imports, and documentation that does not fully explain the reflective fallback slightly interrupt readability.
Run 3
Code Structure: A focused utility class with logically separated reflection lookup, channel creation, and protocol-family conversion. Nesting: Shallow conditionals and try/catch blocks keep control flow manageable. Clarity of intent: Method names and the explanatory comment communicate purpose, but variables a and b obscure the Java 15 threshold, and null returns leave fallback behavior implicit. Code length: Generally concise, though the split version constant and temporary channel variable add unnecessary lines. Action granularity: Statements mostly perform one action per line, making individual operations easy to follow. Reading flow: Lookup precedes creation helpers in a natural sequence, but overloaded newChannel methods require attention to parameter types, and inconsistent continuation indentation slightly disrupts scanning.