Sample

Buse/56

Human rating uses the original dataset scale.

DatasetBuse
Human3.61
Lines8

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.5740–1; higher is more readable
66.7Δ 3.0
Scalabrino0.830–1; higher is more readable
66.7Δ 3.0
Dorn0.7420–1; higher is more readable
69.7Δ 6.1
Mi0.690–1; higher is more readable
78.8Δ 15.2
LLOC4Logical lines; fewer is more readable
59.6Δ 4.0
DeepSeek V4 Pro16.670–20; mean of three runs
81.8Δ 18.2
GPT-6.1 Sol17.670–20; mean of three runs
76.3Δ 12.6
BTTF0.7450–1; higher is more readable
97.0Δ 33.3
Human3.611–5; original rating
63.6

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)
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.701−7.052
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.143.061−4.721
Source linesThe number of non-empty source lines.8+3.2

Intercept 8.87 + feature contributions = 0.297 (log-odds).
Score = sigmoid(0.297) = 0.574.

Score0.83

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.66+0.87
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.9+0.718
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.5+0.306
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.7.761−0.301
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.078+0.185
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.44.556−0.086

Intercept 0.07 + feature contributions = 1.059 (log-odds).
Score = sigmoid(1.059) = 0.742.

Score0.69
Score4
Run 1

The code is clear and concise with good structure. It begins with a descriptive Javadoc comment explaining the method's purpose. The method name 'swap' and parameter/variable names ('newTop', 'oldTop') clearly express intent. Nesting is minimal—only a flat structure is present. Action granularity is good: each line performs a distinct operation (retrieve, replace, return). The reading flow is natural: document, retrieve old value, set new value, return old value. Minor deductions: the explicit cast '(NameSpace)' suggests raw type usage, which slightly obscures intent, and the comment could clarify that the stack's top is at index 0. Overall, it is highly readable with only small style concerns.

Run 2

The code is clear and well-structured. It has a single, obvious purpose: swapping the top of a stack. The method is short, with no unnecessary complexity or nesting. Each action is on its own line, improving readability. The variable names are meaningful ('newTop', 'oldTop'), and the cast is explicit, though slightly verbose. The Javadoc comment explains the behavior concisely. Minor deductions: the cast `(NameSpace)(stack.elementAt(0))` is redundant if the stack is already typed, and the method lacks a `@param`/`@return` tag in the Javadoc, which could improve intent clarity. Overall, it's very readable and follows good object-oriented encapsulation practices.

Run 3

The code is clear and well-structured. It has a concise Javadoc comment explaining its purpose, uses descriptive variable names, and performs a simple swap operation. The method is short, has minimal nesting, and reads naturally. Minor issues include an unnecessary cast (since the stack is likely generic) and a lack of final keywords, but these do not significantly impact readability. The code effectively balances conciseness with clarity.

Run 1

Code Structure: The method is logically organized into retrieving, replacing, and returning the stack's top value. Nesting: The code is flat with no nested control flow. Clarity of intent: The comment, method name, and variable names clearly convey the swap operation, though using index 0 as the stack top assumes knowledge of the underlying representation. Code length: The implementation is concise without unnecessary statements. Action granularity: Each statement performs one clear action. Reading flow: The statements follow a natural sequence, but inconsistent spacing and the missing closing brace slightly reduce readability and completeness.

Run 2

Code Structure: The method follows a simple, logical sequence: retrieve, replace, and return. Nesting: There is no nested control flow. Clarity of intent: The documentation and descriptive names clearly explain the swap operation, though index 0 implicitly represents the stack top. Code length: The implementation is concise without unnecessary steps. Action granularity: Each statement performs one distinct action. Reading flow: The statements follow the documented behavior naturally. Inconsistent spacing and redundant parentheses around the cast expression slightly reduce polish, and the missing closing brace makes the provided snippet incomplete.

Run 3

Code Structure: A logically organized method with a clear sequence: retrieve, replace, return. Nesting: No nested control flow. Clarity of intent: The documentation and descriptive variable names clearly explain the stack-top swap. Code length: Concise, with no unnecessary operations. Action granularity: Each statement performs one distinct action. Reading flow: Natural and easy to follow, though inconsistent spacing and redundant parentheses around the cast expression add minor visual clutter. The missing closing brace makes the provided snippet incomplete.