Sample
Scalabrio163
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 32.2Δ 20.4 |
| Scalabrino | 0.293 | 0–1; higher is more readable | 26.6Δ 14.8 |
| Dorn | 0.536 | 0–1; higher is more readable | 61.8Δ 50.0 |
| Mi | 0.202 | 0–1; higher is more readable | 48.2Δ 36.4 |
| LLOC | 15 | Logical lines; fewer is more readable | 44.5Δ 32.7 |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs | 54.3Δ 42.5 |
| GPT-6.1 Sol | 17.67 | 0–20; mean of three runs | 74.1Δ 62.3 |
| BTTF | 0.398 | 0–1; higher is more readable | 15.1Δ 3.3 |
| Human | 2.89 | 1–5; original rating | 11.8 |
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. | 1008.978 | −33.296 |
| Source linesThe number of non-empty source lines. | 20 | +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. | 4.804 | −7.207 |
Intercept 8.87 + feature contributions = -23.633 (log-odds).
Score = sigmoid(-23.633) = 0.
| Score | 0.293 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 95 | +0.728 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 1 | −0.703 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 19 | +0.364 |
| 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. | 95 | −0.359 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.118 | −0.205 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 18.542 | −0.151 |
Intercept 0.07 + feature contributions = 0.143 (log-odds).
Score = sigmoid(0.143) = 0.536.
| Score | 0.202 |
|---|
| Score | 15 |
|---|
Run 1
The code is generally readable but has several issues. The structure is logical, following a clear setup-test-verify flow, but the meaning of the test is unclear without comments. Nesting is mostly flat, which is good, but helper methods like 'getOrCreateEntityManager()' should be extracted to improve clarity and reduce clutter. The code length is reasonable but could be more concise by extracting the query building logic. Action granularity and reading flow are adequate but could be smoother. The main readability issue is that the test name doesn't clearly convey what 'restricted correlation' means, and the intent of the subquery is not immediately obvious. Adding brief comments and reducing the number of lines in the setup phase would improve the score.
Run 2
The code is structured logically and has a straightforward linear flow, but suffers from readability issues. The method name is reasonably descriptive. Nesting is flat, which is good. However, clarity of intent is impacted by repeated generic types and JPA metamodel calls (e.g., `orderCustomerJoin.<String>get( "name" )`), which obscure the domain logic. Code length is reasonable, but some lines combine multiple actions (e.g., beginning transactions, closing entity manager). Reading flow is mostly natural, though the subquery correlation setup can be confusing. Overall, it is understandable for developers familiar with JPA Criteria API, but the technical boilerplate reduces its readability for less experienced readers.
Run 3
The code is well-structured and readable due to its logical organization and consistent use of the Criteria API. It follows a standard setup-execute-teardown pattern for JPA tests. Nesting is minimal, with only one subquery construct, keeping the code relatively flat. Intent is clear: test a restricted correlation without explicit selection. Each meaningful action—obtaining a builder, starting a transaction, building the query, and executing it—is placed on its own line, enhancing readability. Lines are concise and descriptive. The only minor drawbacks are the slight verbosity inherent in the Criteria API and the presence of a comment that clarifies but also highlights the complexity of the subquery. Overall, the code is easy to follow and maintain.
Run 1
Code Structure: Logically organized into setup, query construction, execution, and cleanup. Nesting: Flat control flow, with only modest nesting in method calls. Clarity of intent: Descriptive variable names and the correlation comment explain the query well, though the absence of assertions makes the test's expected outcome unclear. Code length: Concise, with little unnecessary code. Action granularity: Each statement performs one primary action; fluent calls remain manageable. Reading flow: Natural progression follows the transaction and query lifecycle, with blank lines separating phases. Explicit selection on the outer query could initially seem inconsistent with the test name, which presumably refers to the subquery. Cleanup without a finally block slightly weakens structural robustness.
Run 2
Code Structure: Logically organized into setup, query construction, execution, and cleanup, with whitespace separating phases. Nesting: Flat control flow; nested method calls are limited and manageable. Clarity of intent: Descriptive variable names and the test name communicate the correlated-subquery scenario, though the implicit subquery selection and absence of assertions make the expected outcome less obvious. Code length: Concise, with little unnecessary code. Action granularity: Each statement performs one primary action; fluent calls remain short enough to understand. Reading flow: Natural progression from transaction start through query execution to commit and close. Minor weaknesses include inconsistent visual separation within query construction and cleanup that is not protected against exceptions.
Run 3
Code Structure: Logically organized into transaction setup, query construction, execution, and cleanup. Nesting: Flat control flow; nested method calls are shallow and manageable. Clarity of intent: The descriptive test name, typed variables, and correlation comment clarify the purpose, although the missing explicit subquery selection requires Criteria API knowledge, and there is no assertion explaining the expected outcome. Code length: Concise, with little unnecessary code. Action granularity: Each statement performs one primary action; method chaining remains readable. Reading flow: Statements follow the natural query-building sequence, with blank lines separating major phases. A visual break before the subquery and a clearer statement of the expected test behavior would improve readability.