Sample
Dorn/java/109
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.492 | 0–1; higher is more readable | 81.6Δ 10.6 |
| Scalabrino | 0.926 | 0–1; higher is more readable | 96.5Δ 4.3 |
| Dorn | 0.597 | 0–1; higher is more readable | 51.8Δ 40.4 |
| Mi | 0.703 | 0–1; higher is more readable | 84.4Δ 7.8 |
| LLOC | 5 | Logical lines; fewer is more readable | 78.0Δ 14.2 |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs | 77.3Δ 14.9 |
| GPT-6.1 Sol | 16.33 | 0–20; mean of three runs | 70.8Δ 21.4 |
| BTTF | 0.642 | 0–1; higher is more readable | 83.8Δ 8.4 |
| Human | 3.99 | 1–5; original rating | 92.2 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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.832 | −7.248 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 171.3 | −5.653 |
| Source linesThe number of non-empty source lines. | 10 | +4 |
Intercept 8.87 + feature contributions = -0.031 (log-odds).
Score = sigmoid(-0.031) = 0.492.
| Score | 0.926 |
|---|
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. | 63 | +0.997 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 9 | +0.718 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 8 | −0.46 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 9.75 | −0.274 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.123 | −0.251 |
Intercept 0.07 + feature contributions = 0.393 (log-odds).
Score = sigmoid(0.393) = 0.597.
| Score | 0.703 |
|---|
| Score | 5 |
|---|
Run 1
The code is clear and logically structured, with an else-if returning a constant if a condition matches and an exception for invalid input. It is flat, uses clear intent, and maintains concise length. Each line performs a single action, and the reading flow is natural. The snippet appears to be part of a larger method, slightly limiting full context, but within itself it is quite readable.
Run 2
The code snippet is mostly clear and readable, but it's incomplete and lacks context. The else-if structure is flat and straightforward, returning a constant based on a value comparison. The throw statement is concise and the getValue method is a simple, well-named accessor. However, without seeing the full enum/class definition, the intent is slightly ambiguous—what are the possible values? The leading 'else if' suggests there is a preceding if block, so the logical flow is not fully visible. Action granularity is good, with one action per line. Code length is minimal where it can be. The reading flow is natural within the snippet, but the missing context and lack of comments explaining the value mapping reduce clarity. Overall, it's readable but not exemplary due to incomplete structure and ambiguous intent.
Run 3
The code snippet is short but lacks surrounding context, making it difficult to assess fully. The else-if logic and exception throwing are clear and follow a logical structure with minimal nesting. However, the use of RUBY.getValue().equals(value) implies a possible enum pattern but is acceptable. Naming conventions like _value with an underscore are inconsistent with typical Java style, slightly reducing clarity. The method getValue() is straightforward but the snippet starts mid-method, affecting reading flow. Overall, readable but context-dependent.
Run 1
Code Structure: The visible branch, exception fallback, and getter are logically organized, though the fragment lacks its opening context. Nesting: Shallow nesting makes it easy to follow. Clarity of intent: Matching a value to RUBY, rejecting invalid values, and exposing the stored value are clear. Code length: Concise, with no unnecessary statements. Action granularity: Each statement performs a single action. Reading flow: Conventional formatting and spacing support natural reading, but starting with an else-if and unmatched surrounding context slightly disrupts comprehension.
Run 2
Code Structure: The visible conditional, exception, and getter are logically organized, although the fragment begins mid-method. Nesting: Shallow nesting makes the code easy to scan. Clarity of intent: Matching a value to RUBY, rejecting invalid values, and exposing the stored value are clear; missing surrounding code limits context. Code length: Concise, with no visible unnecessary statements. Action granularity: Each statement performs one action. Reading flow: Formatting and spacing support natural reading, but the initial else-if and unmatched surrounding context make the snippet less self-contained.
Run 3
Code Structure: The conditional return, exception fallback, and getter are logically organized, although the snippet begins mid-method. Nesting: Shallow nesting makes the visible logic easy to follow. Clarity of intent: Matching a value to RUBY, rejecting invalid values, and exposing the stored value are clear; the missing method context limits full understanding. Code length: Concise, with no obvious redundancy. Action granularity: Each statement performs a single action on its own line. Reading flow: Consistent indentation and spacing support natural reading, but the opening else-if and unmatched surrounding context interrupt standalone comprehension.