Sample

JetBrains/e40

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.84
Lines19

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
37.3Δ 31.8
Scalabrino0.6430–1; higher is more readable
46.6Δ 22.5
Dorn0.2860–1; higher is more readable
19.5Δ 49.6
Mi0.2810–1; higher is more readable
21.2Δ 47.9
LLOC11Logical lines; fewer is more readable
63.6Δ 5.5
DeepSeek V4 Pro16.670–20; mean of three runs
62.3Δ 6.8
GPT-6.1 Sol180–20; mean of three runs
77.5Δ 8.5
BTTF0.4630–1; higher is more readable
49.2Δ 19.9
Human0.840–1; original rating
69.1

Views

Source code

import java.math.BigDecimal; public class PrintEuler { public static void main(String[] args) { System.out.println(calcEuler().toPlainString()); } public static BigDecimal calcEuler() { BigDecimal e = BigDecimal.ONE; BigDecimal fact = BigDecimal.ONE; int precision = 1000; for (int i = 1; i <= precision; i++) { fact = fact.multiply(new BigDecimal(i)); e = e.add(BigDecimal.ONE.divide(fact, precision, BigDecimal.ROUND_HALF_UP)); } return e.round(new java.math.MathContext(precision)); } }

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.734.634−24.243
Source linesThe number of non-empty source lines.19+7.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.428−6.642

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

Score0.643

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.17+0.434
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.91−0.189
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.114−0.169
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.17.772−0.161
Indentation frequencyHow rapidly indentation changes from line to line.19−0.08
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.19−0.015

Intercept 0.07 + feature contributions = -0.915 (log-odds).
Score = sigmoid(-0.915) = 0.286.

Score0.281
Score11
Run 1

The code is clean and logically structured, with clear separation between the main method and the calculation logic. Nesting is minimal, with only a single for-loop and no deep conditional branches. The intent is evident from method names and the straightforward algorithm for calculating Euler's number. Code length is concise, though precision is hardcoded rather than configurable. Each line generally performs one action, aiding readability. The reading flow follows the natural computation order, making the code easy to follow. Minor deductions: the hardcoded 1000 appears twice instead of as a named constant, and the rounding mode 'ROUND_HALF_UP' is deprecated in newer Java versions. Overall, the code is highly readable, scoring just below perfection due to small maintainability improvements.

Run 2

The code is generally well-structured and readable. It separates the main method from the calculation logic, and the method name clearly indicates its purpose. Nesting is minimal, with only a simple for-loop. Each line performs a single action, and the reading flow is natural. However, the variable name 'e' and 'fact' are somewhat terse, and the magic number '1000' for precision is hardcoded. The use of a deprecated rounding constant (BigDecimal.ROUND_HALF_UP) is a minor issue. The code is concise but could be slightly clearer with a named constant for precision and more descriptive variable names.

Run 3

The code is concise and clearly structured into small, focused methods. It has flat nesting with only a single loop and no conditional complexity. Intent is clear: calculate Euler's number to 1000 digits. Each line performs a single logical action, and the reading flow follows a natural top-down progression. Minor deductions: the loop variable 'i' is used only for creating BigDecimal values, which is slightly redundant; using an int counter converted each iteration is acceptable but could be marginally cleaner. The precision value is hardcoded, which reduces flexibility but keeps the code short. Overall, it is highly readable with minimal improvements possible.

Run 1

Code Structure: The class cleanly separates printing from computation. Nesting: A single loop keeps nesting shallow. Clarity of intent: Class and method names clearly indicate Euler's number computation, and the factorial series is recognizable, though 'fact' could be 'factorial' and 'precision' ambiguously controls both iteration count and decimal scale. Code length: The implementation is concise without unnecessary scaffolding. Action granularity: Each statement performs one primary action; the chained arithmetic expression remains manageable. Reading flow: Initialization, iteration, rounding, and output follow a natural sequence. Minor readability issues include inconsistent indentation, a fully qualified MathContext reference instead of an import, and the legacy rounding constant instead of RoundingMode.HALF_UP.

Run 2

Code Structure: Printing and calculation are cleanly separated into methods. Nesting: A single loop keeps nesting shallow. Clarity of intent: Class and method names clearly indicate Euler's number calculation; e and fact are understandable in context, although precision ambiguously controls both iteration count and decimal precision. Code length: Compact without unnecessary boilerplate. Action granularity: Each statement performs one primary action, though the division nested within addition is slightly dense. Reading flow: Initialization, factorial accumulation, series summation, and final rounding follow a natural sequence. Minor readability drawbacks include the unexplained constant 1000, abbreviated fact, the legacy rounding constant, and inconsistent use of imported versus fully qualified math classes.

Run 3

Code Structure: Clean separation between printing and calculating Euler’s number. Nesting: Minimal, with a single loop inside the calculation method. Clarity of intent: The class and method names communicate the purpose, and the factorial-series calculation is straightforward; however, 'precision' ambiguously controls both iteration count and decimal precision. Code length: Concise without unnecessary scaffolding. Action granularity: Statements generally perform one action each, though the division nested within addition is slightly dense. Reading flow: Initialization, accumulation, rounding, and output follow a natural sequence. More descriptive variable names, an imported MathContext, and a brief explanation of the series would improve readability.