Sample
Buse/38
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.05 | 0–1; higher is more readable | 33.3Δ 8.1 |
| Scalabrino | 0.655 | 0–1; higher is more readable | 39.4Δ 14.1 |
| Dorn | 0.561 | 0–1; higher is more readable | 42.4Δ 17.2 |
| Mi | 0.545 | 0–1; higher is more readable | 43.4Δ 18.2 |
| LLOC | 5 | Logical lines; fewer is more readable | 29.8Δ 4.5 |
| DeepSeek V4 Pro | 14.67 | 0–20; mean of three runs | 55.1Δ 29.8 |
| GPT-6.1 Sol | 16.33 | 0–20; mean of three runs | 50.0Δ 24.7 |
| BTTF | 0.472 | 0–1; higher is more readable | 41.4Δ 16.2 |
| Human | 2.78 | 1–5; original rating | 25.3 |
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. | 220.921 | −7.29 |
| 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.614 | −6.92 |
| Source linesThe number of non-empty source lines. | 6 | +2.4 |
Intercept 8.87 + feature contributions = -2.941 (log-odds).
Score = sigmoid(-2.941) = 0.05.
| Score | 0.655 |
|---|
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. | 61.857 | +1.045 |
| 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. | 7 | +0.788 |
| 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 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 5.714 | −0.33 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.12 | −0.22 |
Intercept 0.07 + feature contributions = 0.244 (log-odds).
Score = sigmoid(0.244) = 0.561.
| Score | 0.545 |
|---|
| Score | 5 |
|---|
Run 1
The code is straightforward and readable. It follows a clear logical structure: retrieve the @Test annotation, check its expected value, and return the appropriate result. Nesting is minimal with only a single if-else block, making the logic easy to follow. The intent is obvious—determine the expected exception for a test method. The code is concise and avoids unnecessary verbosity, with each meaningful action on its own line. The reading flow is natural, proceeding from input to output. Minor issues: the annotation variable assignment has a space before the equals sign, and the else clause is redundant since the if block returns. These small stylistic issues slightly reduce the score, but overall the code is highly readable.
Run 2
The code is relatively clear in intent and concise, retrieving an expected exception from a Test annotation. However, it has several readability issues: missing access modifier, inconsistent spacing around the equals sign, and an unnecessary else clause after a return statement. The nested method calls (method.getAnnotation(Test.class).expected()) are not overly deep, but the structure could be flatter. Action granularity is acceptable—one main action per line—but the reading flow is slightly disrupted by formatting inconsistencies. Overall, it's understandable but could be improved with better formatting and cleaner conditional logic.
Run 3
The method is concise and has a clear purpose: retrieving the expected exception from a Test annotation. The flow is logical and easy to follow, but there are some readability issues. Naming is weak: 'annotation' is generic, and 'expectedException' sounds like a getter but returns null conditionally. The if-else structure is fine, though ternary could shorten it. Spacing inconsistencies ('annotation=' vs 'annotation =') and lack of braces reduce polish. Missing visibility modifier and no documentation also hurt clarity. Overall, the code is understandable but could be improved with better names, consistent formatting, and a more explicit contract.
Run 1
Code Structure: A simple, logically organized method, though the shown snippet lacks a closing brace. Nesting: Only one shallow conditional, making it easy to follow. Clarity of intent: The method name and return type clearly indicate that it retrieves the expected exception; returning null signifies no expected exception. Code length: Concise, although the else is unnecessary after an early return. Action granularity: Each statement performs a single action. Reading flow: Annotation retrieval followed by checking and returning reads naturally. Inconsistent assignment spacing and omitted conditional braces slightly reduce polish. The assumption that the Test annotation exists is not explicit.
Run 2
Code Structure: The method is logically organized, but the missing closing brace makes the snippet appear incomplete. Nesting: A single if/else keeps nesting shallow. Clarity of intent: The method name and annotation lookup clearly communicate that it retrieves an expected exception type, returning null when none is specified; however, it assumes the annotation exists. Code length: Compact, though the else is unnecessary after an early return. Action granularity: Each statement performs one clear action. Reading flow: Straightforward top-to-bottom flow, slightly weakened by inconsistent spacing and omitted conditional braces.
Run 3
Code Structure: The method is logically organized around retrieving an annotation and returning its expected exception. Nesting: A single if/else keeps nesting shallow. Clarity of intent: The method and variable names clearly communicate purpose, although the assumption that the annotation exists is implicit. Code length: Short and focused; the else could be omitted after the early return. Action granularity: Each line performs one action. Reading flow: The sequence is natural and easy to follow. Minor readability issues include inconsistent spacing around assignment, omitted conditional braces, and the missing method-closing brace in the provided snippet.