Sample

Dorn/java/131

Human rating uses the original dataset scale.

DatasetDorn
Human3.25
Lines30

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
44.0Δ 0.3
Scalabrino0.5550–1; higher is more readable
51.2Δ 7.4
Dorn0.6450–1; higher is more readable
57.7Δ 13.9
Mi0.4820–1; higher is more readable
50.4Δ 6.7
LLOC12Logical lines; fewer is more readable
53.6Δ 9.9
DeepSeek V4 Pro130–20; mean of three runs
59.3Δ 15.6
GPT-6.1 Sol14.670–20; mean of three runs
47.1Δ 3.3
BTTF0.5210–1; higher is more readable
50.1Δ 6.4
Human3.251–5; original rating
43.7

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.816.525−26.945
Source linesThe number of non-empty source lines.30+12
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.878−7.317

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

Score0.555

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.70.968+0.659
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.30+0.301
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.112−0.143
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.26+0.116
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.29.528+0.003

Intercept 0.07 + feature contributions = 0.599 (log-odds).
Score = sigmoid(0.599) = 0.645.

Score0.482
Score12
Run 1

The code is moderately readable. It follows consistent guard clause patterns with early throws for validation, which keeps nesting flat. Each method has a clear single purpose. However, issues reduce clarity: exception constructors lack descriptive messages, making failures harder to diagnose. The setEvent overload chain is logical but the null check in setEvent(String, Serializable) delegates awkwardly after validation. Action granularity is mostly one operation per line, though the multi-line try block in setPortletMode is only partially shown, so its complete structure is unclear. Reading flow is generally natural, but the snippet ends mid-method, leaving the catch/finally logic unknown. Overall, the code is acceptable but would benefit from more informative exceptions and better context around exception handling.

Run 2

The code shows moderate structure with clear null checks and exception throwing, but lacks contextual clarity. Missing imports, class context, and variable declarations make intent ambiguous. The method bodies are flat and relatively readable, but empty exception constructors reduce diagnosability. There is some repetition in the null-check pattern across methods. The final method has deeper nesting due to multiple conditional checks before the try block, and an incomplete try block breaks reading flow. Action granularity is mostly one action per line, which is good, but overall comprehension suffers from omitted surrounding code and unclear purpose of methods.

Run 3

The code is moderately readable. It follows consistent formatting and separates validation from main logic, which is good. Each method has a clear single responsibility, and actions like null checks and throws are on separate lines, aiding clarity. However, there are some issues: the intent of some methods (e.g., setEvent with QName) is not immediately obvious without context. The code is flat and not deeply nested, which helps. But the snippet ends abruptly in a try block, making the overall structure feel incomplete when read in isolation. The use of many underscores in variable names (e.g., _events, _redirectLocation) can be slightly distracting, though it may be a convention. The length is reasonable, but the lack of meaningful exception messages reduces clarity for debugging. Overall, it is readable but could be improved with clearer naming and more context.

Run 1

Code Structure: Methods are logically separated, with validation preceding state changes, but the excerpt begins and ends mid-method, limiting structural completeness. Nesting: Guard clauses keep nesting shallow; the final try block adds little visible complexity. Clarity of intent: Descriptive method and variable names make event registration and portlet-mode updates understandable, although exceptions lack explanatory messages. Code length: The visible code is concise, with no unnecessary implementation detail. Action granularity: Each statement performs one clear action; wrapped constructor and method calls remain readable. Reading flow: Consistent indentation, whitespace, and validation-first ordering support natural reading, but the truncated boundaries and unfinished try block interrupt the flow.

Run 2

Code Structure: Methods are logically separated, with validation preceding operations, although the excerpt starts and ends mid-method. Nesting: Shallow guard clauses make control flow easy to follow; the unfinished try block limits assessment. Clarity of intent: Descriptive method and field names communicate event registration and portlet-mode updates, but exceptions without messages provide little context. Code length: Concise, with no obvious unnecessary code. Action granularity: Each statement performs a distinct action; nested constructor and method calls remain understandable. Reading flow: Consistent indentation, whitespace, and early validation create a natural progression, though truncated boundaries interrupt readability.

Run 3

Code Structure: Methods separate event handling from portlet-mode updates, with validation preceding operations, but the fragment starts and ends mid-method. Nesting: Shallow guard clauses keep control flow simple; the final try block is incomplete. Clarity of intent: Descriptive method and variable names make the main operations understandable, although exceptions without messages provide little context. Code length: Concise, with minimal boilerplate and reasonable line wrapping. Action granularity: Statements generally perform one action each; inline constructor calls remain easy to follow. Reading flow: Consistent indentation and blank lines support a natural validation-then-action sequence, but missing method boundaries and the unfinished try block interrupt comprehension.