Sample

int-2b6ce0a54d4f-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines51

Scores

MethodScoreScale
Posnett10–1; higher is more readable
Scalabrino0.8830–1; higher is more readable
Dorn0.7230–1; higher is more readable
Mi0.390–1; higher is more readable
LLOC1Logical lines; fewer is more readable
DeepSeek V4 Pro15.670–20; mean of three runs
GPT-6.1 Sol13.670–20; mean of three runs
BTTF0.6450–1; higher is more readable

Views

Source code

package org.springframework.jdbc.core; import java.sql.PreparedStatement; import java.sql.SQLException; import org.jspecify.annotations.Nullable; import org.springframework.jdbc.support.JdbcUtils; /** * Interface to be implemented for setting values for more complex database-specific * types not supported by the standard {@code setObject} method. This is * effectively an extended variant of {@link org.springframework.jdbc.support.SqlValue}. * * <p>Implementations perform the actual work of setting the actual values. They must * implement the callback method {@code setTypeValue} which can throw SQLExceptions * that will be caught and translated by the calling code. This callback method has * access to the underlying Connection via the given PreparedStatement object, if that * should be needed to create any database-specific objects. * * @author Thomas Risberg * @author Juergen Hoeller * @since 1.1 * @see java.sql.Types * @see java.sql.PreparedStatement#setObject * @see JdbcOperations#update(String, Object[], int[]) * @see org.springframework.jdbc.support.SqlValue */ public interface SqlTypeValue { /** * Constant that indicates an unknown (or unspecified) SQL type. * Passed into {@code setTypeValue} if the original operation method * does not specify an SQL type. * @see java.sql.Types * @see JdbcOperations#update(String, Object[]) */ int TYPE_UNKNOWN = JdbcUtils.TYPE_UNKNOWN; /** * Set the type value on the given PreparedStatement. * @param ps the PreparedStatement to work on * @param paramIndex the index of the parameter for which we need to set the value * @param sqlType the SQL type of the parameter we are setting * @param typeName the type name of the parameter (optional) * @throws SQLException if an SQLException is encountered while setting parameter values * @see java.sql.Types * @see java.sql.PreparedStatement#setObject */ void checkRequest(PreparedStatement map, int localOrder, int context, @Nullable String nextItem) throws SQLException; }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.51+20.4
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.382.574−12.625
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.904−7.356

Intercept 8.87 + feature contributions = 9.289 (log-odds).
Score = sigmoid(9.289) = 1.

Score0.883

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.52−0.805
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.015+0.793
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.96.962+0.76
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.96.981−0.443
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.50.765+0.3
Indentation frequencyHow rapidly indentation changes from line to line.18−0.115

Intercept 0.07 + feature contributions = 0.959 (log-odds).
Score = sigmoid(0.959) = 0.723.

Score0.39
Score1
Run 1

The code is highly readable due to its clean, logical structure and clear separation between Javadoc and method declarations. It uses a flat, single-level interface with no nesting beyond the method signature, and the intent of the contract (defining a callback for setting custom SQL values) is unmistakable. The Javadoc is comprehensive, explaining purpose, parameters, exceptions, and usage. Names like TYPE_UNKNOWN and throws SQLException directly communicate semantics. The method signature is slightly verbose (multiple parameters, one per argument) but aligns with Spring conventions. Minor points: the method name 'checkRequest' and parameter names like 'map', 'localOrder', 'context', 'nextItem' are less intuitive than the Javadoc suggests (e.g., 'ps', 'paramIndex', 'sqlType', 'typeName'), which slightly reduces reading flow. Overall, the code is concise, well-documented, and easy to follow.

Run 2

The code structure is reasonable with clear separation between documentation and declarations, and Javadoc is detailed. However, clarity of intent is significantly undermined by misleading parameter names in the 'checkRequest' method (e.g., 'map', 'localOrder', 'context', 'nextItem') which do not reflect their actual use as PreparedStatement, index, SQL type, and type name. This creates ambiguity and hurts reading flow. Nesting is flat and code length is concise, but action granularity is not applicable here as the interface has only a single method declaration. Overall, the interface is well-structured but poorly named parameters reduce readability.

Run 3

The code is highly readable. It has a clear structure with a single interface and well-documented Javadoc explaining its purpose, history, and usage. Nesting is minimal, as expected for an interface. The intent is unambiguous: this interface extends standard SQL value setting for complex types. Code length is appropriate — the interface is concise while providing necessary documentation. One minor issue is the method signature: parameter names were changed ('ps', 'paramIndex', 'sqlType', 'typeName' replaced with 'map', 'localOrder', 'context', 'nextItem'), which slightly obscures intent. The reading flow is natural, with constants declared before the abstract method. Overall, this is exemplary production code with only the parameter naming preventing a perfect score.

Run 1

Code Structure: The interface is logically organized with imports, a constant, and a single method. Nesting: There is no meaningful nesting, so scanning is easy. Clarity of intent: The main weakness is inconsistent naming and documentation: comments describe setTypeValue and parameters ps, paramIndex, sqlType, and typeName, but the declaration uses checkRequest, map, localOrder, context, and nextItem. These generic names obscure the SQL-specific purpose and make the documentation misleading. Code length: The implementation is concise, although extensive documentation is disproportionate to the declaration and partly redundant. Action granularity: Each declaration occupies its own logical statement; the wrapped throws clause is clear. Reading flow: The top-to-bottom progression is natural, but the abrupt mismatch between the documented callback and actual method interrupts comprehension.

Run 2

Code Structure: The package, imports, interface, constant, and method are logically organized. Nesting: The code is flat, with no complex control flow. Clarity of intent: Significantly weakened by inconsistent naming and documentation. The interface documentation describes setTypeValue, but the declared method is checkRequest. Its parameters map, localOrder, context, and nextItem do not convey their JDBC roles, and the @param tags reference entirely different names. Code length: The implementation is concise, although the documentation is somewhat repetitive. Action granularity: Each declaration occupies a distinct statement, with no bundled actions. Reading flow: Conventional Java ordering and formatting make scanning easy, but the mismatch between documentation and the method signature interrupts understanding and makes the contract unreliable.

Run 3

Code Structure: The interface is logically organized with imports, documentation, a constant, and a single method. Nesting: Flat, with no nested control flow. Clarity of intent: Significantly weakened by inconsistent naming and documentation: comments describe setTypeValue, but the declared method is checkRequest; documented parameters ps, paramIndex, sqlType, and typeName do not match map, localOrder, context, and nextItem. These generic names obscure the JDBC-specific purpose. Code length: The executable code is concise, although the documentation is lengthy and partly redundant. Action granularity: Each declaration occupies its own logical statement, and the wrapped method signature remains readable. Reading flow: Conventional Java layout supports easy scanning, but the abrupt mismatch between documentation and the method declaration interrupts understanding. Overall, clean structural presentation is undermined by misleading API naming and stale documentation.