Sample
Scalabrio26
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 20.6Δ 6.8 |
| Scalabrino | 0.921 | 0–1; higher is more readable | 96.0Δ 68.6 |
| Dorn | 0.248 | 0–1; higher is more readable | 32.7Δ 5.3 |
| Mi | 0.04 | 0–1; higher is more readable | 19.6Δ 7.8 |
| LLOC | 22 | Logical lines; fewer is more readable | 19.3Δ 8.0 |
| DeepSeek V4 Pro | 13.67 | 0–20; mean of three runs | 43.2Δ 15.8 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 83.7Δ 56.3 |
| BTTF | 0.457 | 0–1; higher is more readable | 26.1Δ 1.3 |
| Human | 3.22 | 1–5; original rating | 27.4 |
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. | 1291.944 | −42.634 |
| Source linesThe number of non-empty source lines. | 30 | +12 |
| 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.096 | −7.645 |
Intercept 8.87 + feature contributions = -29.409 (log-odds).
Score = sigmoid(-29.409) = 0.
| Score | 0.921 |
|---|
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. | 114 | −1.163 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| 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. | 24 | +0.187 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.083 | +0.14 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 24 | +0.093 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 27.252 | −0.029 |
Intercept 0.07 + feature contributions = -1.109 (log-odds).
Score = sigmoid(-1.109) = 0.248.
| Score | 0.04 |
|---|
| Score | 22 |
|---|
Run 1
The code is structured logically as a single test method covering multiple trim() function variants. It has flat nesting and clear intent. Each test case follows a consistent two-line pattern (setup, render, assert). However, it is unnecessarily verbose: the repeated rendering call and static parameters (TEMPLATE, DIALECT, FUNCTION_REGISTRY) could be extracted to reduce duplication. Action granularity is mostly good—one logical operation per line—but the repetition hurts readability. Reading flow is natural and predictable, but the monotony makes scanning harder. A parameterized test or helper method would improve conciseness significantly.
Run 2
The code is straightforward but somewhat repetitive and lacks abstraction. It has a flat structure and clear intent, with one action per line, making it easy to follow. However, the repeated assignments and method calls make it longer than necessary and reduce readability. A loop over test cases or parameterized tests would improve clarity and maintainability. The use of constants like TEMPLATE and DIALECT adds clarity, but the inline string concatenation in assertions is cumbersome. Overall, readable but verbose.
Run 3
The code is fairly readable due to its consistent structure and clear intent — it tests multiple variants of a SQL trim function. Each test case follows the same pattern: set fragment, render template, assert expected output. This repetition aids predictability. However, readability suffers from several issues: excessive repetition (many nearly identical blocks), lack of helper methods or parameterized tests, and long lines that reduce scanning ease. Nesting is flat and action granularity is one action per line, which helps. The code is concise for what it does but could be shorter with a loop or data-driven approach. Reading flow is natural but monotonous. Overall, it's understandable but not elegant.
Run 1
Code Structure: Clearly separated test cases follow a consistent arrange–act–assert pattern. Nesting: The method is flat, with no nested control flow. Clarity of intent: The descriptive method name, SQL fragments, and explicit expected outputs make the purpose easy to understand. Code length: Repeated rendering calls add verbosity; a helper or parameterized test could reduce duplication, though the explicit cases remain readable. Action granularity: Each statement performs one action on its own line. Reading flow: Cases progress naturally from basic trim syntax to direction and character variants, with blank lines separating them. Minor drawbacks are long rendering-call lines and repeated reassignment of the same variables.
Run 2
Code Structure: Clearly organized into seven test cases, each separated by a blank line and following the same setup-render-assert pattern. Nesting: Flat method body with no nested control flow. Clarity of intent: The method name, SQL fragments, and explicit expected results clearly communicate the trim-function behavior being tested. Code length: Reasonably short, but repeated rendering calls add verbosity; a parameterized test or helper could reduce duplication. Action granularity: Each statement performs one action on its own line. Reading flow: Consistent ordering makes the cases easy to scan and compare. Reassigning the same variables slightly weakens case isolation, and long rendering calls introduce minor visual noise, but overall readability is high.
Run 3
Code Structure: Clearly organized into separate input-render-assert blocks for each SQL trim variant. Nesting: Flat method body with no nested control flow. Clarity of intent: The descriptive test name, explicit inputs, and expected outputs make the purpose obvious. Code length: Reasonably short, but repeated rendering and assertion patterns add verbosity; a parameterized test could reduce duplication. Action granularity: Each line performs one assignment or assertion. Reading flow: Consistent sequencing and blank lines make cases easy to scan, although reusing mutable variables slightly reduces each case's independence.