Sample
int-bb3680f62c49-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.833 | 0–1; higher is more readable |
| Dorn | 0.83 | 0–1; higher is more readable |
| Mi | 0.565 | 0–1; higher is more readable |
| LLOC | 13 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs |
| BTTF | 0.78 | 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. | 1111.713 | −36.687 |
| Source linesThe number of non-empty source lines. | 54 | +21.6 |
| 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.984 | −7.476 |
Intercept 8.87 + feature contributions = -13.693 (log-odds).
Score = sigmoid(-13.693) = 0.
| Score | 0.833 |
|---|
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. | 55 | −0.911 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 39 | +0.612 |
| 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. | 73.964 | +0.532 |
| 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.6 | +0.367 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 53.813 | +0.342 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.079 | +0.177 |
Intercept 0.07 + feature contributions = 1.587 (log-odds).
Score = sigmoid(1.587) = 0.83.
| Score | 0.565 |
|---|
| Score | 13 |
|---|
Run 1
The code demonstrates excellent readability. Structure is logical with clear package, imports, and class organization. Nesting is minimal - only a single-level lambda with a null check. Intent is unambiguous through descriptive method names and Javadoc. Code length is concise, avoiding unnecessary boilerplate. Action granularity is appropriate - each assertion is on its own line. Reading flow is natural, following a predictable pattern. Minor deductions: protected constructor could be private, and the null check is slightly repetitive across methods, but these are negligible.
Run 2
The code is highly readable. It has a clear, logical structure with well-organized imports, class-level Javadoc, and two concise methods. Nesting is minimal—each method contains a simple lambda with a single null check, keeping the logic flat and easy to follow. The intent of each method is explicit: one asserts a view name against a Hamcrest matcher, the other against an exact string. Code length is appropriate, avoiding unnecessary verbosity while maintaining clarity. Each action (retrieving ModelAndView, checking null, asserting) is placed on its own line, improving granularity. The reading flow is natural—factory method, lambda execution, validation, then assertion. Minor deductions: duplicated null-check logic in both methods could potentially be extracted for reuse, and the static imports slightly reduce local context clarity, but overall the code is clean and maintainable.
Run 3
The code is highly readable with a clean, logical structure. It follows standard Java conventions with clear package, imports, and Javadoc documentation. The class has a single responsibility: providing view-related result matchers. Each method is concise, has a clear purpose, and uses lambda expressions to keep the code flat and avoid deep nesting. Error handling is handled gracefully with an early exit if ModelAndView is null, preventing nested conditionals. Action granularity is respected—each lambda body performs one logical assertion after a null check. Reading flow is natural, moving from method signature to validation to assertion. The minimal use of static imports improves clarity, and the concise implementation avoids unnecessary verbosity.
Run 1
Code Structure: The class is logically organized around two closely related assertion overloads, with a clearly documented constructor. Nesting: Each method has only a lambda and a simple null check, keeping nesting shallow. Clarity of intent: Javadoc, descriptive method parameters, and explicit assertion messages make the purpose clear; the abbreviation 'mav' is slightly less descriptive than 'modelAndView'. Code length: The implementation is concise, although the two overloads repeat the retrieval and null-check logic. Action granularity: Each statement performs one clear action on its own line. Reading flow: Both methods follow the same natural sequence: retrieve the model and view, validate its presence, then assert the view name. Minor formatting issues, such as tightly grouped imports and extra blank lines, do not significantly impede readability.
Run 2
Code Structure: Well-organized class with two focused overloads and useful documentation. Nesting: Shallow lambda bodies with a single null check are easy to follow. Clarity of intent: Descriptive method signatures, assertion messages, and Javadoc clearly communicate the purpose; the abbreviation 'mav' is slightly less explicit than 'modelAndView'. Code length: Concise overall, though the null-check logic is duplicated across overloads. Action granularity: Each statement performs one clear action on its own line. Reading flow: Both methods follow the same natural sequence—retrieve the model and view, check its presence, then assert the view name. Minor spacing inconsistencies around imports and the constructor do not materially hinder readability.
Run 3
Code Structure: The class is logically organized, with a documented constructor and two closely related assertion methods. Nesting: Each method contains only a lambda and a simple null check, keeping nesting shallow. Clarity of intent: Class documentation, method names, parameter names, and assertion messages clearly communicate the purpose; the abbreviation 'mav' is a minor clarity drawback. Code length: The implementation is concise, though model retrieval and null checking are duplicated across overloads. Action granularity: Each statement performs a single clear action. Reading flow: Both methods follow the same natural sequence—retrieve the model and view, check its presence, then assert the view name. Minor formatting issues, including tightly grouped imports and extra blank lines, slightly reduce polish.