Sample
int-369b82e1ef98-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.672 | 0–1; higher is more readable |
| Dorn | 0.226 | 0–1; higher is more readable |
| Mi | 0.256 | 0–1; higher is more readable |
| LLOC | 25 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 13.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.324 | 0–1; higher is more readable |
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. | 2270.2 | −74.917 |
| Source linesThe number of non-empty source lines. | 69 | +27.6 |
| 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.705 | −7.057 |
Intercept 8.87 + feature contributions = -45.504 (log-odds).
Score = sigmoid(-45.504) = 0.
| Score | 0.672 |
|---|
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. | 150 | −2.688 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 150 | +1.616 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 67 | −1.336 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 57 | +1.234 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 57 | −0.887 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 68.808 | +0.552 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.075 | +0.209 |
Intercept 0.07 + feature contributions = -1.23 (log-odds).
Score = sigmoid(-1.23) = 0.226.
| Score | 0.256 |
|---|
| Score | 25 |
|---|
Run 1
The code demonstrates clear structure and purpose, with good use of Javadoc and consistent formatting. The class hierarchy and imports are logical. Nesting is minimal - only one level in tryComplete(), which is good. Intent is evident through descriptive naming and documentation. The code is concise overall, though onComplete() is slightly longer than ideal for a single method. Action granularity is mixed: the stream pipelines are well-structured, but there are some long lines exceeding typical style guidelines. Reading flow is natural and the logic is straightforward. Issues preventing a higher score: 1) Unused timeoutMs field is stored redundantly since it's already in DelayedOperation; 2) The accidental insertion of an unrelated code block calculating averageScore in onComplete() severely impacts readability and appears to be an error; 3) Mixing stream operations with imperative forEach could be more consistent; 4) The trace logging is verbose. These minor issues slightly disrupt the otherwise clean implementation.
Run 2
The code has a clear overall structure with logical separation of methods and reasonable Javadoc comments explaining intent. However, there is a significant readability issue: an extraneous block of unrelated code (calculating an average score) appears inside the onComplete() method, which breaks reading flow and confuses intent. The main logic is mostly flat and concise, with one action per line in key sections, but the onComplete() line combining filtering, logging, and a long exception message is somewhat dense. The tryComplete() method is clear with good trace logging, and the streaming approach is reasonable. The onExpiration() method is appropriately minimal, though its comment is slightly redundant. Overall, the code is understandable but would be notably improved by removing the accidental block and possibly extracting the pending future timeout logic into a helper method for better action granularity.
Run 3
The code has clear intent with meaningful method names and Javadoc comments explaining purpose. However, several issues hurt readability. There are misplaced lines that appear to be debugging leftovers: 'log.trace()' and 'log.debug()' are on separate lines after variables, creating confusing formatting. An orphaned line reading 'log.trace("Trying to complete operation for {} futures", futures.size());' appears mid-class with improper indentation. The class javadoc says 'using CompletionFutures' but that phrasing is awkward. Method logic is straightforward but the logging statements are misaligned, breaking reading flow. The 'onExpiration' method contains only a comment, making it feel incomplete despite being intentional. Nesting is shallow with clear structure, but the inconsistent formatting and stray code fragments significantly reduce overall readability.
Run 1
Code Structure: Fields, constructor, and lifecycle methods are logically organized, but the unrelated score-calculation block inside onComplete disrupts cohesion. Nesting: Mostly shallow; the extra block and unnecessary else add minor complexity. Clarity of intent: Descriptive names, comments, and logging explain future completion and timeout handling, while unused scoring variables introduce ambiguity. Code length: Generally concise, though the scoring block and duplicated expiration explanation are unnecessary. Action granularity: Most statements perform one clear action; the long exceptional-completion lambda combines iteration, exception construction, and completion in one line. Reading flow: Method order is natural, but inconsistent indentation in the inserted block and lengthy stream expressions interrupt otherwise smooth reading.
Run 2
Code Structure: Fields, constructor, and lifecycle methods are logically organized, but the unrelated score-calculation block in onComplete disrupts cohesion. Nesting: Mostly flat, with a simple conditional and one unnecessary nested block. Clarity of intent: Descriptive names, documentation, and logging explain future completion and timeout handling; the unused scoring variables introduce ambiguity. Code length: Generally concise, though the scoring block and repeated expiration explanation are unnecessary. Action granularity: Most statements perform one action per line, but the long forEach lambda combines iteration, exception construction, and exceptional completion. Reading flow: Lifecycle methods follow a natural sequence, but inconsistent indentation in the inserted block and long stream expressions interrupt scanning.
Run 3
Code Structure: Fields, constructor, and lifecycle methods are logically organized, but an unrelated average-score calculation disrupts onComplete(). Nesting: Generally shallow; the unnecessary calculation block adds avoidable nesting. Clarity of intent: Descriptive names, documentation, and logging explain future completion and timeout handling, while the unused scoring variables introduce ambiguity. Code length: Mostly concise, though the extraneous block and repeated expiration explanation add noise. Action granularity: Statements generally perform one action per line; stream expressions are understandable, but the long exceptional-completion lambda is harder to scan. Reading flow: Method ordering is natural, but inconsistent indentation in the inserted block and several long lines interrupt an otherwise straightforward flow.