Sample
Buse/11
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.838 | 0–1; higher is more readable | 83.8Δ 18.2 |
| Dorn | 0.776 | 0–1; higher is more readable | 75.8Δ 10.1 |
| Mi | 0.597 | 0–1; higher is more readable | 56.6Δ 9.1 |
| LLOC | 4 | Logical lines; fewer is more readable | 59.6Δ 6.1 |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs | 69.7Δ 4.0 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 84.8Δ 19.2 |
| BTTF | 0.591 | 0–1; higher is more readable | 69.7Δ 4.0 |
| Human | 3.64 | 1–5; original rating | 65.7 |
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) |
|---|---|---|
| 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.525 | −6.788 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 98.099 | −3.237 |
| Source linesThe number of non-empty source lines. | 7 | +2.8 |
Intercept 8.87 + feature contributions = 1.645 (log-odds).
Score = sigmoid(1.645) = 0.838.
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. | 49.875 | +1.553 |
| 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. | 8 | +0.753 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 6 | −0.53 |
| 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. | 6.784 | −0.315 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.085 | +0.115 |
Intercept 0.07 + feature contributions = 1.24 (log-odds).
Score = sigmoid(1.24) = 0.776.
| Score | 0.597 |
|---|
| Score | 4 |
|---|
Run 1
The code is straightforward and clearly checks for a null class then throws an exception if missing. It has a flat structure with no nesting, and each logical action is on its own line. However, readability suffers from inconsistent indentation and unclear variable names like 'clas' and 'value'. The intent is understandable but could be clearer with better naming. It’s concise overall.
Run 2
The code is highly readable. It has a flat structure with a single if statement, no unnecessary nesting, and each action is on its own line. The intent is clear: if the class is null, throw an exception with a descriptive message; otherwise assign to `asClass` and return. The variable names are understandable, and the exception message directly states the problem. The formatting follows common Java conventions with consistent indentation and spaces around operators. Minor improvements could include adding braces around the if body for absolute consistency, but the absence of them is a common, accepted style in simple conditionals. Overall, it is concise and easy to follow.
Run 3
The code snippet is clear and straightforward: it checks for null, throws an exception with a meaningful message, assigns to a variable, and returns. Structure is logical with minimal nesting, and each line performs a distinct action. However, readability is slightly reduced by inconsistent formatting (spaces inside parentheses, indentation) and the use of an oddly named variable 'clas' which obscures intent. The exception message uses concatenation rather than a more descriptive format, and the final assignment/return could be simplified to a single return statement. Overall, it is easy to understand but could benefit from minor style cleanup.
Run 1
Code Structure: A straightforward null check followed by assignment and return is logically organized. Nesting: Only one shallow conditional keeps the snippet easy to follow. Clarity of intent: The exception clearly communicates a failed class lookup, though 'clas' and 'asClass' are somewhat awkward variable names. Code length: Very concise, although the assignment before returning may be redundant depending on context. Action granularity: Each statement performs one action; the wrapped exception construction remains readable. Reading flow: The failure check naturally precedes the successful return. Missing conditional braces and inconsistent spacing around concatenation slightly reduce readability.
Run 2
Code Structure: Logically ordered null check, assignment, and return. Nesting: Very shallow, with only one conditional. Clarity of intent: Clearly rejects a missing class and returns the resolved class, though 'clas' is an awkward name and 'asClass' lacks context. Code length: Concise, although the intermediate assignment may be unnecessary depending on surrounding code. Action granularity: Each statement performs one action; the wrapped exception construction remains easy to follow. Reading flow: Natural and straightforward, with minor distractions from inconsistent spacing around concatenation and omitted conditional braces.
Run 3
Code Structure: A logical sequence checks for a missing class, assigns the result, and returns it. Nesting: Only one shallow conditional keeps the code easy to follow. Clarity of intent: The exception clearly communicates lookup failure, though names such as 'clas' and 'value' provide limited context. Code length: Very concise, although the intermediate assignment may be unnecessary depending on surrounding code. Action granularity: Each statement performs one action; the split exception construction remains readable. Reading flow: Natural top-to-bottom progression, with minor distractions from inconsistent spacing and omitted conditional braces.