Sample

Dorn/cuda/102

Human rating uses the original dataset scale.

DatasetDorn
Human2.82
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
35.9Δ 13.6
Scalabrino0.6190–1; higher is more readable
62.8Δ 40.5
Dorn0.3020–1; higher is more readable
23.4Δ 1.1
Mi0.7610–1; higher is more readable
94.2Δ 71.9
LLOC25Logical lines; fewer is more readable
21.4Δ 0.8
DeepSeek V4 Pro120–20; mean of three runs
53.6Δ 31.3
GPT-6.1 Sol130–20; mean of three runs
30.6Δ 8.4
BTTF0.5520–1; higher is more readable
60.7Δ 38.4
Human2.821–5; original rating
22.3

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.1236.573−40.807
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.4.997−7.495

Intercept 8.87 + feature contributions = -19.432 (log-odds).
Score = sigmoid(-19.432) = 0.

Score0.619

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.50+0.992
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.50−0.727
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.46−0.592
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.145−0.468
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.76.941+0.406
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.705+0.285

Intercept 0.07 + feature contributions = -0.837 (log-odds).
Score = sigmoid(-0.837) = 0.302.

Score0.761
Score25
Run 1

The code shows moderate readability. Structure is acceptable — socket setup, accept, and receive functions are separated logically. However, several issues reduce clarity. Multiple actions are packed into single lines (e.g., accept() with error checking on one line), and the recv() loop has inconsistent indentation and a naked for(;;) that lacks a comment explaining the loop's purpose. Variable declarations are interspersed mid-function (e.g., char client_ip after accept()), breaking natural flow. Error handling uses perror() + close() + exit() repeatedly without abstraction, adding length and repetition. The nesting is shallow but action granularity is inconsistent — some lines handle assignment + comparison + control flow. Reading flow suffers from mixed declaration styles and inconsistent spacing around operators. The code is understandable to an experienced C programmer but not immediately scannable.

Run 2

The code is moderately readable. It has clear structure with separate functions for each socket operation, and error handling is consistent. Nesting is shallow (one level), which is good. However, there are several readability issues: variables are declared mid-function (C99 style) which can be jarring; the recv loop logic is somewhat tricky with pointer arithmetic ('bptr - net_data') that requires mental tracking; multiple operations occur per line (function calls with assignments); error handling repeatedly exits the program, which may be intentional but obscures control flow; and the snippet ends abruptly mid-loop. The use of tabs for alignment aids vertical consistency, but some lines exceed comfortable width. Naming is decent ('sock_fd', 'client_fd', 'net_data') but 'bptr' and 'rbytes' are terse. Overall it's readable for experienced C developers familiar with socket programming, but could be more approachable for general readers.

Run 3

The code shows a moderate level of readability. Structure is logical, with functions handling specific networking tasks, but error handling creates code blocks that disrupt flow. Nesting is shallow (two levels maximum), which is positive. Intent is mostly clear but variable names like 'caddr' and 'bptr' are slightly cryptic. Code length is acceptable but could be more concise. Action granularity is generally one action per line, except for the crowded inet_ntop call and the fprintf statement. Reading flow is inconsistent - the net_recv function's infinite loop with multiple return points makes the control flow harder to follow. The code would benefit from better variable naming, more consistent formatting, and clearer control flow in the receive function.

Run 1

Code Structure: Named functions separate accepting connections from receiving data, but the excerpt starts and ends mid-block, limiting structural completeness. Nesting: Shallow conditionals and a single loop are easy to follow. Clarity of intent: Descriptive function names and error messages communicate purpose, although abbreviated variables and pointer arithmetic require interpretation. Code length: Mostly concise, without substantial repetition. Action granularity: Most statements perform one action, but assignments embedded in conditionals combine operations and checks. Reading flow: Blank lines and consistent brace placement help, while uneven declaration alignment, a wrapped recv expression, and the truncated receive loop interrupt the flow.

Run 2

Code Structure: Separate accept and receive functions provide logical organization, but the fragment begins and ends mid-function, limiting comprehension. Nesting: Mostly shallow, with a receive loop containing straightforward conditional checks. Clarity of intent: Function names, error messages, and connection logging communicate purpose; abbreviated variables and pointer arithmetic require extra interpretation. Code length: Generally concise, though inconsistent declaration placement and spacing reduce polish. Action granularity: Most statements perform one action, but assignments embedded in conditions combine operations and checks. Reading flow: Acceptance, error handling, logging, and return follow naturally; the truncated receive loop and uneven formatting interrupt the flow.

Run 3

Code Structure: Functions separate accepting connections from receiving data, but the excerpt starts and ends mid-function, obscuring overall organization. Nesting: Mostly shallow, with moderate nesting inside the receive loop. Clarity of intent: Function names, socket operations, and error messages communicate purpose, though abbreviated variables and pointer arithmetic require interpretation. Code length: Generally concise without obvious unnecessary repetition. Action granularity: Most statements perform one action, but assignments embedded in conditional checks combine operations and reduce scanability. Reading flow: Connection acceptance proceeds naturally from setup to logging and return; inconsistent alignment, mixed declaration placement, and the incomplete receive loop interrupt the flow.