Sample
Buse/40
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.292 | 0–1; higher is more readable | 51.5Δ 18.7 |
| Scalabrino | 0.767 | 0–1; higher is more readable | 47.0Δ 14.1 |
| Dorn | 0.743 | 0–1; higher is more readable | 70.7Δ 37.9 |
| Mi | 0.396 | 0–1; higher is more readable | 27.3Δ 5.6 |
| LLOC | 4 | Logical lines; fewer is more readable | 59.6Δ 26.8 |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs | 65.7Δ 32.8 |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs | 32.8Δ 0.0 |
| BTTF | 0.622 | 0–1; higher is more readable | 79.8Δ 47.0 |
| Human | 2.91 | 1–5; original rating | 32.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. | 227.431 | −7.505 |
| 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.435 | −6.652 |
| Source linesThe number of non-empty source lines. | 11 | +4.4 |
Intercept 8.87 + feature contributions = -0.887 (log-odds).
Score = sigmoid(-0.887) = 0.292.
| Score | 0.767 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 92 | +0.68 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 12 | +0.611 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 5 | −0.564 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.06 | +0.357 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 10.86 | −0.258 |
| 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. | 92 | −0.232 |
Intercept 0.07 + feature contributions = 1.062 (log-odds).
Score = sigmoid(1.062) = 0.743.
| Score | 0.396 |
|---|
| Score | 4 |
|---|
Run 1
The code is generally readable and well-structured. It follows a clear logical flow: extract a child element, retrieve a game object, and read its state from XML. The method name and parameter naming are intuitive, and the Javadoc provides helpful context. Nesting is minimal, and action granularity is reasonable with one primary operation per line. The main weaknesses are the lack of null/type safety checks (which isn't directly a readability issue but affects clarity of intent), the somewhat redundant variable naming (`unitElement` and `unit` could be clearer), and the incomplete code snippet leaves ambiguity about what happens next. Overall, the code is concise, flat, and easy to follow, though slightly more descriptive naming or handling of potential null values would improve clarity.
Run 2
The code is readable and well-structured. It has a clear purpose documented by a Javadoc comment, uses meaningful method and variable names, and maintains flat nesting. Each line performs a single logical action, and the flow from parsing the XML element to retrieving and populating the Unit object is natural. Minor deductions: the method body is incomplete in the snippet (likely truncated), and there is an unvalidated cast to Unit that could obscure intent or safety. Overall, concise, logical, and easy to follow.
Run 3
The code is relatively readable: it has a clear method name, a Javadoc comment explaining purpose and parameter, and a straightforward linear flow with no nesting. However, it loses points for clarity of intent and code length because the method body is incomplete—it ends abruptly after reading the unit from XML without returning anything, which is ambiguous and suggests missing logic or a truncated snippet. Action granularity is mostly good with one operation per line, but the method name 'deliverGift' conflicts with its current behavior, which only parses data rather than performing a delivery action. The lack of error handling or validation for missing child elements also contributes to ambiguity. Overall, the structure is clean and flat, making it easy to follow, but the incomplete logic and naming mismatch reduce its readability score.
Run 1
Code Structure: The visible statements are logically organized, but the method is incomplete and lacks a return and closing brace. Nesting: Flat and easy to follow. Clarity of intent: The method name and documentation indicate gift delivery, but the shown code only retrieves and updates a unit, leaving the main purpose unfulfilled. Code length: Concise, though the object lookup line is somewhat long. Action granularity: Each statement performs a distinct main action, with chained calls modestly increasing complexity. Reading flow: Natural progression from extracting the XML element to retrieving the unit and reading its data; the abrupt ending interrupts that flow.
Run 2
Code Structure: The visible statements are logically ordered: retrieve the XML child, find the unit, and update it. However, the snippet is incomplete, with no return statement or closing brace. Nesting: Flat and easy to follow. Clarity of intent: Descriptive method and variable names clarify XML processing, but the visible code does not explain how a gift is delivered; the comment also contains a grammatical error. Code length: Concise, though the lookup expressions are somewhat long. Action granularity: Each statement has a distinct primary action, despite chained calls in the lookup. Reading flow: Natural progression with useful whitespace, but the abrupt ending prevents understanding the complete method.
Run 3
Code Structure: The visible method follows a logical sequence: extract the unit element, resolve the unit, then update it. Nesting: The code is flat, with no nested control flow. Clarity of intent: Descriptive names and documentation help, but the shown operations do not explain how a gift is delivered. Code length: The fragment is concise, though the chained lookup is somewhat dense. Action granularity: Each statement occupies its own line, although lookup and casting are combined. Reading flow: The sequence is natural and whitespace separates extraction from processing. However, the snippet is incomplete: it lacks the remaining method body, a return statement, and closing braces, limiting assessment of the full method.