Sample
Dorn/cuda/74
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 46.8Δ 0.6 |
| Scalabrino | 0.407 | 0–1; higher is more readable | 30.6Δ 15.6 |
| Dorn | 0.678 | 0–1; higher is more readable | 63.0Δ 16.7 |
| Mi | 0.528 | 0–1; higher is more readable | 56.5Δ 10.3 |
| LLOC | 20 | Logical lines; fewer is more readable | 32.5Δ 13.8 |
| DeepSeek V4 Pro | 13.67 | 0–20; mean of three runs | 62.8Δ 16.6 |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs | 61.6Δ 15.3 |
| BTTF | 0.411 | 0–1; higher is more readable | 25.6Δ 20.6 |
| Human | 3.31 | 1–5; original rating | 46.2 |
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. | 780.484 | −25.756 |
| Source linesThe number of non-empty source lines. | 30 | +12 |
| 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.648 | −6.971 |
Intercept 8.87 + feature contributions = -11.857 (log-odds).
Score = sigmoid(-11.857) = 0.
| Score | 0.407 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 82.194 | +0.522 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.078 | +0.187 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 26 | −0.176 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 25 | +0.128 |
| 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. | 84.903 | +0.069 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 31 | −0.061 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.872 | +0.008 |
Intercept 0.07 + feature contributions = 0.746 (log-odds).
Score = sigmoid(0.746) = 0.678.
| Score | 0.528 |
|---|
| Score | 20 |
|---|
Run 1
The code demonstrates moderate readability with clear variable declarations and a logical structure, but has several issues. The function begins with a wall of variable declarations (13 variables) before any logic, creating cognitive overhead. The naming is generally good ('startDevice', 'endDevice', 'increment', 'printmode') though some abbreviations ('htod', 'dtoh', 'dtod', 'wc') lack context and could be ambiguous to readers unfamiliar with GPU memory transfer terminology. The code is relatively flat with minimal nesting, which is positive. Action granularity is acceptable with one main action per line. The comment header helps establish intent, but the missing function documentation and unclear return value semantics (-1 for help) weaken clarity. The conditional check for 'help' is straightforward, but the massive initialization block could be refactored into a configuration struct or initialization function to improve readability. Overall, the code is functional and reasonably organized but would benefit from better variable grouping and more descriptive naming for abbreviated flags.
Run 2
The code demonstrates good organization with a clear separation of concern - exiting the test framework, then parsing arguments and running tests. Variable declarations are grouped logically by purpose (size parameters, test flags, mode settings). The use of constants like DEFAULT_SIZE and DEFAULT_INCREMENT improves readability. However, the function lacks documentation about expected arguments, and several boolean and integer variables are initialized sequentially without grouping or comments to explain their purpose. The shrQAFinishExit function call in the first line appears disconnected from the runTest function body, creating confusion about flow. The command-line processing only shows a help flag check without illustrating how other arguments are handled. The use of magic values and the mixture of naming conventions (camelCase vs lowercase) detracts slightly from readability. Overall, it's above average but could benefit from better documentation and variable organization.
Run 3
The code demonstrates reasonable structure with clear section comments and grouped variable declarations, but has several readability issues. The function signature and variable initialization are straightforward, though the large block of boolean flags and mode variables could benefit from a struct or configuration object. The nesting is minimal which is good, but the single if-statement checking for 'help' feels isolated without context about other command-line flags. The magic return value -1 is unclear without documentation. Variable names like 'htod', 'dtoh', 'dtod', and 'wc' are cryptic abbreviations that require domain knowledge to understand. The action granularity is good with one declaration per line, but the block of 15+ variable declarations creates visual noise. The reading flow is somewhat disjointed as the code jumps from variable initialization to command-line parsing without clear logical grouping. Overall, it's maintainable but could be more self-documenting.
Run 1
Code Structure: The function has a logical setup section followed by argument handling, but the excerpt begins with the tail of another function, reducing structural completeness. Nesting: The visible code is shallow, with only one straightforward conditional. Clarity of intent: The function comment and help check make the purpose clear, though abbreviations such as htod, dtoh, dtod, and wc are not self-explanatory. Code length: The excerpt is reasonably concise, but repetitive declarations and large comment separators add visual bulk. Action granularity: Each declaration and operation occupies its own line, making individual steps easy to inspect. Reading flow: Initialization followed by an early return for help reads naturally, although inconsistent spacing and the truncated boundaries slightly interrupt comprehension.
Run 2
Code Structure: The function is logically organized into initialization and command-line handling, though the opening fragment lacks context. Nesting: The visible code is shallow, with a single straightforward conditional. Clarity of intent: The function comment and help handling clarify the purpose, but abbreviations such as htod, dtoh, dtod, and wc obscure meaning. Code length: The snippet is concise, although the lengthy initialization block adds some scanning effort. Action granularity: Each declaration and operation occupies its own line. Reading flow: Execution proceeds naturally from defaults to argument processing, but inconsistent spacing, decorative comment separators, and the preceding partial function slightly interrupt readability.
Run 3
Code Structure: The runTest function is logically organized, with initialization followed by command-line processing, though the opening fragment belongs to a preceding function. Nesting: Minimal nesting makes the control flow easy to follow. Clarity of intent: The function comment and help handling clearly communicate purpose, but abbreviations such as htod, dtoh, dtod, and wc require domain knowledge; modeStr is also left uninitialized. Code length: The snippet is concise, although the long list of local variables adds some scanning overhead. Action granularity: Each declaration and operation occupies its own line. Reading flow: Initialization flows naturally into argument handling, but inconsistent spacing and the incomplete surrounding context slightly reduce readability.