Sample
int-aa949608cc02-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.511 | 0–1; higher is more readable |
| Dorn | 0.314 | 0–1; higher is more readable |
| Mi | 0.467 | 0–1; higher is more readable |
| LLOC | 38 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.505 | 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. | 3763.655 | −124.201 |
| Source linesThe number of non-empty source lines. | 107 | +42.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.934 | −7.402 |
Intercept 8.87 + feature contributions = -79.932 (log-odds).
Score = sigmoid(-79.932) = 0.
| Score | 0.511 |
|---|
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. | 108 | −2.788 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 91 | +2.41 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 91 | −1.667 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 106.841 | +1.084 |
| 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. | 111.981 | −1.078 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 110.907 | +0.985 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.076 | +0.203 |
Intercept 0.07 + feature contributions = -0.781 (log-odds).
Score = sigmoid(-0.781) = 0.314.
| Score | 0.467 |
|---|
| Score | 38 |
|---|
Run 1
The code is well-structured with clear separation of concerns and straightforward logic. The class has a cohesive purpose as an adapter between two key generator types. Nesting is minimal - only one conditional branch in generate() and a simple if/else in doGenerate(). Clarity of intent is strong with descriptive method names and meaningful validation messages. The Javadoc comments explain the design rationale for both constructors. Code length is appropriate - no unnecessary verbosity while maintaining readability. Action granularity is mostly good, though some lines combine multiple operations (e.g., method chain calls). The reading flow is natural: validate input, retrieve operation, create context, delegate to appropriate generator. Minor deductions: the varargs handling logic in doGenerate() could use extraction for better clarity, and the null-check pattern with Assert.state() before returning keyGenerator in getTarget() is slightly redundant with the field being @Nullable. Overall, this is production-quality Spring framework code that balances conciseness with readability effectively.
Run 2
The code is well-structured with clear separation of concerns, appropriate constructors, and a clean delegation pattern. It maintains a flat structure with minimal nesting - only one level of if-else in generate() and doGenerate(). Variable and method names clearly express intent (e.g., createCacheKeyInvocationContext, doGenerate). The class is reasonably concise without unnecessary boilerplate. Each line performs a single logical action, and the reading flow follows a natural top-to-bottom progression. Minor deductions: the varargs handling condition could be extracted for clarity, and the unchecked cast requires a suppression annotation which slightly obscures intent. Overall, this is highly readable Java code that follows Spring framework conventions well.
Run 3
The code demonstrates excellent readability with a clear, logical structure: fields, constructors, public methods, then private helpers. Import organization and class-level documentation are well done. Nesting is minimal—the deepest level is two blocks in doGenerate and generate. Intent is clear from descriptive method/field names (e.g., getTarget, doGenerate, createCacheKeyInvocationContext) and inline comments that explain non-obvious varargs handling. Code is concise without unnecessary duplication. Action granularity is mostly one action per line, though a few lines combine method calls with control flow (e.g., the varargs check). Reading flow is natural, progressing from high-level public API to lower-level private helpers. Minor deductions: the unchecked cast in createCacheKeyInvocationContext requires a @SuppressWarnings annotation and slightly reduces clarity, and the else branch after the if in generate could be flattened by returning early, but these are minor concerns in an otherwise very clean implementation.
Run 1
Code Structure: Clearly organized fields, constructors, public methods, and focused private helpers separate responsibilities. Nesting: Mostly flat, with early validation and only a loop containing a simple conditional. Clarity of intent: Descriptive names, documentation, and explicit assertions make the adapter's two delegation paths understandable; nullable alternative fields and the unchecked cast add minor cognitive overhead. Code length: Appropriately concise, though constructor validation is duplicated and some branching could be simplified. Action granularity: Each statement performs one clear action, with no compressed multi-statement lines. Reading flow: Natural progression from initialization to delegation and parameter preparation; the multiline varargs condition and framework-specific types require slightly closer reading.
Run 2
Code Structure: Well-organized adapter with distinct constructors, delegation logic, parameter processing, and context creation. Nesting: Shallow overall; only the parameter loop contains an inner conditional. Clarity of intent: Descriptive names, documentation, and explicit assertions make the two generator modes clear. The nullable alternative fields, unchecked cast, and varargs handling require some additional interpretation. Code length: Appropriately concise, with minor duplication in constructor validation and generator checks. Action granularity: Statements generally perform one action per line; the compound varargs condition remains readable. Reading flow: Methods progress naturally from construction to target access, generation, and supporting helpers. Consistent formatting supports scanning, although long generic types and framework-specific abstractions slightly increase cognitive load.
Run 3
Code Structure: Well-organized adapter with distinct constructors, delegation logic, and focused helper methods. Nesting: Shallow overall; only parameter processing combines a loop with an if/else. Clarity of intent: Descriptive names, documentation, and explicit assertions clearly communicate the two generator modes, although mutually exclusive nullable fields and the unchecked cast add some cognitive overhead. Code length: Appropriately concise, with minor repetition in constructors and state checks. Action granularity: Statements generally perform one action per line; longer expressions remain understandable. Reading flow: Natural progression from initialization to target access, generation, and supporting helpers. The multiline varargs condition and generic types slightly slow reading, but consistent formatting and clear method boundaries maintain strong readability.