Sample
int-cc1a6009be26-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.509 | 0–1; higher is more readable |
| Dorn | 0.308 | 0–1; higher is more readable |
| Mi | 0.305 | 0–1; higher is more readable |
| LLOC | 84 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.415 | 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. | 5373.21 | −177.316 |
| Source linesThe number of non-empty source lines. | 133 | +53.2 |
| 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.646 | −6.969 |
Intercept 8.87 + feature contributions = -122.215 (log-odds).
Score = sigmoid(-122.215) = 0.
| Score | 0.509 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 134 | −3.708 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 121 | +3.448 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 121 | −2.356 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 132.892 | +1.448 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 100.948 | +0.824 |
| 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. | 100.978 | −0.612 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.089 | +0.074 |
Intercept 0.07 + feature contributions = -0.811 (log-odds).
Score = sigmoid(-0.811) = 0.308.
| Score | 0.305 |
|---|
| Score | 84 |
|---|
Run 1
The code is generally well-structured, with clear naming, constants, and logical separation of initialization, hashing, and round logic. The constructor validates inputs and sets up state cleanly. The sipround() method is concise and follows the algorithm directly. However, the macHash method has moderate complexity: the final partial-block switch statement uses fall-through cases, which can be harder to read, and offset calculations like `position + len + 6` reduce clarity. The loop is flat but involves multiple responsibilities (endianness handling, state update). Overall, the code is readable but could be improved with a helper method for reading the final bytes and a clearer comment for the fall-through logic.
Run 2
The code has a clear structure with logical separation of constants, fields, constructor, and methods. Overall nesting is shallow, with the exception of the switch statement fall-through in macHash which is a bit unusual. Intent is mostly clear: this is a SipHash implementation with proper state initialization and message processing. However, readability suffers in the message-tail parsing block, where the fall-through switch cases and bit-shifting logic are dense and could use helper methods. Variable names like v0-v3, k0, k1, and b are acceptable in a cryptographic context but would benefit from comments. Action granularity is generally good—one operation per line in the sipround method—but the tail parsing section packs multiple operations per line. Reading flow is natural for an algorithm implementation but disrupted by the compact switch block. Concise but not overly long, the code would improve with extracted methods for state reset and message tail handling.
Run 3
The code is well-structured with clear separation of concerns: constants, state initialization, main hashing logic, and a helper round function. Nesting is minimal, limited to a switch statement and small loops. Intent is generally clear due to descriptive variable names and comments referencing the SipHash paper. Code length is appropriate, though the switch statement for tail bytes is somewhat verbose. Action granularity is mostly one action per line, but the switch cases pack multiple operations onto single lines. Reading flow is natural overall, but the tail-byte section is less readable due to fall-through cases and magic numbers. Minor improvements could include extracting the tail-processing into a helper method and adding comments explaining the bit-shift constants. Overall, the code is highly readable, with only small areas where clarity could be enhanced.
Run 1
Code Structure: Constants, initialization, hashing, and round operations are logically separated. Nesting: Mostly shallow, with only a nested compression loop and byte-order condition. Clarity of intent: Descriptive configuration names and specification references help, but abbreviated state variables, unexplained rotation constants, and unannotated switch fall-through require algorithm knowledge. Code length: Reasonably concise for SipHash; repeated state assignments and round loops are straightforward rather than excessive. Action granularity: Each statement generally performs one operation, making state changes easy to trace. Reading flow: Initialization, block processing, remainder handling, and finalization follow a natural sequence. However, the distinction between absolute position and relative length in the block-loop bound is confusing, and the dense remainder-packing switch interrupts otherwise clear flow.
Run 2
Code Structure: Constants, initialization, hashing, and round operations are logically separated, though mutable instance state makes dependencies less explicit. Nesting: Mostly shallow, with only a conditional and compression loop inside the main loop. Clarity of intent: Descriptive configuration names, specification references, and endian comments help; terse state variables are conventional for SipHash but require algorithm knowledge. The undocumented switch fall-through and subtle position/length arithmetic hinder understanding. Code length: Reasonably concise for a cryptographic implementation; repetitive tail-byte handling reflects the algorithm rather than unnecessary verbosity. Action granularity: Statements generally perform one operation per line, making state transformations easy to trace. Reading flow: Initialization, block processing, tail handling, and finalization follow a natural sequence, with whitespace separating stages. Additional comments explaining fall-through, byte packing, and index boundaries would improve readability.
Run 3
Code Structure: Constants, initialization, hashing, and round operations are logically separated, although mutable shared state makes dependencies less explicit. Nesting: Mostly shallow, with only a small conditional and compression loop inside the main loop. Clarity of intent: Descriptive configuration names, comments, and the specification link clarify the purpose; terse state variables, magic rotation values, and undocumented switch fall-through require algorithm knowledge. Code length: Reasonably concise for a cryptographic implementation, though repeated compression loops and tail-byte handling add verbosity. Action granularity: Statements generally perform one action per line, making state updates easy to follow. Reading flow: Initialization, block processing, tail handling, and finalization follow a natural sequence. However, the distinction between absolute buffer positions and relative lengths is difficult to track, and the fall-through switch interrupts straightforward reading.