Sample
int-e6fc1021374e-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 1 | 0–1; higher is more readable |
| Scalabrino | 0.97 | 0–1; higher is more readable |
| Dorn | 0.686 | 0–1; higher is more readable |
| Mi | 0.835 | 0–1; higher is more readable |
| LLOC | 12 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.436 | 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. | 55 | +22 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 401.29 | −13.243 |
| 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.829 | −7.243 |
Intercept 8.87 + feature contributions = 10.384 (log-odds).
Score = sigmoid(10.384) = 1.
| Score | 0.97 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 56 | −0.946 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.041 | +0.542 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 82.946 | +0.534 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 33 | +0.404 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 54.917 | +0.358 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 33 | −0.336 |
| 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. | 82.839 | +0.156 |
Intercept 0.07 + feature contributions = 0.782 (log-odds).
Score = sigmoid(0.782) = 0.686.
| Score | 0.835 |
|---|
| Score | 12 |
|---|
Run 1
The code is a Spring interface with clear intent and good Javadoc, but it contains a critical structural flaw: an unmatched extra opening brace alongside a block of dead code calculating an average score. This breaks the logical organization, creates a syntax error, and disrupts the reading flow. While the interface methods themselves are flat and concise, the stray code block is unrelated and confusing. The nesting is technically broken due to the brace, and the dead code adds unnecessary length. Action granularity within methods is fine, but the overall structure is compromised. A developer would immediately stumble at the malformed section, making the file hard to read or trust despite otherwise clean parts.
Run 2
The code is generally well-structured and documented, but it contains a severe structural error: an extraneous code block with local variables (totalScore, numberOfScores, averageScore) is inserted inside the onRestart() method before the actual stop()/start() calls. This breaks logical organization, clarity of intent, and action granularity. The nesting is minimal, and the interface methods are concise with clear Javadoc, but the misplaced block makes the code ambiguous and unreadable. The reading flow is disrupted by this unrelated fragment. Without this error, the interface would score much higher due to its clean, flat structure and clear lifecycle method definitions.
Run 3
The code is generally readable but contains a critical structural error that significantly reduces its score. The `onRestart()` method has an unrelated code block inserted (`int totalScore = 240;` etc.) that is completely out of context, breaking the logical flow. The package structure and interface declaration are clear, and the Javadoc comments provide useful context for each method's purpose. However, the nesting depth is minimal and mostly flat, which is good. Each action (like `start()` and `stop()`) appears on separate lines, improving clarity. The method names (`onRefresh`, `onRestart`, `onPause`, `onClose`) clearly convey intent. Code length is concise with no unnecessary verbosity. The main issue is the random unrelated code block that would confuse any reader and likely cause compilation errors, bringing the score down significantly despite other positive aspects.
Run 1
Code Structure: The interface logically groups lifecycle callbacks, but onRestart contains an unrelated calculation block. Nesting: Mostly flat; the extra block introduces unnecessary nesting. Clarity of intent: Method names and Javadoc clearly explain lifecycle behavior, while the unused score calculation has no apparent purpose. Code length: The interface is concise overall, but the calculation adds unnecessary lines. Action granularity: Each statement performs one action, including separate stop and start calls. Reading flow: Consistent documentation and simple methods support natural reading, but the poorly indented calculation interrupts the restart sequence and breaks formatting consistency.
Run 2
Code Structure: The interface is logically organized around lifecycle events, but onRestart contains an unrelated calculation block. Nesting: Methods are mostly flat; the extra block adds unnecessary nesting. Clarity of intent: Descriptive method names and Javadoc clearly explain lifecycle behavior, while the unused scoring variables obscure onRestart's purpose. Code length: Generally concise, with three unnecessary variable declarations. Action granularity: Each statement performs one action, and stop/start sequencing is explicit. Reading flow: Consistent documentation and simple methods support natural reading, but the calculation block's inconsistent indentation and irrelevant content interrupt the flow.
Run 3
Code Structure: The interface is logically organized into documented lifecycle callbacks, but an unrelated calculation block disrupts onRestart(). Nesting: Mostly flat, with one unnecessary nested block. Clarity of intent: Method names and Javadoc clearly explain lifecycle behavior; unused scoring variables have no apparent connection to it. Code length: Concise overall, though the calculation adds unnecessary lines. Action granularity: Each declaration and lifecycle call occupies its own line, making operations easy to distinguish. Reading flow: Callback ordering and consistent documentation support natural reading, but the calculation block's inconsistent indentation and irrelevant content interrupt that flow.