Sample

int-7f728a119d15-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines22

Scores

MethodScoreScale
Posnett0.9990–1; higher is more readable
Scalabrino0.4690–1; higher is more readable
Dorn0.2340–1; higher is more readable
Mi0.0120–1; higher is more readable
LLOC1Logical lines; fewer is more readable
DeepSeek V4 Pro160–20; mean of three runs
GPT-6.1 Sol15.330–20; mean of three runs
BTTF0.5080–1; higher is more readable

Views

Source code

package org.springframework.web.socket.sockjs.frame; /** * Applies a transport-specific format to the content of a SockJS frame resulting * in a content that can be written out. Primarily for use in HTTP server-side * transports that push data. * * <p>Formatting may vary from simply appending a new line character for XHR * polling and streaming transports, to a jsonp-style callback function, * surrounding script tags, and more. * * <p>For the various SockJS frame formats in use, see implementations of * {@link org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler#getFrameFormat(org.springframework.http.server.ServerHttpRequest) AbstractHttpSendingTransportHandler.getFrameFormat} * * @author Rossen Stoyanchev * @since 4.0 */ public interface SockJsFrameFormat { String for2(SockJsFrame fra); }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.22+8.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.759−7.139
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.108.048−3.566

Intercept 8.87 + feature contributions = 6.966 (log-odds).
Score = sigmoid(6.966) = 0.999.

Score0.469

Feature contributions

FeatureValueContribution
(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.220−5.653
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.220+2.745
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.1+1.001
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.013+0.816
Indentation frequencyHow rapidly indentation changes from line to line.8−0.46
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.21.941−0.103

Intercept 0.07 + feature contributions = -1.186 (log-odds).
Score = sigmoid(-1.186) = 0.234.

Score0.012
Score1
Run 1

The code is a clean, well-documented interface. The Javadoc clearly explains the purpose and context, including references to related classes. The interface has a single method with a clear name ('for2' is slightly cryptic, but likely a typo for 'format' in the original). The structure is logical, nesting is non-existent, and intent is unambiguous. Code length is concise, and reading flow is natural. Minor deduction for unclear method name and lack of semicolon consistency (semicolon after method declaration is present but could be omitted in Java interfaces). Overall, highly readable.

Run 2

The code is generally readable, with a clear package declaration, useful imports, and a meaningful interface name. The Javadoc provides helpful context about the purpose and use of SockJsFrameFormat, which improves clarity of intent. However, there are notable issues: the method name 'for2' is ambiguous and confusing, likely a typo or unfinished rename, which significantly hurts readability. The parameter name 'fra' is also unclear and should be more descriptive, such as 'frame'. The interface is concise, which is positive, but the method signature lacks clarity. Structure is simple and flat, with no nesting issues. Action granularity is appropriate. Overall, the code is understandable due to the comments and simple structure, but the poor naming choices prevent it from being highly readable.

Run 3

The code is generally readable, with a clear Javadoc comment that explains the interface's purpose, use cases, and provides a reference to implementations. The interface is concise and the single method's intent is understandable despite the somewhat cryptic method name 'for2'. The code follows standard Java conventions for interface declaration and documentation. Points deducted because the method name 'for2' is ambiguous and the parameter name 'fra' is abbreviated, which slightly reduces clarity of intent. Additionally, while the Javadoc is helpful, it is somewhat verbose for a single-method interface, though not unnecessarily long. Overall the structure is logical, nesting is flat, and reading flow is natural.

Run 1

Code Structure: A clearly organized interface with one method and focused documentation. Nesting: No nested logic, making the declaration easy to scan. Clarity of intent: The interface name and Javadoc explain transport-specific frame formatting, but the method name 'for2' and parameter name 'fra' are vague and obscure the method's purpose. Code length: The implementation is minimal; the documentation is useful, although its long link reduces readability. Action granularity: The sole method declaration occupies its own line, with no combined actions. Reading flow: Package, documentation, interface, and method follow a natural Java layout, but the unclear method naming interrupts comprehension.

Run 2

Code Structure: A single-purpose interface is logically organized. Nesting: There is no nested control flow. Clarity of intent: The interface name and Javadoc explain transport-specific frame formatting, but the method name 'for2' and parameter 'fra' are vague and obscure the operation. Code length: The implementation is minimal; the documentation is useful but somewhat verbose relative to the declaration. Action granularity: The sole method declaration occupies one line, with no combined actions. Reading flow: The package, documentation, and interface follow a natural Java layout, although the long Javadoc link interrupts scanning and the unclear method name weakens the transition from explanation to API.

Run 3

Code Structure: A logically organized, minimal interface with package declaration, documentation, and one method. Nesting: No nesting, making it easy to scan. Clarity of intent: The interface name and Javadoc clearly describe transport-specific frame formatting, but the method name 'for2' is opaque and the parameter name 'fra' is unnecessarily abbreviated. Code length: The implementation is concise; the documentation is substantially longer but provides useful context. Action granularity: The single method declaration occupies its own line, with no combined actions. Reading flow: Conventional Java layout supports natural reading, though the long Javadoc link and unclear method naming interrupt comprehension.