Sample

Scalabrio152

Human rating uses the original dataset scale.

DatasetScalabrino
Human4.11
Lines41

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
24.6Δ 53.5
Scalabrino0.6440–1; higher is more readable
64.8Δ 13.3
Dorn0.250–1; higher is more readable
33.2Δ 45.0
Mi0.4030–1; higher is more readable
67.8Δ 10.3
LLOC19Logical lines; fewer is more readable
28.4Δ 49.7
DeepSeek V4 Pro15.330–20; mean of three runs
66.6Δ 11.6
GPT-6.1 Sol14.670–20; mean of three runs
13.8Δ 64.3
BTTF0.4850–1; higher is more readable
34.2Δ 44.0
Human4.111–5; original rating
78.1

Views

Download official ZIP ↗

Select the downloaded ZIP or its extracted folder. Files stay in your browser.

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.1367.077−45.114
Source linesThe number of non-empty source lines.41+16.4
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.03−7.545

Intercept 8.87 + feature contributions = -27.389 (log-odds).
Score = sigmoid(-27.389) = 0.

Score0.644

Feature contributions

FeatureValueContribution
(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.183.951−4.126
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.184+2.164
Indentation frequencyHow rapidly indentation changes from line to line.40+0.646
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.41−0.415
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.39.8+0.146
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.095+0.018

Intercept 0.07 + feature contributions = -1.099 (log-odds).
Score = sigmoid(-1.099) = 0.25.

Score0.403
Score19
Run 1

The code has a clear purpose and follows a logical structure, but readability is hampered by several issues. The method begins with two separate guard clauses that could be combined or simplified, and the while loop contains a switch statement with multiple cases — some empty or redundant — adding nesting depth. The use of XMLStreamConstants case labels is verbose, and the default branch throws a long exception message that interrupts scanning. Action granularity is mostly good, but the repeated retrieval and casting of event types could be extracted for clarity. The method is relatively concise, but the nested switch inside a loop makes the reading flow somewhat disorganized. Overall, it is understandable but not maximally readable.

Run 2

The code is generally readable with clear structure and intent. It has a flat control flow (no deep nesting), logical organization, and appropriate action granularity. The switch statement is well-formatted with clear cases and explicit handling. However, a few aspects reduce readability slightly: the default case contains a long exception message concatenation, the loop condition and event advancement pattern could be slightly clearer, and there is minor inconsistency in casting (using event.asCharacters() vs explicit cast for EntityReference). Overall, the method is concise, follows a natural reading flow, and clearly documents its purpose through exception messages and comments.

Run 3

The code is generally well-structured and readable. It has a clear purpose, uses a flat control flow with only one level of nesting inside the while loop, and maintains good action granularity. Variable names are descriptive, and the logic is easy to follow. The switch statement is used effectively to handle different XML event types, with each case having a single purpose. However, there are minor issues: the loop condition depends on an event not being END_DOCUMENT, which may not be immediately obvious; the repeated XMLStreamException messages could be extracted; and the handling of COMMENT/PROCESSING_INSTRUCTION as empty blocks with a break could be slightly clearer. Overall, the code is maintainable and easy to understand.

Run 1

Code Structure: Input validation, text accumulation, and return are logically separated; the switch organizes event handling clearly. Nesting: Moderate loop/switch/block nesting is manageable, though case braces add visual depth. Clarity of intent: Descriptive names and explicit event constants help, but requiring START_ELEMENT while rejecting it in the initial switch obscures the intended behavior. Stopping at END_DOCUMENT rather than END_ELEMENT also conflicts with the apparent purpose of reading element text. Code length: Mostly concise, with a disproportionately long exception statement. Action granularity: Each line generally performs one action, and intermediate variables clarify entity handling. Reading flow: Guard clauses and grouped cases support sequential reading, but processing the previous event before advancing makes the traversal harder to understand.

Run 2

Code Structure: Input validation, accumulation, and return are logically organized; the switch groups related event types clearly. Nesting: The loop, switch, and case blocks introduce moderate but manageable nesting. Clarity of intent: Descriptive names indicate XML text extraction, but processing the initial START_ELEMENT through a switch that rejects it, and stopping at END_DOCUMENT rather than END_ELEMENT, make the intended control flow confusing. Code length: Mostly concise, though the default exception statement is overly long. Action granularity: Statements generally perform one action each, supporting easy scanning. Reading flow: Guard clauses and consistent event handling provide a natural sequence, but the mismatch between validation and subsequent processing interrupts comprehension.

Run 3

Code Structure: Guard clauses and a switch provide logical organization, with related event types grouped together. Nesting: Moderate loop/switch/case nesting remains manageable. Clarity of intent: Descriptive names make text accumulation clear, but processing begins with a validated START_ELEMENT that falls into the default exception branch; the END_DOCUMENT termination also conflicts with the apparent goal of reading one element's text. Code length: Mostly concise, although the long exception construction reduces readability. Action granularity: Statements generally perform one action per line, and intermediate variables clarify entity handling. Reading flow: Validation, accumulation, and return form a natural sequence, but the event initialization and termination choices make the intended traversal difficult to follow.