Sample
Scalabrio103
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.492 | 0–1; higher is more readable | 91.0Δ 24.9 |
| Scalabrino | 0.72 | 0–1; higher is more readable | 74.9Δ 8.8 |
| Dorn | 0.749 | 0–1; higher is more readable | 86.4Δ 20.4 |
| Mi | 0.437 | 0–1; higher is more readable | 71.4Δ 5.3 |
| LLOC | 4 | Logical lines; fewer is more readable | 93.7Δ 27.6 |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs | 66.6Δ 0.5 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 83.7Δ 17.6 |
| BTTF | 0.728 | 0–1; higher is more readable | 94.5Δ 28.4 |
| Human | 3.89 | 1–5; original rating | 66.1 |
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. | 357.577 | −11.8 |
| Source linesThe number of non-empty source lines. | 25 | +10 |
| 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.735 | −7.103 |
Intercept 8.87 + feature contributions = -0.033 (log-odds).
Score = sigmoid(-0.033) = 0.492.
| Score | 0.72 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 96 | +0.744 |
| 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 | −0.401 |
| 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.064 | +0.322 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 25 | +0.151 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 18 | −0.115 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 23.629 | −0.08 |
Intercept 0.07 + feature contributions = 1.091 (log-odds).
Score = sigmoid(1.091) = 0.749.
| Score | 0.437 |
|---|
| Score | 4 |
|---|
Run 1
The code has a clear purpose and is structured logically with a simple if-else flow, but it suffers from repetitive and deeply chained method calls that harm readability. The nesting level is low, which is good, but the long chained expressions (e.g., getSession().getPersistenceContext().getNaturalIdHelper().manage...()) obscure the intent and make the code harder to scan. Action granularity is poor because each line contains multiple actions chained together, reducing clarity. The comment at the top is helpful for understanding the context, but the parameter names are generic ('state', 'getId()', 'generatedId') without strong semantic differentiation. Code length is reasonable, but the lack of intermediate variables for repeated helper access contributes to verbosity. Overall, it is readable but would benefit from extracting the helper object and breaking chained calls into separate steps.
Run 2
The code is well-structured and readable. It clearly separates the conditional early-insert block from the unconditional shared cache management. Nesting is minimal, with only one if-statement. Intent is explicit through descriptive method and variable names. Each logical action is on its own line, though method call chains are broken sensibly. Comments clarify the reasoning behind the early-insert branch. Minor improvements could include extracting repeated access to the persistence context/naturalId helper into a local variable, but overall readability is high.
Run 3
The code is generally readable with clear intent and logical structure. It has a single level of nesting, which is acceptable. Each action is on its own line, improving granularity. The reading flow is natural—the early insert special case is handled first, followed by the shared cache management. However, there are some minor issues: the method calls are quite long and span multiple lines, which can disrupt reading flow. The lack of null checks or variable assignments before the calls makes the code dense. Additionally, the comment could be clearer about why early insert requires special handling. Overall, it is concise and well-organized, but the long method invocations reduce readability slightly.
Run 1
Code Structure: Logically separates conditional local cross-reference handling from unconditional shared-cache handling. Nesting: Only one shallow conditional, making control flow easy to follow. Clarity of intent: Descriptive method names, documentation, and comments explain the purpose; the distinction between generatedId and getId(), and the null arguments, could be clearer. Code length: Concise overall, though the repeated session-access chain adds verbosity. Action granularity: Each statement performs one meaningful operation, with arguments placed on separate lines for readability. Reading flow: Natural progression from early-insert handling to shared-cache updates, supported by consistent formatting.
Run 2
Code Structure: Logically separates conditional local cross-reference handling from unconditional shared-cache handling. Nesting: Only one shallow conditional, making control flow easy to follow. Clarity of intent: Descriptive method names, Javadoc, and comments explain the purpose, although domain-specific terminology and the distinction between generatedId and getId() require context. Code length: Concise overall, with minor repetition in the helper-access chain and argument lists. Action granularity: Each statement performs one clear operation; multiline arguments aid scanning. Reading flow: The local-then-shared sequence is natural, and consistent indentation supports readability. Extracting the repeated helper chain could slightly improve readability.
Run 3
Code Structure: Logically separates conditional local cross-reference management from unconditional shared-cache management. Nesting: Only one shallow conditional, making control flow easy to follow. Clarity of intent: Descriptive method names, documentation, and comments explain the purpose, although the difference between generatedId and getId() and the null arguments requires contextual knowledge. Code length: Concise overall, with readable multiline argument formatting; repeated accessor chains add minor verbosity. Action granularity: Each statement performs one distinct operation, and arguments are clearly separated. Reading flow: Naturally progresses from early-insert handling to shared-cache updates, with consistent formatting.