Sample

JetBrains/e19

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.87
Lines43

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
5.9Δ 66.9
Scalabrino0.6750–1; higher is more readable
52.5Δ 20.3
Dorn0.2130–1; higher is more readable
16.9Δ 55.9
Mi0.2350–1; higher is more readable
16.1Δ 56.8
LLOC34Logical lines; fewer is more readable
2.5Δ 70.3
DeepSeek V4 Pro16.330–20; mean of three runs
56.8Δ 16.1
GPT-6.1 Sol170–20; mean of three runs
46.2Δ 26.7
BTTF0.310–1; higher is more readable
11.9Δ 61.0
Human0.870–1; original rating
72.9

Views

Source code

public class ChristmasTrees { public static void main(String[] args) { for (int size = 3; size <= 9; size++) { drawTree(size); System.out.println(); // blank line separator } } private static void drawTree(int size) { int trunkHeight = size / 3; int branchWidth = 1; for (int row = 0; row < size; row++) { drawRow(size, trunkHeight, branchWidth, row); branchWidth += (row < size - 1) ? 2 : 0; // increase branch width except for last row } drawTrunk(size, trunkHeight); } private static void drawRow(int size, int trunkHeight, int branchWidth, int row) { int spaces = size - row - 1; for (int i = 0; i < spaces; i++) { System.out.print(" "); } for (int i = 0; i < branchWidth; i++) { System.out.print("*"); } System.out.println(); } private static void drawTrunk(int size, int trunkHeight) { int spaces = size - 1; for (int i = 0; i < spaces; i++) { System.out.print(" "); } System.out.println("*"); // single asterisk for trunk base for (int i = 0; i < trunkHeight - 1; i++) { // additional lines for trunk height for (int j = 0; j < spaces; j++) { System.out.print(" "); } System.out.println("*"); } } }

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.1738.308−57.364
Source linesThe number of non-empty source lines.43+17.2
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.997−5.995

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

Score0.675

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.101+0.825
Indentation frequencyHow rapidly indentation changes from line to line.1−0.703
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.100.953−0.611
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.43−0.486
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.38−0.451
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.41.706+0.173
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.11−0.124

Intercept 0.07 + feature contributions = -1.306 (log-odds).
Score = sigmoid(-1.306) = 0.213.

Score0.235
Score34
Run 1

The code is well-structured, with clear method separation (main, drawTree, drawRow, drawTrunk) and consistent naming. Nesting is minimal and each method has a single responsibility. However, some clarity issues exist: the unused `trunkHeight` parameter in `drawRow` is misleading, and the trunk-drawing logic duplicates the space-printing loop, which could be refactored into a helper method. The conditional branch-width increment is slightly cryptic, though the inline comment helps. Overall, the code is readable and maintainable, but minor improvements in parameter usage and DRY principles would enhance clarity.

Run 2

The code is well-structured and readable. It uses clear method names (drawTree, drawRow, drawTrunk) that communicate purpose effectively. Nesting is minimal, with loops kept at reasonable depth. Each method has a single responsibility, aiding clarity. Action granularity is good, with one main action per line. The reading flow is natural, moving from tree drawing to trunk drawing. Minor improvements could include simplifying the trunk drawing loop and removing the unused trunkHeight parameter from drawRow. The branchWidth increment logic is slightly compact but understandable. Overall, the code is concise and maintainable.

Run 3

The code is generally well-structured with good separation of concerns: main loop, tree drawing, row drawing, and trunk drawing are separate methods. Nesting is shallow, with at most two nested loops. The intent is mostly clear, with descriptive method names. However, there are some readability issues: the parameter `trunkHeight` is passed to `drawRow` but never used, creating ambiguity. The `branchWidth` increment logic is clever but not immediately obvious. The trunk drawing has some redundancy—the first trunk line is drawn separately from the loop, which could be simplified. Action granularity is mostly one action per line, but the loop conditions and increment operations are somewhat dense. Overall, the code is quite readable, with only minor improvements needed.

Run 1

Code Structure: Well organized into methods for generating trees, drawing rows, and drawing trunks. Nesting: Mostly shallow, with only a modest nested loop in trunk drawing. Clarity of intent: Descriptive names make the purpose clear, but drawRow's unused trunkHeight parameter is distracting, and the conditional branch-width increment adds needless complexity. Code length: Reasonably concise, though trunk drawing duplicates the first line instead of using one loop for all trunk rows. Action granularity: Statements generally perform one action per line. Reading flow: Natural top-down progression from main to drawing helpers, supported by consistent formatting; minor duplication and unnecessary parameter passing slightly interrupt the flow.

Run 2

Code Structure: Well-organized methods separate tree generation, branch rows, and trunk drawing. Nesting: Mostly shallow, with only a two-level loop in trunk rendering. Clarity of intent: Descriptive method and variable names make the purpose clear, though drawRow receives an unused trunkHeight parameter and the conditional branch-width increment adds unnecessary complexity. Code length: Reasonably concise, but trunk rendering duplicates spacing and printing logic that could be handled by one loop. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Execution proceeds naturally from main to tree, rows, and trunk, with consistent formatting and helpful separators.

Run 3

Code Structure: Well-organized methods separate tree generation, branch rows, and trunk rendering, though drawRow receives an unused trunkHeight parameter. Nesting: Mostly shallow loops; only trunk rendering contains a nested loop, which remains easy to follow. Clarity of intent: Descriptive method and variable names make the purpose clear, supported by straightforward comments. The conditional branchWidth increment is unnecessarily elaborate. Code length: Reasonably concise, but duplicated trunk-line printing and repeated spacing loops could be simplified. Action granularity: Statements generally perform one action per line; conventional for-loop headers do not impede readability. Reading flow: Execution progresses naturally from generating trees to drawing branches and then trunks, with consistent formatting and clear method boundaries.