Sample
int-c67249f79d63-I13
Lower every eligible classic and enhanced for loop to a while loop
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.798 | 0–1; higher is more readable |
| Dorn | 0.568 | 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 | 17.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs |
| BTTF | 0.615 | 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. | 2518.573 | −83.113 |
| 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.858 | −7.288 |
Intercept 8.87 + feature contributions = -53.13 (log-odds).
Score = sigmoid(-53.13) = 0.
| Score | 0.798 |
|---|
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.089 | +0.08 |
| 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.274 (log-odds).
Score = sigmoid(0.274) = 0.568.
| Score | 0.548 |
|---|
| Score | 31 |
|---|
Run 1
The code is well-structured with clear separation of concerns: static keys, thread-local Mac instances, and signing logic are logically organized. Nesting is minimal—only one level in the try/catch block and anonymous FastThreadLocal implementations. Intent is clearly communicated through descriptive method names (signCid, signToken) and a helpful comment explaining the cryptographic rationale. Code length is appropriate; no unnecessary verbosity. Action granularity is excellent, with one logical action per line, especially in the sign method. Reading flow is natural: constants, initialization, factory method, core logic, then public API. Minor improvements could include extracting the anonymous FastThreadLocal classes into named static subclasses for slightly better readability, and the sign method's resizing logic could be marginally clearer. Overall, this is highly readable code.
Run 2
The code is highly readable with excellent structure and clear intent. It has a single-purpose class with well-named constants that explain the decoupling rationale in a comment. Static initialization is clean, and thread-local patterns are compact. Nesting is minimal, and each method performs one logical action. The only deductions are for minor verbosity in exception handling and slight redundancy in the sign method's byte array copy. Overall, the flow is natural and the code requires little cognitive effort to understand.
Run 3
The code is well-structured with clear separation of concerns: constants, static initialization, thread-local setup, helper methods, and public API. It remains flat with no nested control flow, making it easy to follow. The comment explaining why two keys are used adds valuable context without being verbose. Method names like `signCid` and `signToken` clearly convey intent, and the `newMac` helper avoids duplication. Each line performs a single logical action, improving readability. The only minor deductions are the slightly unclear interaction between `sign` and its caller regarding output length handling, and the anonymous `FastThreadLocal` subclasses add some boilerplate though they remain straightforward. Overall, the code is concise, purposeful, and maintainable.
Run 1
Code Structure: Logically organized into key initialization, thread-local MAC creation, shared signing logic, and purpose-specific entry points. Nesting: Shallow; anonymous classes and a simple try/catch add little complexity. Clarity of intent: Descriptive names and the key-separation comment clearly explain the design, though input buffer consumption and output resizing behavior are not documented. Code length: Concise, with shared helpers avoiding substantial duplication; the two thread-local definitions introduce minor repetition. Action granularity: Each statement performs a focused action, with no crowded multi-operation lines. Reading flow: Natural progression from configuration to implementation to public-facing package methods, supported by consistent spacing and formatting.
Run 2
Code Structure: Constants, key initialization, thread-local MAC instances, shared helpers, and signing entry points are logically organized. Nesting: Shallow nesting with only a try/catch and a simple conditional keeps the code easy to follow. Clarity of intent: Descriptive names and the explanatory comment clearly communicate the separation between CID and token signing. However, input buffer consumption and output truncation or zero-padding are implicit. Code length: Concise overall; the two similar thread-local declarations introduce minor but understandable duplication. Action granularity: Each statement performs a focused action, without compressed multi-action lines. Reading flow: Consistent formatting and straightforward delegation provide a natural progression from setup to implementation to public-facing operations.
Run 3
Code Structure: Constants, key initialization, thread-local MAC instances, helpers, and signing entry points are logically organized. Nesting: Shallow try/catch and a single conditional keep control flow easy to follow. Clarity of intent: Descriptive names and the cryptographic separation comment clearly explain the purpose; input buffer consumption and output truncation or padding are less explicit. Code length: Compact methods and shared helpers avoid unnecessary repetition, although the thread-local initializers have minor duplication. Action granularity: Each statement performs one clear operation. Reading flow: Consistent formatting and straightforward delegation make reading natural; brief documentation of signing side effects would improve it further.