Sample

MBJP/8

Human rating uses the original dataset scale.

DatasetMBJP
Human1
Lines45

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
25.0Δ 25.0
Scalabrino0.4830–1; higher is more readable
18.8Δ 18.8
Dorn0.5360–1; higher is more readable
31.2Δ 31.2
Mi0.7720–1; higher is more readable
87.5Δ 87.5
LLOC24Logical lines; fewer is more readable
6.2Δ 6.2
DeepSeek V4 Pro2.330–20; mean of three runs
0.0Δ 0.0
GPT-6.1 Sol6.670–20; mean of three runs
0.0Δ 0.0
BTTF0.2410–1; higher is more readable
0.0Δ 0.0
Human11–5; original rating
0.0

Views

Source code

import java.io.*; import java.lang.*; import java.util.*; import java.math.*; class SquareNums { /** * * Write a function to find squares of individual elements in a list using lambda function. * * > squareNums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) * [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] * > squareNums([10, 20, 30]) * [100, 400, 900] * > squareNums([12, 15]) * [144, 225] */ public static List<Integer> squareNums(List<Integer> nums) { List<Integer> r = new ArrayList<>(); nums.stream().forEach(n -> { int temp = 0; int a = n; int b = 0; int c = 0; boolean d = false; for (int i = 0; i < 10; i++) { if (a == 0) { break; } a = a / 10; } for (int i = 0; i < 3; i++) { temp = n * n; b = temp; c = b; } int qwe = 0; while (qwe < 1) { int p = n * n; r.add(p); qwe++; } }); return r; } }

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.1127.365−37.203
Source linesThe number of non-empty source lines.45+18
Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value.3.922−5.883

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

Score0.483

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.96.889+0.759
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.45−0.557
Indentation frequencyHow rapidly indentation changes from line to line.36+0.508
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.96.978−0.442
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.36−0.405
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.43.969+0.205
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.096+0.006

Intercept 0.07 + feature contributions = 0.143 (log-odds).
Score = sigmoid(0.143) = 0.536.

Score0.772
Score24
Run 1

This code is highly unreadable despite being short. The logic is unnecessarily convoluted: dead variables (temp, a, b, c, d), pointless nested loops with arbitrary iteration counts, and an odd while loop used to add a single result. Intent is obscured—squaring each number should be a simple one-liner (e.g., nums.stream().map(n -> n*n).collect(...)), but here the implementation is tangled and ambiguous. Structure is poor: no helper methods, redundant computation (n*n computed multiple times), and confusing variable names like qwe. Nesting is excessive with nested loops and conditionals serving no purpose. Action granularity is mixed, with multiple operations crammed into some lines. Reading flow is broken by these dead constructs. The only positive aspects are the method declaration and Javadoc example, but the implementation fails almost every readability criterion.

Run 2

The code is extremely unreadable. Structure is poor: the method is cluttered with dead code (unused loops, variables a, b, c, d, qwe, p) that serve no logical purpose. Nesting is deep and unnecessary—multiple loops and branches make the flow tangled. Intent is unclear; despite the docstring, the implementation ignores the stated lambda-function goal and uses convoluted logic instead of a simple map operation. Code length is unnecessarily long, with dozens of lines where a single line like `nums.stream().map(n -> n * n).collect(Collectors.toList())` would suffice. Action granularity is violated by pointless assignments and loops doing nothing meaningful. Reading flow is disorganized, jumping between irrelevant blocks. Overall, the code obscures a trivial operation behind misleading complexity, making it nearly unreadable despite correct final output.

Run 3

This code is extremely unreadable. The import statements are unnecessary and clutter the file. The method contains deeply convoluted logic: multiple unused variables (a, b, c, d, temp, qwe), an irrelevant loop over digits (i < 10), and a pointless while loop that runs exactly once. The function's intent—squaring each list element—is simple, yet it is implemented with multiple nested blocks, misleading names, and dead code. Action granularity is poor: several actions are crammed together with no separation of concerns. Reading flow is disjointed, forcing the reader to parse tangled control flow to understand a trivial operation. The lambda function is also unnecessary due to the stream already handling iteration. The code should simply be `return nums.stream().map(n -> n * n).collect(Collectors.toList());`. Overall, it actively obscures rather than communicates purpose.

Run 1

Code Structure: The method has a recognizable input-to-output structure, but irrelevant variables and redundant loops obscure the actual computation. Nesting: The lambda contains several loops and a nested conditional, creating unnecessary depth for a simple operation. Clarity of intent: The method name and documentation clearly describe squaring list elements, but cryptic names such as r, a, b, c, and qwe distract from that purpose. Code length: The implementation is substantially longer than necessary, with unused variables, discarded calculations, and repeated multiplication. Action granularity: Most statements perform one action per line, which aids local readability. Reading flow: The reader must work through unrelated digit division and repeated assignments before reaching the meaningful square-and-add operation. Broad, unnecessary imports add further clutter.

Run 2

Code Structure: The class and method are organized conventionally, but the lambda contains unrelated calculations and redundant loops. Nesting: Several loops and a conditional inside the lambda create unnecessary nesting for a simple task. Clarity of intent: The method name and documentation clearly describe squaring elements, but cryptic names such as r, a, b, c, d, and qwe obscure the implementation. Code length: The method is disproportionately long; unused variables, digit-processing logic, and repeated multiplication add noise. Action granularity: Statements generally perform one action per line, which helps local readability. Reading flow: Formatting is consistent, but irrelevant operations interrupt the natural progression from input elements to squared results. A direct stream map or straightforward loop would communicate the same intent much more clearly.

Run 3

Code Structure: The class and method are organized conventionally, but irrelevant variables and redundant loops obscure a simple transformation. Nesting: The lambda contains loops and a nested conditional, adding unnecessary depth. Clarity of intent: The method name and documentation clearly describe squaring list elements, but cryptic names such as r, a, b, c, and qwe make the implementation harder to interpret. Code length: Far longer than necessary; unused calculations, repeated multiplication, and unnecessary imports add noise. Action granularity: Each statement generally performs one action per line, which helps readability. Reading flow: Formatting is consistent, but readers must trace unrelated operations before reaching the actual square calculation and insertion.