Sample

JetBrains/i36

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.67
Lines12

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
61.9Δ 22.5
Scalabrino0.5370–1; higher is more readable
36.4Δ 3.0
Dorn0.4980–1; higher is more readable
44.9Δ 5.5
Mi0.4890–1; higher is more readable
49.2Δ 9.7
LLOC7Logical lines; fewer is more readable
85.2Δ 45.8
DeepSeek V4 Pro150–20; mean of three runs
43.6Δ 4.2
GPT-6.1 Sol170–20; mean of three runs
46.2Δ 6.8
BTTF0.2520–1; higher is more readable
4.2Δ 35.2
Human0.670–1; original rating
39.4

Views

Source code

import java.math.BigDecimal; public class Main { public static void main(String[] args) { BigDecimal a = new BigDecimal(2); BigDecimal r = new BigDecimal(Math.sqrt(2)); int scale = 1000; BigDecimal r2 = r.setScale(scale, BigDecimal.ROUND_HALF_UP); BigDecimal ans = a.multiply(r2).setScale(scale); System.out.println(ans); } }

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.475.686−15.698
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.391−6.586
Source linesThe number of non-empty source lines.12+4.8

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

Score0.537

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.71+0.658
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.12+0.611
Indentation frequencyHow rapidly indentation changes from line to line.12−0.322
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.10.833−0.258
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.12+0.145
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.108−0.109

Intercept 0.07 + feature contributions = -0.008 (log-odds).
Score = sigmoid(-0.008) = 0.498.

Score0.489
Score7
Run 1

The code is short and readable with clean structure and flat nesting. Each statement is on its own line, and variable names are concise. However, intent is ambiguous—variables are single letters without meaningful names, and the purpose of the program (approximating 2√2 to 1000 decimal places) is not clear. The import is present but unnecessary, and comments are absent, which lowers score.

Run 2

The code is concise and clearly structured, with a straightforward sequence of operations. Variable names like 'a', 'r', and 'r2' are arguably too terse, reducing clarity of intent — 'r' likely means 'root' and 'r2' means 'root scaled', but this is ambiguous. The logic is flat with no nesting, and actions are one per line, improving readability. The code length is minimal, but it sacrifices explicitness; a comment or more descriptive names would help. The use of BigDecimal.ROUND_HALF_UP is deprecated, but that is a technical issue, not a readability one. Reading flow is natural, though the introduction of 'a' at the start serves no purpose beyond multiplying by 2, which could be done directly. Overall, it is readable for simple code but lacks documentation and descriptive naming.

Run 3

The code is logically structured and easy to follow, with a clear sequence of operations: define values, set scale, perform multiplication, and output the result. Nesting is minimal, and the intent is reasonably clear—computing 2 times the square root of 2 to a high precision. However, variable names like 'a', 'r', 'r2', and 'ans' are cryptic, reducing clarity. The code is concise but could be marginally improved by using MathContext or setScale with a rounding mode more explicitly. Action granularity is good, with one key operation per line. Reading flow is natural, but the abbreviation of variables slightly disrupts understanding. Overall, readability is high but not perfect due to naming and minor structural choices.

Run 1

Code Structure: Imports, class, and main method are logically organized. Nesting: Minimal, with no nested control flow. Clarity of intent: The calculation and output are easy to follow, but names such as a, r, r2, and ans do not explain their roles; the purpose of the 1000-digit scale is unclear. Code length: Concise, with no unnecessary scaffolding beyond standard Java requirements. Action granularity: Each statement occupies its own line, although multiplication and scaling are chained in one expression. Reading flow: Natural progression from initialization through calculation to printing. Named constants and descriptive variables would improve readability. Scaling a double-derived square root to 1000 decimal places also makes the apparent precision potentially misleading.

Run 2

Code Structure: Imports, class, and main method are logically organized. Nesting: Minimal, with no nested control flow. Clarity of intent: The arithmetic steps are understandable, but names such as a, r, r2, and ans obscure their meaning, and the purpose of the 1000-digit scale is unexplained. Code length: Short and concise, without unnecessary boilerplate beyond Java requirements. Action granularity: Each line performs one primary action; the chained multiplication and scaling remain easy to follow. Reading flow: Initialization, scaling, calculation, and output proceed naturally. More descriptive variable names and a brief explanation of the precision choice would improve readability.

Run 3

Code Structure: A simple, logically organized main method with a clear sequence of operations. Nesting: Minimal nesting, limited to the class and method. Clarity of intent: The arithmetic steps are understandable, but names such as a, r, r2, and ans obscure their roles, and the reason for using a scale of 1000 is unexplained. Code length: Concise, with no unnecessary control flow or boilerplate beyond Java's basic requirements. Action granularity: Each statement occupies its own line; the chained multiplication and scaling remain easy to follow. Reading flow: Natural progression from initialization through calculation to output, with consistent formatting. More descriptive variable names and a brief explanation of the precision choice would improve readability.