Sample

int-98c8ff3c675e-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines51

Scores

MethodScoreScale
Posnett10–1; higher is more readable
Scalabrino0.9070–1; higher is more readable
Dorn0.7530–1; higher is more readable
Mi0.3980–1; higher is more readable
LLOC1Logical lines; fewer is more readable
DeepSeek V4 Pro18.330–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.7190–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 set(PreparedStatement ps, int param, int sql2, @Nullable String type) 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.902−7.353

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

Score0.907

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.791
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.85.577+0.576
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.856+0.301
Indentation frequencyHow rapidly indentation changes from line to line.18−0.115
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.88.981−0.104

Intercept 0.07 + feature contributions = 1.114 (log-odds).
Score = sigmoid(1.114) = 0.753.

Score0.398
Score1
Run 1

The code is highly readable. It has a clear, logical structure with a well-documented interface and a single method. The nesting is perfectly flat, and the intent is unambiguous—defining a callback for setting custom SQL types. The length is concise and appropriate, with no unnecessary code. Action granularity is excellent, as the method signature spans multiple lines for clarity. The reading flow is natural, starting with package/imports, followed by comprehensive Javadoc, and ending with a clean method definition. Minor deductions are for the slightly inconsistent parameter names (e.g., 'param' vs 'paramIndex' and 'sql2' vs 'sqlType'), which slightly reduce clarity.

Run 2

This is a well-structured Spring JDBC interface with clear intent and purpose. The code is logically organized with imports, a comprehensive Javadoc explaining the interface's role, and concise method signatures. Nesting is effectively flat—no conditional blocks or loops exist. The action granularity is appropriate: the constant declaration and method signature are clear and separated. The reading flow follows a natural progression: package, imports, documentation, constant, then method. Minor concerns include the parameter names 'sql2' and 'type', which are slightly ambiguous compared to the Javadoc's 'sqlType' and 'typeName', creating a small readability gap. Additionally, the Javadoc is extensive, which is beneficial for maintainability but adds verbosity. Overall, the code demonstrates strong readability with only minor naming inconsistencies preventing a perfect score.

Run 3

This code is highly readable. The structure is logical: package, imports, interface Javadoc, constant, method declaration. Nesting is completely flat since it is a single interface. Intent is clearly communicated through comprehensive Javadoc explaining the purpose of the interface and its method. The code is concise—no unnecessary methods or fields. Action granularity is sound with the method signature spanning lines for clarity but performing a single logical operation. The reading flow is natural, following standard Java conventions. The only minor deductions are the slightly inconsistent parameter names (e.g., 'param' vs 'paramIndex', 'sql2' instead of 'sqlType') between the Javadoc and the method signature, and the use of '@Nullable' which requires a moment's pause to understand its role. Overall, this is exemplary interface design.

Run 1

Code Structure: Well-organized interface with imports, a constant, and a single method. Nesting: Minimal, with no nested control flow. Clarity of intent: Interface documentation explains the purpose, but references setTypeValue while the actual method is named set. Parameter documentation also mismatches the declaration (paramIndex/param, sqlType/sql2, typeName/type), and sql2 is particularly unclear. Code length: The implementation is concise, though documentation is somewhat repetitive. Action granularity: Each declaration occupies its own logical line, with a sensible method-signature wrap. Reading flow: Generally natural, progressing from interface purpose to constant and method, but inconsistent naming and stale documentation interrupt comprehension.

Run 2

Code Structure: The interface is logically organized into imports, documentation, a constant, and one method. Nesting: There is no nested logic, making it easy to scan. Clarity of intent: The interface purpose is explained well, but documentation refers to setTypeValue while the method is named set. Documented parameter names also differ from the signature, and param, sql2, and type are less descriptive than paramIndex, sqlType, and typeName. Code length: The implementation is concise, though documentation is somewhat repetitive. Action granularity: Each declaration occupies its own logical unit, with no combined actions. Reading flow: The overall progression is natural, but documentation/signature inconsistencies interrupt understanding and reduce confidence in the API contract.

Run 3

Code Structure: Clean interface organization with imports, a constant, and one method. Nesting: Flat, with no nested logic. Clarity of intent: Class documentation explains the purpose well, but the method is named set while documentation references setTypeValue. Parameter names param, sql2, and type are vague and do not match the documented paramIndex, sqlType, and typeName, reducing confidence in the contract. Code length: Implementation is concise; documentation is somewhat repetitive but mostly useful. Action granularity: Each declaration occupies its own logical statement, with a readable wrapped method signature. Reading flow: Conventional Java ordering makes navigation easy, though inconsistent documentation and extra blank lines interrupt an otherwise natural flow.