Sample

Dorn/java/186

Human rating uses the original dataset scale.

DatasetDorn
Human2.79
Lines30

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
48.2Δ 27.3
Scalabrino0.4510–1; higher is more readable
35.7Δ 14.8
Dorn0.4790–1; higher is more readable
40.4Δ 19.5
Mi0.4540–1; higher is more readable
45.1Δ 24.2
LLOC11Logical lines; fewer is more readable
57.0Δ 36.1
DeepSeek V4 Pro130–20; mean of three runs
59.3Δ 38.4
GPT-6.1 Sol15.330–20; mean of three runs
58.6Δ 37.7
BTTF0.6350–1; higher is more readable
82.5Δ 61.6
Human2.791–5; original rating
20.9

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.740.777−24.446
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.5.157−7.736

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

Score0.451

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.30−0.268
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.074+0.221
Indentation frequencyHow rapidly indentation changes from line to line.22+0.024
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.29+0.01
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.29.639+0.004

Intercept 0.07 + feature contributions = -0.084 (log-odds).
Score = sigmoid(-0.084) = 0.479.

Score0.454
Score11
Run 1

The code demonstrates good clarity and logical organization. Methods are well-named (render, serveResource), and actions are mostly granular—one action per line. Variable names are descriptive (ruleGroupId, ruleGroup), and service calls clearly map to domain operations. Nesting is minimal, with only one conditional block in serveResource, and the flow is natural. However, the first line appears as a fragment from a larger context (e.g., missing method signature or prior parameter), and the opening brace before it suggests truncation, slightly hindering standalone readability. Blank lines could improve separation. Some lines are a bit long due to multi-parameter alignment, though still readable. Overall, the code is concise, purposeful, and methodical.

Run 2

The code is moderately readable but suffers from a fragmented structure, likely due to being an excerpt. It uses standard patterns for fetching parameters and setting request attributes, but the overall structure lacks clear context (e.g., the incomplete method signature at the top). Nesting is minimal except for a single if-block. Intent is somewhat clear—fetch a rule group, handle resource requests—but variable names like 'type' are vague. Code length is appropriate for the operations shown, yet action granularity is inconsistent: some lines perform multiple actions (e.g., getLong and setAttribute), while others are broken across lines unnecessarily. Reading flow is discontinuous because the snippet starts mid-method and ends abruptly. Overall, the code follows common Portlet patterns but would benefit from more contextual completeness and consistent formatting to improve clarity.

Run 3

The code shows moderate readability. Structure is logical, with clear method separation and consistent indentation. Nesting is shallow, with only one conditional block. However, several issues reduce clarity: the snippet begins mid-statement, obscuring context. Variable names like 'rule' and 'ruleGroup' are reasonably descriptive, but intent is unclear without surrounding code. The 'type' variable is fetched but unused in the visible portion, creating ambiguity. Code length is acceptable, though some calls are split across multiple lines unnecessarily. Action granularity is mostly one action per line, but the BeanParamUtil and service calls combine multiple operations conceptually. Reading flow is interrupted by the missing initial context. The magic string "portlet.mobile_device_rules.edit_rule" lacks explanation. Overall, the code is understandable to experienced developers familiar with Liferay patterns, but would benefit from additional context, comments explaining business logic, and clearer variable naming to improve readability.

Run 1

Code Structure: The visible operations are logically grouped, but the snippet begins mid-statement and ends mid-method, limiting structural completeness. Nesting: Only one shallow conditional keeps the code easy to follow. Clarity of intent: Descriptive names and explicit service calls make retrieving rules and setting request attributes understandable, although the final type variable's purpose is not shown. Code length: The code is concise, with line wrapping appropriate for longer calls. Action granularity: Each statement performs a distinct operation; wrapped statements do not combine unrelated actions. Reading flow: Within each visible section, the sequence is natural, and blank lines separate steps effectively. The truncated boundaries interrupt the overall reading flow.

Run 2

Code Structure: The visible code is logically organized around retrieving parameters, fetching domain objects, and setting request attributes, though the excerpt starts and ends mid-method. Nesting: Only one shallow conditional appears, making execution easy to follow. Clarity of intent: Descriptive variable names, service calls, and attribute constants clearly communicate most operations; the final type parameter's purpose is not shown. Code length: The excerpt is concise, with reasonable wrapping for long calls and signatures. Action granularity: Each statement performs a distinct operation, with no compressed multi-action lines. Reading flow: Blank lines separate related steps naturally, although the incomplete boundaries and long framework-specific identifiers slightly disrupt readability.

Run 3

Code Structure: The visible operations are logically grouped, and serveResource has a clear method boundary, although the excerpt begins and ends mid-method. Nesting: Only one shallow conditional appears, making control flow easy to follow. Clarity of intent: Descriptive names such as ruleGroupId, fetchRule, and setAttribute communicate parameter retrieval, rule lookup, and request setup; missing surrounding code limits understanding of the overall purpose. Code length: The excerpt is concise, with no obvious redundancy. Action granularity: Each statement performs a distinct operation; multiline calls remain readable. Reading flow: Consistent indentation and blank lines separate related steps naturally, but the dangling opening expression and unfinished ending interrupt continuity.