Sample
JetBrains/b55
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 3.4Δ 65.7 |
| Scalabrino | 0.39 | 0–1; higher is more readable | 21.2Δ 47.9 |
| Dorn | 0.106 | 0–1; higher is more readable | 7.6Δ 61.4 |
| Mi | 0.144 | 0–1; higher is more readable | 11.0Δ 58.1 |
| LLOC | 20 | Logical lines; fewer is more readable | 22.0Δ 47.0 |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs | 69.9Δ 0.8 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 46.2Δ 22.9 |
| BTTF | 0.45 | 0–1; higher is more readable | 42.4Δ 26.7 |
| Human | 0.84 | 0–1; original rating | 69.1 |
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. | 1699.704 | −56.09 |
| Source linesThe number of non-empty source lines. | 30 | +12 |
| 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.141 | −6.211 |
Intercept 8.87 + feature contributions = -41.431 (log-odds).
Score = sigmoid(-41.431) = 0.
| Score | 0.39 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.179 | −0.797 |
| 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. | 99.967 | −0.569 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 30 | −0.268 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 28 | +0.231 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 29 | +0.01 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 28.792 | −0.007 |
Intercept 0.07 + feature contributions = -2.134 (log-odds).
Score = sigmoid(-2.134) = 0.106.
| Score | 0.144 |
|---|
| Score | 20 |
|---|
Run 1
The code is generally well-structured and readable. The Levenshtein distance algorithm is implemented clearly, with initialization loops separated from the main dynamic programming loop. Nesting is limited to two levels, which is acceptable. Variable names are descriptive, and the intention of each loop is clear. Action granularity is good—each line performs one logical operation. The main method is concise. However, readability could improve by extracting the cost calculation into a helper method or a named variable, as the inline ternary and nested Math.min make the core line dense. Input validation for odd-length args is absent, but that is outside readability. Overall, the structure and flow are natural for this algorithm.
Run 2
The code is well-structured with clear separation of initialization and computation. The Levenshtein distance algorithm is implemented concisely without excessive nesting. Variable names like `distance`, `word1`, and `word2` are meaningful. Action granularity is mostly one action per line, though the innermost `Math.min` call combines several operations, which slightly reduces readability. The reading flow is logical: initialize base cases, compute matrix, return result. Minor weaknesses include lack of comments explaining the DP recurrence and the `main` method's loop which assumes an even number of arguments. Overall, the code is highly readable and maintainable for someone familiar with dynamic programming.
Run 3
The code is well-structured and readable. The class has a single responsibility, and the method names clearly indicate purpose. Matrix initialization is split into two straightforward loops, followed by a nested dynamic programming loop that remains shallow (only two levels). Action granularity is good—each line performs one logical step. The expression for the minimum of three values is slightly dense but still clear due to consistent indentation and use of Math.min. Reading flow is natural, progressing from initialization to computation to output. Minor drawbacks include the lack of a guard against odd-length argument arrays and the inline ternary operation, which could be extracted to a helper method for additional clarity.
Run 1
Code Structure: The distance calculation and command-line entry point are cleanly separated, with initialization, computation, and return logically organized. Nesting: Two nested loops are appropriate for the algorithm; there is no excessive branching. Clarity of intent: The class, method, and variable names convey purpose, but the compact recurrence requires familiarity with Levenshtein distance; named insertion, deletion, and substitution costs would clarify it. Code length: Concise without substantial redundancy. Action granularity: Most lines perform one action, although the distance assignment combines several calculations and a conditional expression. Reading flow: Execution follows a natural sequence, with consistent indentation and useful spacing. The long recurrence expression slightly interrupts readability, and the main method leaves its paired-argument assumption implicit.
Run 2
Code Structure: Clearly separates distance calculation from command-line execution, with initialization, computation, and return logically organized. Nesting: Two nested loops are appropriate for the algorithm; there is no excessive control-flow nesting. Clarity of intent: Class, method, and variable names communicate purpose, though the dense recurrence would be clearer with named insertion, deletion, and substitution costs. Code length: Compact without unnecessary boilerplate or repetition. Action granularity: Most lines perform one action, but the nested Math.min expression combines several calculations. Reading flow: Proceeds naturally from matrix setup to computation and output, with useful spacing. The command-line loop's assumption that arguments arrive in pairs is implicit rather than documented.
Run 3
Code Structure: Clearly separates distance calculation from command-line processing, with initialization, computation, and return logically organized. Nesting: Limited to two nested loops, appropriate for the algorithm. Clarity of intent: Class, method, and variable names communicate purpose, though the dense recurrence would benefit from named insertion, deletion, and substitution costs. Code length: Compact without substantial redundancy. Action granularity: Most lines perform one action; the nested Math.min expression combines several operations and is harder to scan. Reading flow: Natural progression from matrix setup to computation and output, supported by whitespace. The differing initialization loop bounds and implicit assumption that arguments arrive in pairs introduce minor reading friction.