Sample
int-bd550e2e6d2e-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.831 | 0–1; higher is more readable |
| Dorn | 0.808 | 0–1; higher is more readable |
| Mi | 0.578 | 0–1; higher is more readable |
| LLOC | 21 | 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.479 | 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. | 1547.365 | −51.063 |
| Source linesThe number of non-empty source lines. | 52 | +20.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.584 | −6.875 |
Intercept 8.87 + feature contributions = -28.268 (log-odds).
Score = sigmoid(-28.268) = 0.
| Score | 0.831 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 49 | +0.958 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 53 | −0.84 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 97 | +0.761 |
| 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. | 96.943 | −0.441 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 51.796 | +0.314 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.075 | +0.216 |
Intercept 0.07 + feature contributions = 1.435 (log-odds).
Score = sigmoid(1.435) = 0.808.
| Score | 0.578 |
|---|
| Score | 21 |
|---|
Run 1
The code is highly readable with clear structure, logical organization, and minimal nesting. The class purpose is documented, and methods are concise with single responsibilities. Variable names are descriptive (e.g., firstException, ignore) and the logic flows naturally. The only slight complexity is the ternary conditional for constructing FaultHandlerException, but it remains understandable. Overall, excellent readability.
Run 2
The code is well-structured with clear class responsibilities and appropriate synchronization. Nesting is minimal, with only one if-else branch and a ternary operator. Method names clearly convey intent (e.g., maybeRethrowFirstException, setIgnore). The class is concise, avoiding unnecessary verbose implementations. Action granularity is mostly one action per line, though the ternary operator for exception creation condenses logic. Reading flow is natural—constructor, override method, then helper methods. The Javadoc improves understanding. Minor deductions for the slightly complex ternary expression and inconsistent formatting around the ternary operator.
Run 3
The code is generally clear and well-structured. The class has a single responsibility as a mock fault handler for tests, with a logical organization of fields, constructor, and methods. Nesting is minimal, with only a couple of ternary expressions and an if-else block. Intent is mostly clear, though the 'ignore' flag could benefit from a brief comment explaining its purpose. Code length is appropriate—concise without being overly terse. Action granularity is good, with one main action per line except for the ternary expressions, which are still readable. Reading flow is natural: the handler logic flows from logging to exception creation to state tracking. Minor issues include the slightly complex ternary expression for exception creation and the 'ignore' field lacking explanation. Overall, the code is highly readable for its purpose.
Run 1
Code Structure: Fields, constructor, fault handling, and accessor methods are logically organized with clear responsibilities. Nesting: Shallow conditionals keep the code easy to follow. Clarity of intent: Descriptive method names and the class documentation clearly communicate first-fault capture and optional rethrowing; the generic local name 'e' and 'ignore' flag are slightly less explicit. Code length: Compact and appropriate, with only minor repetition in logging and exception construction. Action granularity: Statements generally perform one action per line, although the multiline ternary combines selection, message assembly, and construction. Reading flow: Execution proceeds naturally from logging to exception creation, storage, and return; the ternary and concatenated message slightly interrupt scanning.
Run 2
Code Structure: Fields, constructor, fault handling, and accessor methods are logically organized. Nesting: Shallow conditionals keep control flow easy to follow. Clarity of intent: Descriptive names and the class documentation clearly explain first-fault storage and optional rethrowing, though the meaning of ignore could be more explicit. Code length: Compact and appropriately sized, with only minor repetition in logging and exception construction. Action granularity: Each statement performs a distinct action; the multiline ternary is slightly harder to scan than the surrounding code. Reading flow: The progression from logging to exception creation, storage, and return is natural, followed by simple supporting methods. Overall, highly readable with small opportunities to clarify the ignore flag and simplify exception construction.
Run 3
Code Structure: Well-organized class with fields, constructor, and focused methods. Nesting: Shallow conditionals keep control flow easy to follow. Clarity of intent: Descriptive method names and the class documentation clearly explain first-fault storage and optional rethrowing; the local variable 'e' and field 'ignore' could be more specific. Code length: Concise overall, though null checks and exception-message construction introduce minor repetition. Action granularity: Statements generally perform one action each, with no compressed multi-statement lines. Reading flow: Methods follow a natural progression from handling faults to inspecting or rethrowing them and configuring behavior. The multiline ternary and concatenated exception message slightly interrupt otherwise smooth reading.