Sample
int-988b576753b7-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.802 | 0–1; higher is more readable |
| Dorn | 0.564 | 0–1; higher is more readable |
| Mi | 0.544 | 0–1; higher is more readable |
| LLOC | 30 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18.33 | 0–20; mean of three runs |
| BTTF | 0.611 | 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. | 2492.64 | −82.257 |
| 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.855 | −7.283 |
Intercept 8.87 + feature contributions = -52.27 (log-odds).
Score = sigmoid(-52.27) = 0.
| Score | 0.802 |
|---|
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.875 | +0.581 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.09 | +0.063 |
| 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.972 | −0.019 |
Intercept 0.07 + feature contributions = 0.257 (log-odds).
Score = sigmoid(0.257) = 0.564.
| Score | 0.544 |
|---|
| Score | 30 |
|---|
Run 1
The code is well-structured and highly readable. It has a clear purpose, sensible organization with static initialization, and good use of named constants. The nested anonymous classes for FastThreadLocal are only one level deep, keeping nesting shallow. Each action is generally one per line, and the reading flow is logical. Comments explain the rationale for two separate keys, enhancing clarity. The only minor deductions are for the unnecessary parentheses around the SecretKeySpec argument and a slightly redundant length check in sign (since HMAC-SHA256 always produces 32 bytes, but the flexibility is justified if callers request shorter outputs). Overall, concise and maintainable.
Run 2
The code is well-structured with clear separation between key initialization, MAC creation, and signing logic. Nesting is minimal, with only one try-catch block and straightforward conditionals. Intent is explicitly documented through comments explaining the cryptographic decoupling of two keys. The class is concise, avoiding unnecessary length while maintaining clarity. Action granularity is generally one action per line, though some lines could be split for even better readability. Reading flow is natural: static fields, initialization, utilities, then public methods. Minor improvements could include extracting the catch block error handling or adding a comment for the outLength truncation logic, but overall the code demonstrates high readability with proper encapsulation and clear naming conventions.
Run 3
The code is well-structured with clear separation of concern (key management, Mac creation, signing logic). It maintains flat nesting and clean helpers. Naming conventions are descriptive (CID_KEY, TOKEN_KEY, signCid, signToken). The static initialization and FastThreadLocal usage are straightforward. Comments explain the cryptographic rationale for two separate keys. One minor issue is the blank line after try, which slightly disrupts the visual flow. Also, the unused import 'java.util.Arrays' is present, but it's actually used in sign() for copying. The sign() method is concise with clear action granularity. Overall, highly readable with good intent clarity.
Run 1
Code Structure: Well-organized constants, key initialization, thread-local instances, shared helpers, and purpose-specific entry points. Nesting: Shallow, with only simple anonymous classes, a try/catch, and one conditional. Clarity of intent: Descriptive names and a useful security comment clearly distinguish CID signing from token signing; however, consuming the input buffer and padding outputs beyond the digest length are not documented. Code length: Concise overall, with minor duplication in thread-local initialization and redundant parentheses. Action granularity: Each statement performs a single clear operation. Reading flow: Natural progression from configuration to implementation to entry points, slightly interrupted by an unnecessary blank line and minor formatting inconsistencies.
Run 2
Code Structure: Constants, key initialization, thread-local instances, helpers, and public-facing operations are logically grouped. Nesting: Shallow try/catch and a single conditional keep complexity low. Clarity of intent: Descriptive names and the key-separation comment clearly explain the purpose; however, sign consumes the input buffer and may truncate or pad output without documenting these behaviors. Code length: Concise overall, with minor duplication in the thread-local declarations. Action granularity: Each line generally performs one clear operation. Reading flow: Initialization leads naturally into shared helpers and signing entry points. Minor formatting issues, including an empty line inside try, redundant parentheses, and tight package/import spacing, slightly reduce polish.
Run 3
Code Structure: Constants, key initialization, thread-local MAC instances, shared helpers, and signing entry points are logically organized. Nesting: Shallow nesting is limited to initialization overrides, a try/catch, and one conditional. Clarity of intent: Descriptive names and the key-separation comment clearly explain the purpose; input buffer consumption and output truncation or padding are not explicitly documented. Code length: Compact, with shared helpers avoiding substantial duplication. Action granularity: Each statement performs a single clear operation. Reading flow: Natural progression from setup to implementation to public-facing package-level methods. Minor formatting distractions include an extra blank line, redundant parentheses around SecretKeySpec construction, and inconsistent spacing.