Sample
int-2b6ce0a54d4f-I03
Replace method, parameter, and local names with length-matched, meaningful but unrelated names
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 1 | 0–1; higher is more readable |
| Scalabrino | 0.883 | 0–1; higher is more readable |
| Dorn | 0.723 | 0–1; higher is more readable |
| Mi | 0.39 | 0–1; higher is more readable |
| LLOC | 1 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.67 | 0–20; mean of three runs |
| BTTF | 0.645 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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.
| Score | 0.883 |
|---|
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. | 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.
| Score | 0.39 |
|---|
| Score | 1 |
|---|
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.