Sample
int-dab7eb7bd438-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.802 | 0–1; higher is more readable |
| Dorn | 0.549 | 0–1; higher is more readable |
| Mi | 0.548 | 0–1; higher is more readable |
| LLOC | 36 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 9.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.445 | 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. | 2739.235 | −90.395 |
| Source linesThe number of non-empty source lines. | 80 | +32 |
| 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.282 |
Intercept 8.87 + feature contributions = -56.807 (log-odds).
Score = sigmoid(-56.807) = 0.
| Score | 0.802 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 77 | +1.926 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 81 | −1.832 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 77 | −1.346 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 79.795 | +0.706 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.975 | +0.599 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.088 | +0.09 |
| 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.926 | −0.017 |
Intercept 0.07 + feature contributions = 0.196 (log-odds).
Score = sigmoid(0.196) = 0.549.
| Score | 0.548 |
|---|
| Score | 36 |
|---|
Run 1
The code is severely compromised by an unrelated block of code injected into the 'sign' method, which computes the lower temperature from two integers. This breaks logical structure, clarity of intent, and reading flow. The method now performs multiple unrelated actions (signing and temperature calculation), violating action granularity. The nesting is moderate, but the dead code creates confusion and ambiguity. The otherwise straightforward Hmac signing logic is overshadowed by this erroneous insertion, making the code unreadable and unreliable. The injected block also introduces unused variables, adding noise. Overall, the code fails to meet readability criteria due to this critical flaw.
Run 2
The code has good intentions with comments and separation but fails in execution. The critical issue is a completely unrelated block of code inside the sign() method that calculates lowerTemperature - this breaks action granularity and reading flow completely. Without this block, the code would score around 16: flat structure, clear method names, good constants, reasonable length. But the foreign code block destroys clarity of intent and structure. Other minor issues: thread-local initialization could be more concise; the comment explaining cryptographic decoupling is valuable but adds length. Overall the accidental insertion makes the code confusing and unreadable despite good underlying organization.
Run 3
The code has generally clear organization with a single class handling Hmac operations, and the use of comments explaining the two-key decoupling is helpful. However, several issues hurt readability. The most notable problem is a block of unrelated code (temperature variables and comparison logic) inserted in the middle of the `sign` method, which serves no purpose and disrupts flow. Nesting is minimal, and action granularity is mostly one action per line, aiding comprehension. The method names (`signCid`, `signToken`, `newMac`) are descriptive, making intent mostly clear. The code length is reasonable for the functionality. The static initialization block for keys is straightforward, but the coupling of thread-local macros and key initialization could be slightly more explicit. Overall, the structure is decent, but that stray code block definitely impacts readability.
Run 1
Code Structure: Constants, initialization, helpers, and signing entry points are logically organized, but the unrelated temperature block disrupts the signing method. Nesting: Generally shallow; the redundant block and conditional add unnecessary nesting. Clarity of intent: Descriptive names and the key-separation comment explain the cryptographic purpose well, while the unused temperature calculation is confusing. Code length: Mostly concise, with reasonable helper extraction, but the temperature code adds needless length. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: The main flow from initialization to signing is natural, but inconsistent indentation and irrelevant logic interrupt it.
Run 2
Code Structure: The class logically separates key initialization, MAC creation, signing, and public-facing helpers, but an unrelated temperature block disrupts the signing method. Nesting: Mostly shallow; the extraneous block adds unnecessary nesting. Clarity of intent: Descriptive names and a useful cryptographic comment clarify the main purpose, while the unused temperature calculation is confusing. Code length: Generally concise, with modest duplication between thread-local initializers; the temperature code adds needless length. Action granularity: Statements consistently perform one action per line. Reading flow: The main implementation reads naturally, but inconsistent indentation and irrelevant logic abruptly interrupt the signing sequence.
Run 3
Code Structure: The class is logically organized into constants, initialization, MAC creation, shared signing, and purpose-specific wrappers, but an unrelated temperature block disrupts the signing method. Nesting: Generally shallow, with modest nesting in initialization and exception handling; the extraneous block adds needless nesting. Clarity of intent: Descriptive names and the key-separation comment make cryptographic intent clear, while unused temperature calculations are confusing. Code length: Mostly concise, with sensible reuse through helper methods, but the temperature block adds unnecessary length. Action granularity: Statements generally perform one action per line. Reading flow: The main flow is natural and consistent until the poorly indented, unrelated block interrupts it; removing that block would substantially improve readability.