Sample
Dorn/cuda/23
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 6.4Δ 5.6 |
| Scalabrino | 0.186 | 0–1; higher is more readable | 13.6Δ 1.6 |
| Dorn | 0.234 | 0–1; higher is more readable | 18.7Δ 6.7 |
| Mi | 0.009 | 0–1; higher is more readable | 2.8Δ 9.2 |
| LLOC | 32 | Logical lines; fewer is more readable | 8.2Δ 3.8 |
| DeepSeek V4 Pro | 6.33 | 0–20; mean of three runs | 18.1Δ 6.1 |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs | 41.4Δ 29.4 |
| BTTF | 0.282 | 0–1; higher is more readable | 13.4Δ 1.4 |
| Human | 2.5 | 1–5; original rating | 12.0 |
Views
Select the downloaded ZIP or its extracted folder. Files stay in your browser.
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. | 2652.016 | −87.517 |
| Source linesThe number of non-empty source lines. | 50 | +20 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 5.133 | −7.699 |
Intercept 8.87 + feature contributions = -66.346 (log-odds).
Score = sigmoid(-66.346) = 0.
| Score | 0.186 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 140 | −2.265 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 139.98 | +1.454 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 51 | −0.769 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 42 | +0.716 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 42 | −0.543 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.801 | +0.286 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.111 | −0.134 |
Intercept 0.07 + feature contributions = -1.185 (log-odds).
Score = sigmoid(-1.185) = 0.234.
| Score | 0.009 |
|---|
| Score | 32 |
|---|
Run 1
The code suffers from several readability issues. Structure is weak: multiple binding operations are sequential but lack logical grouping or separation. Comments are repetitive and sometimes incorrect ('Bind positionField' appears twice). Nesting is moderate (if-else, loop) but contributes to length. Intent is partially clear for texture binding but obscured by verbose CUDA setup, especially the manual matrix-to-float4 conversion which could be a helper function. Code length is unnecessarily long due to repeated CUDA_SAFE_CALL patterns and inline host/device allocation. Action granularity is poor; multiple statements on one line (e.g., 'float4 *sourceRealToVoxel_h;CUDA_SAFE_CALL(cudaMallocHost...') hurt readability. Reading flow is disrupted by jumping from bindings to matrix setup to kernel launch, with cleanup scattered. Overall, it is functionally understandable for CUDA experts but not cleanly structured or concise.
Run 2
The code is difficult to read due to multiple issues. The structure is tangled, mixing texture binding, memory allocation, and kernel launch without clear separation. Nesting is acceptable but flow is interrupted by inline declarations and conditional logic. Intent is partially clear but obscured by comments that are duplicated and vague ('Bind positionField to texture' repeated). Code length is unnecessarily long for the operations performed, with repetitive CUDA_SAFE_CALL blocks. Action granularity is poor: multiple statements are placed on the same line (e.g., variable declaration followed by CUDA_SAFE_CALL on one line). Reading flow is disorganized, jumping between texture binding, host/device memory handling, and kernel launch without logical grouping. The lack of proper spacing, inconsistent indentation, and mixed-case naming further degrade readability. The code appears functional but requires significant mental effort to parse and maintain.
Run 3
The code has some readability but suffers from structural issues. The sequential setup steps are somewhat logical (bind textures, prepare matrix, launch kernel, unbind), but line 14 concatenates two distinct operations with a semicolon, harming clarity. Deep nesting is minimal, though the if-else on lines 10–12 could be condensed. Intent is partially clear via comments, but the second 'Bind positionField' comment is duplicated for the mask texture, causing ambiguity. Code length is moderate; the matrix preparation loop is verbose and could be simplified. Several lines contain multiple actions, especially with the CUDA_SAFE_CALL macro wrapping multiple arguments, making single-action granularity poor. Reading flow is disrupted by sudden kernel launch and verbose verbose-logging blocks, plus inconsistent indentation and variable naming (e.g., 'Block_reg_resampleSourceImage' vs 'B1'). Overall, the code is functional but requires effort to parse.
Run 1
Code Structure: Logically grouped into texture binding, matrix preparation, kernel execution, and cleanup, though section boundaries are informal. Nesting: Shallow, with only one conditional and one short loop. Clarity of intent: Descriptive identifiers and CUDA calls convey purpose, but the copied positionField comment incorrectly describes mask binding, and B1/G1 are vague names. Code length: Mostly appropriate for the operations performed, although long allocation, copy, and grid-calculation lines reduce scanability. Action granularity: Generally one action per line, except a declaration and allocation combined on one line. Reading flow: Execution follows a natural setup-to-cleanup sequence, but inconsistent spacing, indentation, missing conditional braces, and preprocessor logging interrupt the flow.
Run 2
Code Structure: Organized into texture binding, matrix preparation, kernel execution, and cleanup, though these phases lack explicit grouping or helper functions. Nesting: Shallow, with only one conditional and one loop, making control flow easy to follow. Clarity of intent: Descriptive resource names and CUDA calls convey purpose, but the duplicated positionField comment incorrectly describes mask binding, and B1/G1 are vague names. Code length: Mostly appropriate for the operations performed, although repeated matrix assignments and resource-management calls add verbosity. Action granularity: Generally one operation per line, except a pointer declaration and allocation combined on one line. Reading flow: Execution follows a natural setup-execute-cleanup sequence, but inconsistent spacing, indentation, missing conditional braces, long lines, and trailing blank lines reduce readability.
Run 3
Code Structure: Logically groups texture binding, matrix preparation, kernel execution, and cleanup, although these stages lack helper functions. Nesting: Shallow, with only a simple conditional and loop. Clarity of intent: Descriptive resource names and CUDA calls convey the overall purpose, but B1/G1 are vague, and the mask-binding comment incorrectly refers to positionField. Code length: Mostly proportionate to the work, though repeated allocation sizes and texture operations add boilerplate. Action granularity: Most lines perform one action, but a pointer declaration and host allocation share a line. Reading flow: Execution proceeds naturally from setup to cleanup; inconsistent spacing, indentation, missing conditional braces, and long lines make scanning harder. Overall, understandable CUDA code with noticeable formatting and naming weaknesses.