Sample
Schnappinger/diarymanagement/TBA.Messages.ResponseMessage
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.019 | 0–1; higher is more readable | 71.9Δ 39.6 |
| Scalabrino | 0.908 | 0–1; higher is more readable | 91.8Δ 59.4 |
| Dorn | 0.192 | 0–1; higher is more readable | 40.6Δ 8.3 |
| Mi | 0.731 | 0–1; higher is more readable | 87.5Δ 55.1 |
| LLOC | 42 | Logical lines; fewer is more readable | 42.1Δ 9.7 |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs | 32.3Δ 0.0 |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs | 38.9Δ 6.6 |
| BTTF | 0.458 | 0–1; higher is more readable | 40.6Δ 8.3 |
| Human | 3.17 | 1–4; original rating | 32.3 |
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. | 2389.133 | −78.841 |
| Source linesThe number of non-empty source lines. | 182 | +72.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.515 | −6.773 |
Intercept 8.87 + feature contributions = -3.944 (log-odds).
Score = sigmoid(-3.944) = 0.019.
| 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. | 180 | −5.337 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 113 | +3.171 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 113 | −2.172 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 180.784 | +2.117 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 100.978 | +0.825 |
| 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. | 100.94 | −0.61 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.046 | +0.5 |
Intercept 0.07 + feature contributions = -1.436 (log-odds).
Score = sigmoid(-1.436) = 0.192.
| Score | 0.731 |
|---|
| Score | 42 |
|---|
Run 1
The code demonstrates a reasonable structure with clear class responsibilities and method separation, earning it moderate points for organization. It is relatively flat with minimal nesting, though the try-catch and conditional blocks add some minor depth. Variable names like 'errorCode' and 'errorMessage' clarify intent, but the logic around message construction and parsing in Set() is somewhat ambiguous (e.g., the delimiter logic and error handling). The code length is appropriate given the protocol complexity, but repetitive null checks and verbose comments slightly inflate it. Action granularity is mostly one action per line, but some lines combine operations and formatting. The reading flow is natural in most methods, but Set() jumps between parsing, error handling, and delimiter logic, making it harder to follow. Overall, the code is readable but could benefit from clearer parsing logic and reduced verbosity.
Run 2
The code is generally well-structured with clear separation of methods and Javadoc comments explaining each method's purpose. Naming conventions are followed, and each method performs a single logical action. However, readability is hampered by inconsistent formatting (inconsistent brace styles), lengthy method comments that add clutter, and a few awkward constructions like `String.format("%0" + Integer.toString(errorCodeLen) + "x", errorCode)`. The class is relatively flat with minimal nesting, though some logic could be extracted into helper methods. Variable names like `Code` and `Message` violate Java naming conventions. Error handling with exceptions is clear, but the use of `errorCode` as an integer with magic values (`-1`, `>0`) could be more explicit. Overall, readable but not exemplary.
Run 3
The code has clear documentation and generally follows single-action-per-line principles, but it suffers from readability issues. The structure is logical but there are logic flaws that obscure intent: in Get(), if errorCode > 0 and errorMessage is null, it concatenates 'null|' into the message; in Set(), when errorCode > 0, it calls indexOf("|") and substring without checking if the delimiter exists, risking StringIndexOutOfBoundsException. Nesting is moderate but acceptable. Methods are concise, though Set() and Get() mix parsing, validation, and message assembly. The default constructor is unnecessary and includes boilerplate template comments. Error codes are limited to 1 hex digit (0–15) but this is unclear without reading documentation. Naming is mostly clear, but 'Get' and 'Set' are vague for their complex behavior. Reading flow is hindered by scattered exception handling and ambiguous state assumptions (e.g., errorMessage defaults to null). Overall, readable enough for a small, documented class, but logic flaws and naming ambiguities reduce clarity.
Run 1
Code Structure: Methods are logically separated into header serialization, parsing, and field access, with consistent formatting. Nesting: Mostly flat conditionals and a simple try/catch make control flow easy to follow; redundant else branches could be removed. Clarity of intent: Descriptive fields and documentation explain the protocol, but generic Get/Set names, unconventional capitalization, and magic values reduce precision. Code length: Implementation is reasonably concise, though repetitive Javadoc, template comments, unnecessary initialization, and verbose substring calls add clutter. Action granularity: Statements generally perform one action per line; the formatting expression is somewhat dense. Reading flow: Validation precedes processing, and methods follow a predictable order. Reassigning input parameters and relying on implicit state and delimiter assumptions introduce some mental overhead.
Run 2
Code Structure: Well-organized class with separate serialization, parsing, and accessor methods. Nesting: Shallow conditionals and a straightforward try/catch make control flow easy to follow. Clarity of intent: Documentation explains the protocol and fields, but generic Get/Set names, unconventional capitalization, and magic values obscure some meaning. Code length: Methods are concise, although excessive Javadoc boilerplate, redundant initializations, and unnecessary else branches add clutter. Action granularity: Statements generally perform one action per line; formatting and concatenation combine several operations in one expression but remain manageable. Reading flow: Consistent indentation and sequential validation support natural reading, while parameter reassignment and reliance on superclass behavior require extra attention.
Run 3
Code Structure: Well-organized class with distinct serialization, parsing, and accessor methods. Nesting: Shallow conditionals and a straightforward try/catch keep control flow easy to follow. Clarity of intent: Descriptive fields and documentation explain the response format, but generic Get/Set names, unconventional capitalization, and implicit sentinel and delimiter conventions reduce clarity. Code length: Implementation is reasonably concise, though verbose Javadoc, obsolete template comments, redundant initialization, and unnecessary else blocks add clutter. Action granularity: Statements generally perform one action per line; formatting and substring expressions are manageable. Reading flow: Consistent layout and sequential validation support natural reading, although parameter reassignment and inherited message-processing calls require tracking state and consulting the superclass.