Sample
Scalabrio45
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 40.7Δ 47.2 |
| Scalabrino | 0.816 | 0–1; higher is more readable | 85.9Δ 2.0 |
| Dorn | 0.693 | 0–1; higher is more readable | 78.9Δ 9.0 |
| Mi | 0.445 | 0–1; higher is more readable | 72.9Δ 15.1 |
| LLOC | 15 | Logical lines; fewer is more readable | 44.5Δ 43.5 |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs | 66.6Δ 21.4 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 83.7Δ 4.3 |
| BTTF | 0.737 | 0–1; higher is more readable | 95.5Δ 7.5 |
| Human | 4.33 | 1–5; original rating | 87.9 |
Views
Select the downloaded ZIP or its extracted folder. Files stay in your browser.
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. | 837.259 | −27.63 |
| Source linesThe number of non-empty source lines. | 20 | +8 |
| 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.687 | −7.03 |
Intercept 8.87 + feature contributions = -17.79 (log-odds).
Score = sigmoid(-17.79) = 0.
| Score | 0.816 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 1 | −0.703 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 78 | +0.454 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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. | 77.9 | +0.366 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 20 | +0.328 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 19 | −0.144 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.092 | +0.047 |
Intercept 0.07 + feature contributions = 0.816 (log-odds).
Score = sigmoid(0.816) = 0.693.
| Score | 0.445 |
|---|
| Score | 15 |
|---|
Run 1
The code is well-structured and readable. It uses a lazy initialization pattern with a clear null check, and each action is on its own line, improving clarity. However, it lacks modern Java practices like generics, which reduces type safety and clarity of intent. The method name 'getTypes' is slightly ambiguous without context. The code could be more concise using a static initializer or List.of, but the current approach is acceptable. Nesting is minimal, and the reading flow is natural.
Run 2
The code is generally readable with a clear lazy-initialization pattern. The method name 'getTypes' clearly indicates its purpose, and the Javadoc comment, though brief, supports understanding. The structure is logical: a null check guard, initialization block, and return statement. Nesting is minimal with only one if-block. However, several issues reduce readability: the method lacks an access modifier (package-private may be intentional but unclear), 'types' is a static mutable field returned directly, creating thread-safety and encapsulation concerns. The repeated 'types.addElement(new KnowledgeTypeNode(...))' lines are verbose and could be extracted into a helper method or constant list. Each statement is on a single line, maintaining good action granularity, but the repetitive pattern adds unnecessary length. The vector type is outdated and doesn't leverage generics. The reading flow is natural, moving from check to initialization to return, but the overall design could be more concise and modern.
Run 3
The method has a clear purpose and follows a simple, flat structure with minimal nesting. Each action is on its own line, which aids readability. However, it uses raw Vector and lacks generics, obscuring intent and type safety. The static mutable field pattern is risky and not immediately clear. The method name and Javadoc are vague ('types' of what?), reducing clarity. The repetitive addElement calls are somewhat verbose but acceptable. Overall, it is readable but could be improved with generics, a more descriptive name, and better documentation.
Run 1
Code Structure: Clearly organized into lazy initialization followed by returning the collection. Nesting: Only one conditional level, making the method easy to follow. Clarity of intent: The method name, comment, and descriptive constants clearly communicate its purpose; the raw Vector leaves the element type implicit in the signature. Code length: Short overall, though repeated construction and insertion statements are slightly verbose. Action granularity: Each statement performs one clear initialization or insertion action. Reading flow: Natural top-to-bottom progression, with consistent formatting and no distracting control flow.
Run 2
Code Structure: Clearly organized into lazy initialization followed by returning the cached collection. Nesting: Only one conditional level, making control flow easy to follow. Clarity of intent: The method name, documentation, and descriptive constants communicate its purpose, though the raw Vector leaves the element type implicit in the signature. Code length: Short and focused; repeated additions are somewhat verbose but straightforward. Action granularity: Each statement performs a single clear action on its own line. Reading flow: Initialization, population, and return occur in a natural sequence with consistent formatting.
Run 3
Code Structure: Logically organized into lazy initialization followed by returning the cached collection. Nesting: Only one conditional level, making control flow easy to follow. Clarity of intent: The method name, documentation, and descriptive constants clearly convey that it returns knowledge types, though the raw Vector obscures the element type in the signature. Code length: Short overall; the repeated additions are somewhat verbose but straightforward. Action granularity: Each statement performs one clear action on its own line. Reading flow: Natural top-to-bottom progression with consistent formatting and predictable initialization statements.