Sample
int-ff352f8d6e07-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.797 | 0–1; higher is more readable |
| Dorn | 0.562 | 0–1; higher is more readable |
| Mi | 0.548 | 0–1; higher is more readable |
| LLOC | 31 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 13.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.609 | 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. | 2583.358 | −85.251 |
| Source linesThe number of non-empty source lines. | 71 | +28.4 |
| 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.863 | −7.294 |
Intercept 8.87 + feature contributions = -55.275 (log-odds).
Score = sigmoid(-55.275) = 0.
| Score | 0.797 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 68 | +1.615 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 72 | −1.513 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 68 | −1.14 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.972 | +0.599 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 70.886 | +0.581 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.091 | +0.054 |
| 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. | 86.958 | −0.018 |
Intercept 0.07 + feature contributions = 0.249 (log-odds).
Score = sigmoid(0.249) = 0.562.
| Score | 0.548 |
|---|
| Score | 31 |
|---|
Run 1
The code demonstrates good structure with clear separation of concerns: constants, static initialization, thread-local setup, and public API. Nesting is minimal, and each method has a single responsibility. The comments explaining the dual-key design are helpful. However, readability is undermined by confusing conditional logic in the sign() method: `if (!((signBytes.length != outLength))) {} else { ... }` is unnecessarily convoluted - a simple `if (signBytes.length == outLength)` would be clearer. The empty if-block and double negation force readers to mentally parse logic that should be straightforward. Additionally, the empty constructor with comment adds little value, and the code length could be slightly reduced by consolidating the thread-local initialization patterns. The action granularity is generally good, with one operation per line, but the conditional structure breaks the natural reading flow.
Run 2
The code has a clear overall structure with separated sections for constants, static initialization, thread-local setups, and signing methods. However, readability is undermined by several issues: the conditional in the sign() method, 'if (!((signBytes.length != outLength))) {} else {...}', is convoluted and hard to understand. The static initializer creates implicit coupling between the keys and the Mac thread-locals, but this is not visually obvious. The code lacks whitespace between method definitions, and although comments explain the reason for two keys, the actual code flow in sign() is unnatural. Variable names are mostly clear, but the action granularity suffers because the sign() method performs reset, update, finalize, conditional copy, and wrap into ByteBuffer in a single method. The unusual empty if-block pattern significantly hurts the reading flow, which otherwise would be relatively flat and concise. Overall, the code is functional but has readability problems that would confuse maintainers.
Run 3
The code is generally readable with clear separation of concerns: constants, static initialization, thread-local setup, and signing methods are logically organized. Naming is descriptive and comments explain the cryptographic rationale. However, several issues reduce clarity. The conditional `if (!((signBytes.length != outLength))) {} else { signBytes = Arrays.copyOf(signBytes, outLength); }` is unnecessarily convoluted—a simple `if (signBytes.length != outLength)` would be clearer. The empty if-block with a double negative obscures intent. The `newMac` method has good error handling, but the static initialization of cryptographic keys using `SecureRandom` could benefit from a comment about thread-safety or lifecycle. The anonymous `FastThreadLocal` subclasses add minor nesting noise. Overall, the code is functional and maintainable but has awkward spots that detract from smooth reading flow and clarity of intent.
Run 1
Code Structure: Well organized into key initialization, thread-local MAC instances, a factory, and signing helpers. Nesting: Shallow overall, with straightforward initialization and exception handling. Clarity of intent: Descriptive names and the key-separation comment explain the design, but the double-negated length comparison and empty if branch obscure a simple resizing condition. Code length: Mostly concise; duplicated thread-local setup is modest, while the empty branch is unnecessary. Action granularity: Generally one action per line, though the compressed if/else combines control-flow elements awkwardly. Reading flow: Natural progression from configuration to implementation and public-facing helpers, interrupted mainly by the convoluted conditional in sign.
Run 2
Code Structure: Well organized into key initialization, thread-local MAC instances, a factory, and signing helpers. Nesting: Shallow overall, with straightforward exception handling; the empty if/else is awkward. Clarity of intent: Descriptive names and the key-separation comment explain the purpose well, but the double-negated length comparison obscures a simple condition. Code length: Mostly concise, with reasonable duplication for the two independent MAC instances. Action granularity: Generally one action per line, although the inline empty branch reduces readability. Reading flow: Natural progression from configuration to implementation to entry points, interrupted mainly by `if (!((signBytes.length != outLength))) {} else`, which should be a direct inequality check.
Run 3
Code Structure: Logically organized constants, key initialization, thread-local instances, and focused helper methods. Nesting: Shallow overall, with straightforward exception handling; the empty if branch and else unnecessarily complicate a simple condition. Clarity of intent: Descriptive names and a useful security comment clearly explain separate signing purposes, but the double-negated length comparison obscures intent. Code length: Concise overall, with reasonable duplication for the two independent MAC instances. Action granularity: Most lines contain one action; the inline empty branch is an awkward exception. Reading flow: Initialization naturally leads into MAC creation and signing methods, though the unusual conditional interrupts an otherwise smooth flow. Replacing it with 'if (signBytes.length != outLength)' would improve readability.