Sample

Dorn/cuda/105

Human rating uses the original dataset scale.

DatasetDorn
Human2.87
Lines9

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0970–1; higher is more readable
73.3Δ 49.6
Scalabrino0.3210–1; higher is more readable
22.9Δ 0.8
Dorn0.1170–1; higher is more readable
8.1Δ 15.6
Mi0.7250–1; higher is more readable
89.1Δ 65.5
LLOC2Logical lines; fewer is more readable
93.7Δ 70.1
DeepSeek V4 Pro8.670–20; mean of three runs
32.7Δ 9.1
GPT-6.1 Sol17.330–20; mean of three runs
86.5Δ 62.8
BTTF0.3890–1; higher is more readable
22.6Δ 1.1
Human2.871–5; original rating
23.7

Views

Download official ZIP ↗

Select the downloaded ZIP or its extracted folder. Files stay in your browser.

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.222.905−7.356
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.895−7.343
Source linesThe number of non-empty source lines.9+3.6

Intercept 8.87 + feature contributions = -2.228 (log-odds).
Score = sigmoid(-2.228) = 0.097.

Score0.321

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.181−0.821
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.10+0.682
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.102−0.655
Indentation frequencyHow rapidly indentation changes from line to line.9−0.426
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.8.893−0.286
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.9+0.214

Intercept 0.07 + feature contributions = -2.025 (log-odds).
Score = sigmoid(-2.025) = 0.117.

Score0.725
Score2
Run 1

The code is extremely short and follows a single-purpose function, but it is difficult to read for several reasons. The structure is minimal—just one function with a macro—but it lacks documentation and context. Nesting is non-existent, which is good, but clarity of intent is weak: the function name suggests clearing an accumulator GPU buffer, yet the parameter names and the raw multiplication of dimensions make it hard to verify correctness without domain knowledge. Code length is concise, but action granularity is poor—multiple operations (calculating size, calling cudaMemset) are crammed into one line, making debugging harder. Reading flow is unnatural because the dimension multiplication is not abstracted into a helper macro or constant. There is no error checking on cudaMemset, no comments explaining the memory layout, and unused parameters (nifti_image) create ambiguity. While simple, the lack of structure and clarity reduces readability.

Run 2

The code is concise and straightforward, with a clear purpose: clearing a GPU accumulator buffer. The function name accurately describes its action, and the single-line cudaMemset call implements exactly that. Structure is minimal but logical for a simple utility function. The define for BLOCK is unused, which slightly reduces clarity. The function has only one parameter that is actually used (d_accumulator), while nifti_image could arguably be replaced with dimension values directly, but this may be acceptable for API consistency. There is no nesting, action granularity is fine, and the reading flow is natural. However, missing error handling for CUDA calls and lack of documentation regarding the data layout or why BLOCK exists slightly reduce readability. Overall, the code is easy to understand at a glance but could benefit from minor cleanup.

Run 3

The code scores poorly due to several critical readability issues. While the function is extremely short, it performs too many operations in a single line, violating action granularity and clarity of intent. The parameter 'accumulator->nx*accumulator->ny*accumulator->nz*sizeof(float)' is a dense expression that should be extracted into a named variable or constant for clarity. The function signature uses raw pointers and void return, with no error handling or documentation about the GPU context, memory ownership, or expected behavior. The include directive appears suspicious with a leading underscore, suggesting a non-standard or possibly broken pattern. There's no explanation of what 'd_accumulator' represents, why it's a pointer-to-pointer, or what 'nifti_image' provides. The single-line implementation, while concise, hides the intent and makes debugging challenging. Overall, this code prioritizes brevity over clarity, failing to communicate its purpose or validate inputs, resulting in highly cryptic, difficult-to-maintain code.

Run 1

Code Structure: A single, focused function is logically organized, though the unused BLOCK macro adds clutter. Nesting: No nesting makes the code easy to scan. Clarity of intent: The function name clearly indicates clearing a GPU accumulator; cudaMemset conveys the operation, although 0 would communicate its byte-fill argument more clearly than 0.0f. Code length: Very concise, with no unnecessary implementation steps. Action granularity: The function performs one action on one line, but that line combines pointer conversion and size calculation. Reading flow: Straightforward from declaration to operation, though missing spaces and the long cudaMemset call slightly reduce readability.

Run 2

Code Structure: A single, logically organized function; the unused BLOCK macro adds minor clutter. Nesting: No nesting, making the code easy to follow. Clarity of intent: The function name and cudaMemset call clearly indicate clearing a GPU accumulator, though 0.0f is misleading for a byte-value argument and the pointer cast adds visual noise. Code length: Very concise, without unnecessary implementation detail. Action granularity: One operation on one line, although the inline size calculation makes that line dense. Reading flow: Straightforward from declaration to operation, but missing spaces around arguments and operators slightly reduces readability.

Run 3

Code Structure: A single, logically organized function, though the unused BLOCK macro adds clutter. Nesting: No nesting, making the code easy to follow. Clarity of intent: The function name and cudaMemset call clearly indicate clearing a GPU accumulator, but the pointer-to-pointer parameter and cast add slight complexity. Code length: Very concise without unnecessary implementation details. Action granularity: One operation occupies one line, although the inline size calculation makes that line dense. Reading flow: Straightforward from declaration to operation; consistent spacing and wrapping the long call would improve readability. Using 0 instead of 0.0f would better reflect cudaMemset's byte-value argument.