Sample

int-ac8107fe94db-I05

Rewrite eligible decimal integer literals in hexadecimal notation

Matched original source

Lines54

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8330–1; higher is more readable
Dorn0.830–1; higher is more readable
Mi0.5650–1; higher is more readable
LLOC13Logical lines; fewer is more readable
DeepSeek V4 Pro180–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.780–1; higher is more readable

Views

Source code

package org.springframework.test.web.servlet.result; import org.hamcrest.Matcher; import org.springframework.test.web.servlet.ResultMatcher; import org.springframework.web.servlet.ModelAndView; import static org.hamcrest.MatcherAssert.assertThat; import static org.springframework.test.util.AssertionErrors.assertEquals; import static org.springframework.test.util.AssertionErrors.fail; /** * Factory for assertions on the selected view. * * <p>An instance of this class is typically accessed via * {@link MockMvcResultMatchers#view}. * * @author Rossen Stoyanchev * @since 3.2 */ public class ViewResultMatchers { /** * Protected constructor. * Use {@link MockMvcResultMatchers#view()}. */ protected ViewResultMatchers() { } /** * Assert the selected view name with the given Hamcrest {@link Matcher}. */ public ResultMatcher name(Matcher<? super String> matcher) { return result -> { ModelAndView mav = result.getModelAndView(); if (mav == null) { fail("No ModelAndView found"); } assertThat("View name", mav.getViewName(), matcher); }; } /** * Assert the selected view name. */ public ResultMatcher name(String expectedViewName) { return result -> { ModelAndView mav = result.getModelAndView(); if (mav == null) { fail("No ModelAndView found"); } assertEquals("View name", expectedViewName, mav.getViewName()); }; } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.

Score0.833

Feature contributions

FeatureValueContribution
(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.

Score0.565
Score13
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 with a clear, logical structure. It uses a factory pattern with a protected constructor, and each public method has a single responsibility. Nesting is minimal—only one level inside the lambdas. Intent is obvious from method names and Javadoc comments. The code is concise, avoiding unnecessary verbosity. Each action within the lambdas is on its own line, improving granularity. Reading flow is natural: class overview, constructor, then assertion methods in logical order. Minor deductions could be made for the slightly repetitive null check and the lack of a line break between imports, but overall it is nearly exemplary.

Run 3

The code is highly readable. It has a clear, logical structure with a protected constructor and two focused public methods. Nesting is minimal and action granularity is appropriate, with each lambda performing a single logical assertion despite multiple lines. The intent is unambiguous due to descriptive method names, Javadocs, and clear assertion messages. Although there is minor duplication between the two `name()` methods, the readability remains high. The only improvement would be extracting the null-check into a helper method, but that is a negligible concern. Overall, the class is concise, well-documented, and easy to follow.

Run 1

Code Structure: Clearly organized class with a constructor and two closely related assertion methods; minor duplication exists between overloads. Nesting: Shallow lambda bodies contain only a simple null check. Clarity of intent: Descriptive method parameters, straightforward assertions, and concise Javadoc make the purpose clear, though 'mav' is slightly abbreviated. Code length: Compact and appropriate, with only minor repeated setup and extra whitespace. Action granularity: Each statement performs one clear action on its own line. Reading flow: Both methods follow the same natural sequence—retrieve the ModelAndView, check its presence, then assert the view name. Import grouping could be improved with blank lines, but overall readability is excellent.

Run 2

Code Structure: Logically organized class with a constructor and two closely related assertion overloads; imports could be spaced more clearly. Nesting: Shallow lambda bodies with only one conditional each. Clarity of intent: Descriptive method parameters, focused Javadoc, and clear assertion messages make the purpose obvious, though 'mav' is abbreviated. Code length: Concise overall; the repeated ModelAndView retrieval and null check introduce minor duplication. Action granularity: Each statement performs one action, with no compressed multi-operation lines. Reading flow: Both methods follow the same natural sequence—retrieve, validate, assert—making them easy to scan and compare. Minor excess blank lines slightly weaken formatting consistency.

Run 3

Code Structure: Well-organized class with two closely related overloads and clear API documentation. Nesting: Shallow; each lambda contains only a simple null check. Clarity of intent: Descriptive method parameters, assertion messages, and Javadoc make the purpose obvious, though 'mav' is mildly abbreviated. Code length: Concise overall, with minor duplication of ModelAndView retrieval and validation. Action granularity: Each statement performs one clear action on its own line. Reading flow: Natural progression from constructor to assertion methods, with consistent formatting; slightly excessive blank lines and tightly grouped imports are minor distractions.