Sample

JetBrains/i56

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.56
Lines26

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
28.0Δ 3.4
Scalabrino0.4920–1; higher is more readable
31.4Δ 6.8
Dorn0.3460–1; higher is more readable
25.4Δ 0.8
Mi0.4230–1; higher is more readable
39.0Δ 14.4
LLOC19Logical lines; fewer is more readable
25.4Δ 0.8
DeepSeek V4 Pro17.670–20; mean of three runs
88.6Δ 64.0
GPT-6.1 Sol18.670–20; mean of three runs
91.5Δ 66.9
BTTF0.5780–1; higher is more readable
86.4Δ 61.9
Human0.560–1; original rating
24.6

Views

Source code

public class LookAndSay { public static void main(String[] args) { String currentTerm = "1"; for (int i = 0; i < 20; i++) { System.out.println(currentTerm); currentTerm = getNextTerm(currentTerm); } } private static String getNextTerm(String term) { StringBuilder nextTerm = new StringBuilder(); char currentChar = term.charAt(0); int count = 1; for (int i = 1; i < term.length(); i++) { if (term.charAt(i) == currentChar) { count++; } else { nextTerm.append(count).append(currentChar); currentChar = term.charAt(i); count = 1; } } nextTerm.append(count).append(currentChar); return nextTerm.toString(); } }

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.944.28−31.161
Source linesThe number of non-empty source lines.26+10.4
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.824−5.736

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

Score0.492

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.63+0.997
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Indentation frequencyHow rapidly indentation changes from line to line.1−0.703
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.25−0.153
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.26+0.116
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.106−0.091
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.24.531−0.067

Intercept 0.07 + feature contributions = -0.635 (log-odds).
Score = sigmoid(-0.635) = 0.346.

Score0.423
Score19
Run 1

The code is highly readable. It has a clear structure with separate methods for generating and printing terms. Nesting is minimal, with only one level inside the loops. Intent is clear: generate the Look-and-Say sequence. The `getNextTerm` method is concise and follows a straightforward algorithm. Each line performs a single logical action, and the flow from initial term through iteration to output is natural. Minor improvements could include adding comments or constants, but overall this is excellent.

Run 2

The code is well-structured with a clear separation of concerns: main handles iteration and output while getNextTerm implements the look-and-say logic. Nesting is minimal with only one level inside the loop. Variable names are descriptive, and the algorithm is concise without unnecessary verbosity. Each line performs a single logical action, promoting readability. The reading flow follows a natural progression from initialization through counting to appending results. The only minor deduction is the slight duplication in appending the final count/character sequence, which could be slightly more elegant but doesn't harm clarity.

Run 3

The code is well-structured, with a clear separation between the main loop and the term-generation logic. Nesting is minimal, with only two levels (loop and if-else). Intent is obvious from method and variable names. The code is concise and avoids unnecessary verbosity. Each line performs a single logical action, enhancing readability. The reading flow follows a natural progression: initialize, loop, print, update, then compute next term. The getNextTerm method is straightforward, though it could benefit from a brief comment explaining the look-and-say rule for newcomers. Overall, this is highly readable code.

Run 1

Code Structure: Clear separation between sequence output and next-term generation. Nesting: Shallow, with only an if/else inside a loop. Clarity of intent: Descriptive class, method, and variable names make the look-and-say algorithm easy to understand; the hardcoded iteration count is a minor clarity issue. Code length: Concise without unnecessary abstractions or repetition. Action granularity: Each line generally performs one logical action; chained appends naturally represent adding a count-character pair. Reading flow: Initialization, character grouping, final-group handling, and return follow a natural sequence. The nonempty-input assumption in getNextTerm is implicit, slightly reducing clarity.

Run 2

Code Structure: Clean separation between sequence generation in main and term construction in getNextTerm. Nesting: Shallow, with only an if/else inside a loop. Clarity of intent: Descriptive class, method, and variable names make the look-and-say algorithm easy to understand; the fixed iteration count of 20 is unexplained. Code length: Concise without sacrificing clarity or introducing unnecessary abstractions. Action granularity: Most lines perform one action; chained append calls naturally express a count-character pair. Reading flow: Initialization, character counting, group emission, and final-group handling follow a logical order. A brief explanation of the final append and a named iteration constant would offer minor readability improvements.

Run 3

Code Structure: Clean separation between sequence generation in main and term construction in getNextTerm. Nesting: Shallow, with only an if/else inside a loop. Clarity of intent: Descriptive class, method, and variable names make the look-and-say algorithm easy to understand; the unexplained iteration limit of 20 is a minor weakness. Code length: Concise without sacrificing clarity. Action granularity: Statements generally perform one action per line; chained append calls express a cohesive count-character pair. Reading flow: Natural progression from initialization through character counting, group emission, and final return. Overall, highly readable with only minor opportunities to clarify the iteration limit.