Sample
int-c12c7e608374-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.534 | 0–1; higher is more readable |
| Dorn | 0.31 | 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 | 14.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.27 | 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. | 5593.249 | −184.577 |
| 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.679 | −7.018 |
Intercept 8.87 + feature contributions = -129.525 (log-odds).
Score = sigmoid(-129.525) = 0.
| Score | 0.534 |
|---|
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.941 | +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.985 | −0.612 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.088 | +0.087 |
Intercept 0.07 + feature contributions = -0.798 (log-odds).
Score = sigmoid(-0.798) = 0.31.
| Score | 0.305 |
|---|
| Score | 84 |
|---|
Run 1
The code is well-structured and readable for a cryptographic implementation. It uses clear naming conventions (INITIAL_STATE_V0, compressionRounds), logical organization with constants separated from state variables, and follows a natural flow from initialization to finalization. The constructor validates inputs properly and comments explain the little-endian choice and reference the SipHash paper. The main hash function is reasonably flat, though the switch statement for trailing bytes uses intentional fall-through which may confuse readers unfamiliar with this pattern. Action granularity is good in the sipround method with one operation per line. Minor readability concerns include heavy use of hexadecimal notation (0x38, 0xD, 0x10) which assumes domain knowledge, and the switch fall-through requires careful reading to understand byte accumulation. Overall, it's concise and maintains clear intent throughout.
Run 2
The code is generally organized but suffers from several readability issues. Structure is logical with clear separation of state initialization and hashing, but the SipHash core algorithm is inherently complex. Nesting is mostly acceptable though the switch fall-through pattern is non-obvious. Intent is clear from comments and method names, but magic hexadecimal constants throughout obscure the algorithm's mathematical constants. Code length is appropriate except for the verbose tail-processing switch. Action granularity is good in most methods. Reading flow is decent but hampered by hexadecimal notation for shifts (0x38, 0x30, etc.) that force mental conversion. The switch fall-through for tail bytes is efficient but hard to follow without comments. Overall the code is maintainable for those familiar with cryptographic implementations, but could be improved with named constants, decimal shifts, and more explicit tail-handling logic.
Run 3
The code has a clear overall structure with constants, fields, constructor, and methods logically organized. However, readability suffers in several areas. The macHash method mixes multiple actions (position calculation, endianness check, loop, tail handling) and uses hexadecimal literals extensively, making intent harder to grasp. The switch statement with fall-through cases is compact but non-obvious; comments only partially clarify the bit-shifting logic. Nesting is low, which is good, but the tail-processing block is dense and breaks the 'one action per line' principle. Magic numbers (0x38, 0x30, etc.) without explanatory constants reduce clarity. The class-level structure and constructor are clean, but the core hashing logic requires domain knowledge to parse easily, placing it mid-range on the readability scale.
Run 1
Code Structure: Constants, state, initialization, hashing, and the round operation are logically separated. Nesting: Mostly shallow, with only modest nesting in block processing. Clarity of intent: Descriptive configuration names, endian comments, and the algorithm reference help, but terse variables, hexadecimal counts, mutable state, and undocumented switch fall-through require cryptographic familiarity. Code length: Reasonably concise for the algorithm, although repeated round loops and explicit tail-byte assembly add verbosity. Action granularity: Statements generally perform one action per line, making transformations easy to follow. Reading flow: Initialization, block processing, tail handling, and finalization follow a natural sequence; however, the distinction between absolute offsets and relative lengths is insufficiently explained, and sparse phase comments make some details harder to track.
Run 2
Code Structure: Constants, initialization, hashing, and the round operation are logically separated, though macHash combines several processing stages. Nesting: Mostly shallow, with only modest nesting inside the block-processing loop. Clarity of intent: Descriptive configuration names, comments, and the algorithm reference help; terse state variables are conventional for SipHash but require familiarity. Hexadecimal loop counters and offsets, unexplained mutable state, and undocumented switch fall-through reduce clarity. Code length: Reasonably concise for a low-level cryptographic implementation, with some repetitive state assignments and round loops. Action granularity: Each statement performs a single operation, making state changes easy to trace. Reading flow: Initialization, block processing, tail handling, and finalization follow a natural sequence. However, the relationship between position, len, and the loop boundary is not immediately clear, and tail assembly requires careful reading.
Run 3
Code Structure: Constants, initialization, hashing, and round operations are logically separated, although macHash combines several processing stages. Nesting: Mostly shallow, with manageable nested compression loops and a switch. Clarity of intent: Descriptive configuration names, comments, and the algorithm reference help; terse state variables, hexadecimal loop counters and offsets, and undocumented switch fall-through make details harder to follow. Code length: Reasonably concise for a low-level hashing implementation, though tail assembly is repetitive. Action granularity: Each statement generally performs one operation, making state changes easy to trace. Reading flow: Initialization, block processing, tail handling, and finalization follow a natural sequence, with whitespace separating stages. However, mixing absolute positions with relative lengths requires extra scrutiny, and mutable instance state introduces implicit dependencies between methods.