Sample

Scalabrio129

Human rating uses the original dataset scale.

DatasetScalabrino
Human4.11
Lines26

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
68.3Δ 9.8
Scalabrino0.7810–1; higher is more readable
82.4Δ 4.3
Dorn0.8480–1; higher is more readable
97.0Δ 18.8
Mi0.6460–1; higher is more readable
85.4Δ 7.3
LLOC16Logical lines; fewer is more readable
40.2Δ 37.9
DeepSeek V4 Pro14.330–20; mean of three runs
54.3Δ 23.9
GPT-6.1 Sol160–20; mean of three runs
34.7Δ 43.5
BTTF0.6440–1; higher is more readable
80.9Δ 2.8
Human4.111–5; original rating
78.1

Views

Download official ZIP ↗

Select the downloaded ZIP or its extracted folder. Files stay in your browser.

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.649.275−21.426
Source linesThe number of non-empty source lines.26+10.4
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.839−7.258

Intercept 8.87 + feature contributions = -9.414 (log-odds).
Score = sigmoid(-9.414) = 0.

Score0.781

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.58+1.209
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.125−0.275
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.58+0.131
Indentation frequencyHow rapidly indentation changes from line to line.25+0.128
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.26+0.116
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.24.949−0.061

Intercept 0.07 + feature contributions = 1.715 (log-odds).
Score = sigmoid(1.715) = 0.848.

Score0.646
Score16
Run 1

The code has a clear structure with try/finally blocks for resource cleanup, which is good. However, nesting is moderate with try-catch-finally nested inside another try-finally, reducing flatness. Intent is fairly clear - testing a transient object exception scenario - but variable names like 'c2' and 'info' are somewhat generic. Code length is reasonable and concise. Action granularity is mostly one action per line, though some setup lines could be grouped. Reading flow is natural: setup, persist, expect failure, handle exception, cleanup. The main readability issues are the generic variable names and the nested exception handling. Score reflects solid but not exemplary structure with minor clarity improvements needed.

Run 2

The code is generally readable with clear method naming and logical structure. It follows a single responsibility flow: setup, action, assertion, and cleanup. Nesting is moderate—two try-finally blocks plus an inner try-catch—but acceptable. Each line performs a distinct action (object creation, association, persist, commit/rollback, close), aiding readability. The intent is clear: testing a transient object exception. However, the double-finally structure slightly complicates reading flow, and the lack of a comment explaining why the expected exception occurs reduces clarity for someone unfamiliar with Hibernate semantics. The code is reasonably concise and not overly long. Overall, it's well-structured but could be improved by simplifying the nested exception handling or adding a brief explanatory comment.

Run 3

The code is structured logically for a test method, with a clear setup, action, and expected exception handling. The intent is understandable, and the flow is mostly natural. However, there is excessive nesting with two try/finally blocks and a try/catch inside a try block, which reduces readability. Some lines contain multiple actions, such as `info.setOwner( c2 );` and `s.persist( c2 );` on separate lines is fine, but `Child c2 = new Child( "c2" );` is clear. The `catch` block mixes expected outcome handling with logging and rollback, which is acceptable but adds complexity. Overall, the code is reasonably readable but could be simplified by reducing nesting and extracting helper methods for setup and teardown.

Run 1

Code Structure: Setup, persistence, expected-exception handling, and cleanup are logically organized. Nesting: Nested try/catch/finally blocks add indentation and cognitive overhead, but their cleanup responsibilities are understandable. Clarity of intent: The descriptive test name, failure message, and expected-result comment clearly communicate the test purpose; abbreviated variables such as s and c2 are less expressive. Code length: The method is compact, with little unnecessary code beyond required transaction and resource handling. Action granularity: Each statement performs a single action, making execution easy to follow. Reading flow: The sequence naturally progresses from setup to commit attempt, exception handling, rollback, and cleanup, although tracking the inner and outer finally blocks slightly interrupts the flow.

Run 2

Code Structure: Logically organized into setup, persistence, expected-exception handling, and cleanup, though nested try blocks add complexity. Nesting: Moderate nesting is justified by transaction handling and guaranteed cleanup but reduces scanability. Clarity of intent: The test name, failure message, and expected-result comment explain the purpose; abbreviated variables such as s and c2 are less descriptive. Code length: Concise, with little unnecessary code. Action granularity: Each statement performs one action, making individual steps easy to follow. Reading flow: Setup flows naturally into execution and verification, followed by rollback and cleanup. However, the session-closing finally covers only the inner try, so understanding cleanup behavior for failures during setup requires extra attention.

Run 3

Code Structure: Logically separates entity setup, transaction handling, session closure, and cleanup. Nesting: Nested try/catch/finally blocks add moderate indentation but serve understandable resource-management purposes. Clarity of intent: The descriptive test name, explicit failure message, and expected-exception comment make the test purpose clear; abbreviated variables such as s and c2 are less descriptive. Code length: Compact and appropriately sized, with little unnecessary code. Action granularity: Each statement performs a single action on its own line. Reading flow: Setup proceeds naturally into persistence, commit, exception handling, and cleanup, although the nested exception-handling structure slightly interrupts the flow.