Sample
int-bd721fa2d8d8-I13
Lower every eligible classic and enhanced for loop to a while loop
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.885 | 0–1; higher is more readable |
| Scalabrino | 0.825 | 0–1; higher is more readable |
| Dorn | 0.578 | 0–1; higher is more readable |
| Mi | 0.116 | 0–1; higher is more readable |
| LLOC | 5 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.726 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Source linesThe number of non-empty source lines. | 60 | +24 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 724.925 | −23.923 |
| 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.604 | −6.907 |
Intercept 8.87 + feature contributions = 2.041 (log-odds).
Score = sigmoid(2.041) = 0.885.
| Score | 0.825 |
|---|
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. | 123.967 | −1.586 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 121.951 | +1.163 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 61 | −1.123 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.021 | +0.734 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 59.864 | +0.427 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 28 | +0.231 |
Intercept 0.07 + feature contributions = 0.315 (log-odds).
Score = sigmoid(0.315) = 0.578.
| Score | 0.116 |
|---|
| Score | 5 |
|---|
Run 1
The code is highly readable. Structure is logical, with clear package, imports, and interface definition. Nesting is nonexistent; methods are flat and concise. Intent is well-documented with Javadoc explaining purpose, usage, and discovery mechanism. Code length is appropriate for an interface with clear contracts. Each method signature is on one line, maintaining action granularity. Reading flow is natural, progressing from class-level docs to method declarations. Minor deductions: a Javadoc line slightly exceeds 80 characters and the return type description in the validate() method contains a line break, slightly disrupting flow. Overall, it exemplifies clean API design.
Run 2
The code is a well-structured Java interface with clear purpose, following standard conventions. It uses a flat hierarchy with no nested blocks, making it easy to follow. Each method and annotation is clearly separated, and the Javadoc is thorough, explaining behavior and usage. The action granularity is appropriate—one logical action per declaration or annotation. The reading flow is natural, moving from interface declaration to method definitions. Minor deductions: the long Javadoc on the interface could be slightly condensed, and the package/import section is slightly dense but still standard. Overall, highly readable.
Run 3
The code is highly readable with clear structure and purpose. The interface is logically organized, with a single method declaration and two default method implementations. Javadoc is thorough and explains intent well. Nesting is minimal (only imports/package at top level). However, there are a few minor issues: the @return tag for validate() has a line-break issue causing poor alignment, and the interface inherits from three parent interfaces which adds slight complexity. The code length is appropriate for a policy interface, and action granularity is fine—each method serves a single purpose. The reading flow is natural, though the long Javadoc slightly interrupts the interface declaration flow.
Run 1
Code Structure: The interface is logically organized, with imports, interface-level documentation, and clearly separated method declarations. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive names and detailed Javadocs clearly explain the policy's purpose, validation behavior, and return contracts. Code length: The implementation is concise; documentation is somewhat verbose but provides useful API context. Action granularity: Each statement performs a single action, and the default methods are straightforward. Reading flow: The progression from policy validation to configuration and version metadata is natural. Minor readability issues include missing separation between the package and imports, extra blank lines before validate, long documentation lines, and an improperly formatted Javadoc continuation line in the return description.
Run 2
Code Structure: A logically organized interface with imports, class documentation, and clearly separated method declarations. Nesting: Minimal nesting; default methods contain only simple returns. Clarity of intent: Descriptive names and detailed Javadoc explain policy validation, configuration, and version reporting. Code length: Implementation is concise, though documentation is somewhat verbose and extra blank lines add minor clutter. Action granularity: Each statement occupies its own line, with one action per default method. Reading flow: The progression from interface purpose to validation and supporting metadata is natural. Minor distractions include ungrouped imports, inconsistent Javadoc continuation formatting, and the slightly ambiguous default version string "undefined".
Run 3
Code Structure: The interface is logically organized, with imports, interface documentation, validation, configuration, and version methods. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive names and detailed Javadoc clearly explain the policy contract, lifecycle, and return values. Code length: The implementation is concise, although documentation is somewhat verbose relative to the small interface. Action granularity: Each declaration and return statement occupies its own line. Reading flow: The progression from interface purpose to individual methods is natural. Minor readability issues include extra blank lines, inconsistent Javadoc continuation formatting, long documentation lines, and imports without grouping.