Sample
Dorn/cuda/47
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 7.8Δ 4.7 |
| Scalabrino | 0.281 | 0–1; higher is more readable | 19.4Δ 16.3 |
| Dorn | 0.158 | 0–1; higher is more readable | 11.1Δ 8.1 |
| Mi | 0.022 | 0–1; higher is more readable | 4.5Δ 1.4 |
| LLOC | 25 | Logical lines; fewer is more readable | 21.4Δ 18.4 |
| DeepSeek V4 Pro | 7.67 | 0–20; mean of three runs | 27.2Δ 24.1 |
| GPT-6.1 Sol | 14.33 | 0–20; mean of three runs | 44.4Δ 41.4 |
| BTTF | 0.285 | 0–1; higher is more readable | 13.9Δ 10.9 |
| Human | 1.98 | 1–5; original rating | 3.1 |
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. | 2539.666 | −83.809 |
| 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.141 | −7.711 |
Intercept 8.87 + feature contributions = -62.65 (log-odds).
Score = sigmoid(-62.65) = 0.
| Score | 0.281 |
|---|
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. | 175.941 | −3.787 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 176 | +2.035 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 45 | +0.819 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 51 | −0.769 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 45 | −0.612 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.831 | +0.287 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.068 | +0.282 |
Intercept 0.07 + feature contributions = -1.675 (log-odds).
Score = sigmoid(-1.675) = 0.158.
| Score | 0.022 |
|---|
| Score | 25 |
|---|
Run 1
The code shows basic organization but suffers from several readability issues. Function names are descriptive and follow a consistent pattern, which aids intent clarity. However, the code has excessive line lengths in function signatures (100+ characters), making them difficult to scan. Multiple parameters are packed onto single lines, reducing action granularity. The repeating pattern of kernel launch followed by error checking is clear but verbose, with long error messages duplicating function names. Inconsistent indentation and line breaks in parameters create visual clutter. Comments are minimal, with only one docstring for texture binding. The code structure is logical but the presentation obscures it—parameters are hard to distinguish, and the relationship between host wrappers and kernels is not immediately obvious. While the code is functional, it would benefit from consistent formatting, shorter lines, and better parameter grouping to improve readability.
Run 2
The code shows mixed readability. The kernel launch wrappers are reasonably structured with clear function names and consistent error checking, but several issues reduce readability. Lines are excessively long (150+ characters) with many parameters crammed together, violating action granularity principles. The parameter alignment uses inconsistent spacing and indentation. Multiple function calls and assignments are packed into single lines. The function signatures have unclear parameter ordering without documentation. Some error messages reference incorrect function names (e.g., 'h_init_cudaPSO' in h_cudaPSO_BindTextures, 'h_cudaPSOBindPositionsTextures' vs 'h_cudaPSOBindBestPositionsTextures'), suggesting copy-paste errors that reduce clarity of intent. The Doxygen comment for h_cudaPSO_BindTextures mentions 'Initialization of the GPU' but the function actually binds textures - misleading documentation. Magic values like '(particlesNumber + 2)' lack explanation. The code follows a predictable pattern for kernel launches, which aids comprehension, but the dense parameter lists and formatting inconsistencies make it difficult to scan quickly.
Run 3
The code shows signs of organized structure with consistent error handling and clear host-device separation, but suffers from poor readability due to extremely long parameter lists, long lines, inconsistent naming conventions (h_cudaPSO_firstBestsUpdate vs g_firstBestsUpdate), and redundant shared memory calculations duplicated across functions. The texture binding function has repetitive blocks that could be refactored, and the alignment calculation lacks clarity. While the one-action-per-line principle is mostly followed and nesting is flat, the dense parameter lists and long function signatures make the code difficult to scan quickly. Error messages are clear and consistent, which aids debugging, but the overall implementation feels unnecessarily verbose without adding clarity. The comments are helpful but sparse.
Run 1
Code Structure: Small, purpose-specific host wrappers provide logical organization, although the texture-binding function is incomplete in the supplied snippet. Nesting: Flat code with no nested control flow is easy to follow. Clarity of intent: Function and variable names generally convey CUDA operations, but 'dim' ambiguously represents a byte count, comments describe initialization rather than texture binding, and several error messages name unrelated functions. Code length: Wrappers are concise; repeated binding/error-check pairs add some verbosity. Action granularity: Most lines perform one action, though one declaration combines two variables and an initialization. Reading flow: Kernel launch followed by error checking is consistent and natural, and texture bindings are grouped by size. Long signatures and launch lines, uneven indentation, inconsistent spacing, and extra blank lines reduce scanning ease.
Run 2
Code Structure: Small, purpose-specific wrappers provide logical organization, although texture binding repeats similar operations. Nesting: The code is flat, with no nested control flow. Clarity of intent: Function and variable names generally communicate CUDA operations, but abbreviated names such as dim, W, C1, and C2 provide limited context. The initialization comment and some error messages do not match their surrounding functions, and the documented numberOfGenerations parameter is absent. Code length: Function bodies are concise, but long signatures, kernel launches, and repeated error checks increase visual load. Action granularity: Most lines perform one action; the combined declaration of dim and actualParticleSize is a minor exception. Reading flow: Launch-then-check and bind-then-check patterns are easy to follow, but inconsistent spacing, awkward parameter alignment, extra blank lines, and the incomplete final function interrupt readability.
Run 3
Code Structure: Small, purpose-specific kernel wrappers are logically separated, but the texture-binding function is incomplete in the excerpt. Nesting: Flat execution with no nested control flow makes the code easy to scan. Clarity of intent: Descriptive function and variable names convey the CUDA operations, but generic names such as dim, unexplained alignment constants, outdated documentation, and mismatched error-message labels reduce clarity. Code length: Wrapper bodies are concise, although long parameter lists and repetitive error checks add visual bulk. Action granularity: Most lines perform one operation; the combined variable declaration is a minor exception. Reading flow: Kernel launches followed immediately by error checks provide a predictable sequence, while inconsistent spacing, awkward parameter indentation, and excessive blank lines interrupt readability.