Sample
Scalabrio93
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 38.2Δ 14.8 |
| Scalabrino | 0.676 | 0–1; higher is more readable | 67.3Δ 14.3 |
| Dorn | 0.1 | 0–1; higher is more readable | 16.6Δ 36.4 |
| Mi | 0.024 | 0–1; higher is more readable | 12.1Δ 41.0 |
| LLOC | 15 | Logical lines; fewer is more readable | 44.5Δ 8.5 |
| DeepSeek V4 Pro | 11.67 | 0–20; mean of three runs | 29.6Δ 23.4 |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs | 19.6Δ 33.4 |
| BTTF | 0.423 | 0–1; higher is more readable | 17.6Δ 35.4 |
| Human | 3.67 | 1–5; original rating | 53.0 |
Views
Select the downloaded ZIP or its extracted folder. Files stay in your browser.
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 1067.533 | −35.229 |
| Source linesThe number of non-empty source lines. | 37 | +14.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. | 5.03 | −7.545 |
Intercept 8.87 + feature contributions = -19.104 (log-odds).
Score = sigmoid(-19.104) = 0.
| Score | 0.676 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 195 | −4.594 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 195 | +2.342 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 32 | +0.37 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 32 | −0.313 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 37 | −0.274 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.086 | +0.109 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 35.827 | +0.091 |
Intercept 0.07 + feature contributions = -2.2 (log-odds).
Score = sigmoid(-2.2) = 0.1.
| Score | 0.024 |
|---|
| Score | 15 |
|---|
Run 1
The code has a clear purpose and follows a logical structure, with the test setup and rollback well-organized. However, readability is significantly impacted by deep nesting (test method → doWork → anonymous inner class → try-catch-finally) and very long method chains that combine multiple operations on a single line. The long `((SessionImplementor)session)...` chains obscure intent and violate action granularity principles. While comments help explain the test's purpose, the anonymous inner class and verbose type casts add noise. The code could be improved by extracting helper methods, breaking long chains into intermediate variables, and reducing nesting depth.
Run 2
The code has clear intent and logical structure but suffers from unnecessary verbosity and deep nesting. The anonymous Work class adds boilerplate, and long chained method calls on SessionImplementor reduce readability and action granularity. Multiple operations are packed into single lines, making it harder to follow. The test flow—open session, begin transaction, attempt invalid insert, expect exception, rollback, close—is understandable, but inline comments only partially clarify. The try/catch/finally inside an anonymous class creates nesting depth. Overall, it is maintainable but could be improved by extracting helper methods, using variables for repeated calls, and simplifying the JDBC access pattern.
Run 3
The code has a clear purpose but suffers from readability issues. The structure is somewhat organized with a test annotation and setup/teardown flow, but the inner anonymous Work class with deep nesting and multiple chained method calls reduces clarity. Nesting depth is high - there are at least 4 levels (method, anonymous class, execute method, try-catch-finally). Some lines combine multiple operations, especially the long chained calls to getTransactionCoordinator().getJdbcCoordinator()... which hurt readability. Action granularity is inconsistent - some lines do one thing (ps.setLong) while others pack too many actions. Reading flow is disrupted by the heavy nesting and verbose Hibernate internals. The comment helps clarify intent, and variable names are reasonable. Code length is acceptable but could be improved by extracting the anonymous class and breaking up the chained statements. Overall, it's functional but requires significant mental effort to parse.
Run 1
Code Structure: The test follows a logical setup, execution, assertion, and cleanup sequence, though JDBC details dominate the test body. Nesting: The anonymous Work implementation and try/catch/finally introduce moderate nesting. Clarity of intent: The test name, explanatory comments, invalid IDs, and failure assertion clearly communicate the expected constraint violation. Code length: Reasonably compact, but repeated SessionImplementor casts and long coordinator access chains add verbosity. Action granularity: Each statement generally performs one action, although chained calls pack several access steps into single lines. Reading flow: Execution proceeds naturally, with clear expected-exception handling and statement cleanup; very long lines and inconsistent spacing interrupt scanning.
Run 2
Code Structure: Logically organized into session setup, invalid insertion, expected exception handling, and cleanup. Nesting: The anonymous Work implementation and try/catch/finally introduce moderate nesting and indentation. Clarity of intent: The test name, SQL, comments, and failure message clearly explain the expected integrity violation; arbitrary IDs and repeated infrastructure calls add some noise. Code length: Reasonably compact, but the anonymous class and repeated long coordinator chains make it more verbose than necessary. Action granularity: Most lines perform one action, although statement preparation and execution contain dense chained calls. Reading flow: The test proceeds naturally from setup through verification to cleanup, but long lines and uneven formatting interrupt scanning.
Run 3
Code Structure: Logically organized into session setup, an attempted invalid insert, expected exception handling, cleanup, and rollback. Nesting: The anonymous Work implementation and try/catch/finally introduce moderate nesting and visual overhead. Clarity of intent: The test name, explanatory comments, parameter comments, and failure message clearly communicate the expected constraint violation. Code length: Reasonably short, but repeated casts and long JDBC coordinator chains add verbosity. Action granularity: Most lines perform one action, although statement preparation combines a long navigation chain with SQL construction. Reading flow: Execution follows a natural sequence, but deeply indented blocks, lengthy expressions, and uneven spacing interrupt scanning. Overall, the test is understandable but could be easier to read with extracted JDBC helpers and more consistent formatting.