Sample
Schnappinger/diarymanagement/TBA.Messages.QueryMessage
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.992 | 0–1; higher is more readable | 90.6Δ 3.2 |
| Scalabrino | 0.908 | 0–1; higher is more readable | 91.1Δ 3.6 |
| Dorn | 0.419 | 0–1; higher is more readable | 56.8Δ 30.7 |
| Mi | 0.738 | 0–1; higher is more readable | 89.8Δ 2.3 |
| LLOC | 26 | Logical lines; fewer is more readable | 52.3Δ 35.1 |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs | 41.3Δ 46.2 |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs | 48.0Δ 39.4 |
| BTTF | 0.601 | 0–1; higher is more readable | 57.4Δ 30.0 |
| Human | 3.98 | 1–4; original rating | 87.5 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Source linesThe number of non-empty source lines. | 124 | +49.6 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 1417.446 | −46.776 |
| 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.607 | −6.91 |
Intercept 8.87 + feature contributions = 4.784 (log-odds).
Score = sigmoid(4.784) = 0.992.
| Score | 0.908 |
|---|
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. | 123 | −3.319 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 73 | +1.788 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 122.764 | +1.306 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 73 | −1.254 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 87.274 | +0.604 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.042 | +0.538 |
| 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. | 87.935 | −0.059 |
Intercept 0.07 + feature contributions = -0.326 (log-odds).
Score = sigmoid(-0.326) = 0.419.
| Score | 0.738 |
|---|
| Score | 26 |
|---|
Run 1
The code demonstrates moderate readability with clear documentation and logical organization. The class has a single responsibility (handling query headers), methods are well-documented, and the naming conventions follow Java standards. However, several issues reduce readability: method names violate Java conventions (Get/Set should be get/set), the code is unnecessarily verbose with redundant else branches and null checks, and the overall length could be reduced. The nesting is minimal and action granularity is acceptable. The templated comment at the top ('To change this template...') indicates leftover boilerplate. Empty constructor documentation adds noise. The reading flow is generally natural but disrupted by excessive comments that state the obvious. Overall, the code is functional and maintainable but would benefit from modern Java conventions and reduced verbosity.
Run 2
The code is generally well-structured with clear separation of methods and good documentation. It uses minimal nesting, mostly guard clauses for validation. Intent is clear through descriptive method names like Get/Set for message serialization/deserialization. Code length is appropriate, though some methods could be slightly more concise. Action granularity is good—one logical action per line. Reading flow is natural with consistent naming conventions. Minor deductions: the SetQueryType method's if-else could be simplified to a single guard clause for consistency with Get(), and the default template comment at the top adds noise. The queryTypeLen as int rather than constant is a slight style issue. Overall, highly readable code.
Run 3
The code is fairly readable: it has clear class structure, flat nesting, and descriptive method names like Get, Set, GetQueryType, and SetQueryType. JavaDoc comments explain intent well. Each method performs a focused action, and lines are generally short and purposeful. However, readability suffers from inconsistent naming conventions (Get/Set methods for message processing are vague), mixed responsibilities (null handling in SetQueryType is awkward), and the leftover auto-generated template comment at the top is distracting. Some logic, like the string formatting in Get, could be clearer. Overall, it is maintainable but would benefit from more explicit method names and cleaner boundary checks.
Run 1
Code Structure: Methods are logically separated into header serialization, parsing, and field access. Nesting: Shallow conditionals and early exceptions keep complexity low, although SetQueryType has an unnecessary else. Clarity of intent: Descriptive fields, exception messages, and documentation explain the purpose, but generic Get/Set names and unconventional Java capitalization reduce clarity. Code length: Implementation is short, but verbose Javadoc, template comments, redundant null initialization, and explicit conversions add clutter. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Consistent formatting and straightforward validation-to-processing sequences support natural reading; repeated comments, reassignment of message, and superclass dependencies introduce minor friction.
Run 2
Code Structure: Methods are logically separated into header serialization, parsing, and query-type access. Nesting: Shallow conditionals and early exceptions keep control flow simple, though the final else is unnecessary. Clarity of intent: Descriptive fields, exception messages, and documentation explain the purpose, but generic Get/Set names and nonstandard capitalization reduce immediate clarity. Code length: Implementation is compact, while verbose Javadoc, template comments, redundant initialization, and unnecessary substring arguments add clutter. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Consistent formatting and sequential validation and processing support natural reading, although repeated documentation markup and reassignment of input parameters slightly interrupt it.
Run 3
Code Structure: Well-organized class with distinct methods for serialization, parsing, and field access. Nesting: Shallow conditionals and early exceptions keep control flow simple; the final else is unnecessary. Clarity of intent: Documentation and descriptive fields explain the query-header purpose, although generic Get/Set names, unconventional capitalization, and the parameter Type reduce clarity. Code length: Methods are concise, but verbose Javadocs, template comments, redundant initialization, and unnecessary substring arguments add clutter. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Serialization and parsing proceed in a logical sequence with consistent formatting, though repeated documentation markup and minor typos interrupt reading.