Sample

MBJP/14

Human rating uses the original dataset scale.

DatasetMBJP
Human4.5
Lines24

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.6950–1; higher is more readable
100.0Δ 28.1
Scalabrino0.9710–1; higher is more readable
100.0Δ 28.1
Dorn0.7940–1; higher is more readable
100.0Δ 28.1
Mi0.4820–1; higher is more readable
25.0Δ 46.9
LLOC4Logical lines; fewer is more readable
93.8Δ 21.9
DeepSeek V4 Pro17.670–20; mean of three runs
81.2Δ 9.4
GPT-6.1 Sol180–20; mean of three runs
65.6Δ 6.2
BTTF0.5680–1; higher is more readable
56.2Δ 15.6
Human4.51–5; original rating
71.9

Views

Source code

import java.io.*; import java.lang.*; import java.util.*; import java.math.*; class FindVolume { /** * * Write a Java function to find the volume of a triangular prism. * * > findVolume(10, 8, 6) * 240 * > findVolume(3, 2, 2) * 6 * > findVolume(1, 2, 1) * 1 */ public static int findVolume(int l, int b, int h) { // Calculate the area of the triangular base int baseArea = (b * h) / 2; // Calculate the volume by multiplying base area with length int volume = baseArea * l; return volume; } }

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.335.201−11.062
Source linesThe number of non-empty source lines.24+9.6
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.389−6.583

Intercept 8.87 + feature contributions = 0.826 (log-odds).
Score = sigmoid(0.826) = 0.695.

Score0.971

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.71.875+0.621
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.059+0.37
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.71.917+0.356
Indentation frequencyHow rapidly indentation changes from line to line.13−0.287
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.24+0.187
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.13+0.123
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.22.877−0.09

Intercept 0.07 + feature contributions = 1.349 (log-odds).
Score = sigmoid(1.349) = 0.794.

Score0.482
Score4
Run 1

The code is concise and well-structured: a single class and method with a clear purpose, flat with no nested blocks, and one action per line. Comments clarify intent, and naming is descriptive. Minor deductions include the one-line method body formatting and redundant imports (java.lang, java.math, java.io), which slightly reduce cleanliness. Overall, highly readable.

Run 2

The code is very clean and readable. It uses a simple class structure with a single, well-named method that directly matches the problem statement. The logic is broken into two clear steps—calculating base area and then volume—with comments explaining each. Nesting is nonexistent, indentation is consistent, and the method is concise without being cramped. Action granularity is appropriate, with one operation per line for clarity. The reading flow is natural: parameters are descriptive, calculations follow a logical sequence, and the return is obvious. Minor deductions are only for the unnecessary imports (java.lang, java.io, java.math, java.util are unused) and the slightly redundant comment style, but these do not meaningfully impact readability.

Run 3

The code is clean and easy to read. It has a clear class name, a single well-named method, and no unnecessary complexity. The method follows a logical two-step process: calculate the base area, then compute the volume. Comments explain the intent without being excessive. Nesting is minimal, and each line performs one clear action. The only minor improvement could be removing the unused imports, but overall readability is high.

Run 1

Code Structure: A single, logically organized method cleanly separates base-area and volume calculations. Nesting: No nested control flow, making the method easy to follow. Clarity of intent: The method name, documentation, examples, and intermediate variables clearly convey the purpose, though l, b, and h are less descriptive than full parameter names. Code length: The implementation is concise, but unused wildcard imports and redundant comments add minor clutter. Action granularity: Each statement performs one clear action. Reading flow: The calculation proceeds naturally from triangular base area to prism volume and then returns the result.

Run 2

Code Structure: The single-purpose method is logically organized, though unused wildcard imports add clutter. Nesting: There is no nested control flow. Clarity of intent: The method name, intermediate variables, and comments clearly explain the calculation, but parameter names l, b, and h are terse. Code length: The implementation is concise; the documentation has minor formatting noise. Action granularity: Each statement performs one clear action. Reading flow: The calculation proceeds naturally from base area to volume to return. Integer division can truncate the base area, and the second documented example is inconsistent with the implementation, slightly weakening clarity and trust.

Run 3

Code Structure: The class contains a single, logically organized method, though unused wildcard imports add clutter. Nesting: There is no nesting, making the method easy to follow. Clarity of intent: The method name, documentation, and comments clearly convey its purpose, but parameter names l, b, and h are less descriptive than length, base, and height. Code length: The implementation is concise; comments are slightly redundant and the documentation has minor formatting noise. Action granularity: Each statement performs one clear action. Reading flow: The progression from base area to volume to return is natural. Integer division can truncate the base area before multiplication, a correctness caveat that is not documented.