Sample
JetBrains/e59
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 58.5Δ 30.9 |
| Scalabrino | 0.796 | 0–1; higher is more readable | 72.0Δ 17.4 |
| Dorn | 0.78 | 0–1; higher is more readable | 95.8Δ 6.4 |
| Mi | 0.613 | 0–1; higher is more readable | 75.4Δ 14.0 |
| LLOC | 15 | Logical lines; fewer is more readable | 43.6Δ 45.8 |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs | 43.6Δ 45.8 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 46.2Δ 43.2 |
| BTTF | 0.469 | 0–1; higher is more readable | 50.8Δ 38.6 |
| Human | 0.94 | 0–1; original rating | 89.4 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 782.323 | −25.817 |
| Source linesThe number of non-empty source lines. | 31 | +12.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.364 | −5.046 |
Intercept 8.87 + feature contributions = -9.592 (log-odds).
Score = sigmoid(-9.592) = 0.
| Score | 0.796 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 60.968 | +1.083 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 27 | −0.199 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 27 | +0.197 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 60.806 | +0.177 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 31 | −0.061 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.098 | −0.008 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.839 | +0.007 |
Intercept 0.07 + feature contributions = 1.266 (log-odds).
Score = sigmoid(1.266) = 0.78.
| Score | 0.613 |
|---|
| Score | 15 |
|---|
Run 1
The code has a clear overall structure, with a main method and an outer loop that generates the Van Eck sequence. However, readability issues exist. The inner for-loop relies on break and a subsequent check of its control variable (j < 0) to distinguish between 'new term' and 'existing term,' which obscures intent. The variable names are generic ('last', 'i', 'j'), and the magic number 1000 appears multiple times without a named constant. The comments are helpful but repetitive. Nesting is shallow, and action granularity is mostly one operation per line, but the logic for determining the next term is packed into the loop-and-check pattern. The reading flow is mostly natural, but the 'find last occurrence' loop requires mental backtracking to understand the j < 0 condition. Overall, the code is understandable but could be improved with a helper method and clearer naming.
Run 2
The code is generally readable due to its simple structure, clear variable names, and straightforward logic. It uses flat nesting with only one inner loop and one conditional, which helps maintain clarity. The intent is explained through comments, though some comments are repetitive. Each line performs a single action, and the overall length is appropriate for the task. However, readability could improve by extracting the inner search into a helper method and using a constant for the sequence length. The loop structure is logical, but the index manipulation (i - j - 1) is slightly non-obvious without explanation. Overall, the code is easy to follow for a beginner, but a few refactors would enhance clarity.
Run 3
The code is generally readable with a clear structure. The main method is logically organized, and comments explain the algorithm's key steps. Nesting is moderate, with only a nested for loop and if-else block. Intent is mostly clear, though the variable name 'j' and the expression 'i - j - 1' could be more descriptive. Code length is reasonable, not overly verbose. Each line performs one action, aiding comprehension. Reading flow is natural, progressing through sequence generation. However, the repeated comment 'If last term is new then next term is zero' appears twice, which is slightly redundant. The inner loop's purpose (finding last occurrence) is clear, but the break condition and subsequent if check could be consolidated for clarity. Overall, it's readable but minor improvements in variable naming and comment consistency could enhance understanding.
Run 1
Code Structure: Logically organized into initialization, sequence generation, and output, though generation and printing share main. Nesting: Moderate nesting from the backward-search loop and conditional; manageable for this short algorithm. Clarity of intent: The class name, vanEck array, and comments explain the purpose, but i and j require tracing, and the repeated comment before the outer loop describes only part of its behavior. Code length: Concise without unnecessary abstraction; explicit initialization to zero is redundant but documents the first term. Action granularity: Statements generally perform one action per line. Reading flow: Natural progression from the first term to finding a previous occurrence and calculating the next term. A named constant instead of repeated 1000 and a separate generation method would improve readability.
Run 2
Code Structure: Logically organized into initialization, sequence generation, backward search, and output, though all logic resides in main. Nesting: Moderate nesting from two loops and conditionals, but short blocks keep it manageable. Clarity of intent: The class name, vanEck array, and comments communicate the purpose; index names i and j and the distance calculation require some interpretation. Code length: Concise overall, with minor redundancy in explicit zero initialization and a repeated comment. Action granularity: Statements generally perform one action per line. Reading flow: Execution proceeds naturally from the first term to subsequent terms, with consistent formatting and useful spacing. A named constant for 1000 and a helper method for sequence generation would improve readability.
Run 3
Code Structure: Initialization, sequence generation, and output are logically organized, though all logic resides in main. Nesting: The nested search loop and conditional add moderate depth but remain easy to follow. Clarity of intent: The class name, vanEck variable, and comments explain the purpose; i and j are conventional but the distance calculation could use clarification. Code length: Concise overall, with a redundant zero initialization and repeated comment. Action granularity: Statements generally perform one action per line, making operations easy to distinguish. Reading flow: Consistent indentation and spacing support a natural progression from initialization through lookup, calculation, and printing. Replacing the repeated 1000 with a named constant or array length would improve maintainability and readability.