Sample

Dorn/cuda/17

Human rating uses the original dataset scale.

DatasetDorn
Human3.25
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
32.9Δ 10.6
Scalabrino0.7080–1; higher is more readable
77.5Δ 34.1
Dorn0.580–1; higher is more readable
50.4Δ 7.0
Mi0.7550–1; higher is more readable
93.3Δ 49.9
LLOC28Logical lines; fewer is more readable
15.2Δ 28.3
DeepSeek V4 Pro170–20; mean of three runs
93.5Δ 50.0
GPT-6.1 Sol160–20; mean of three runs
66.0Δ 22.6
BTTF0.5790–1; higher is more readable
68.5Δ 25.1
Human3.251–5; original rating
43.5

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.1297.07−42.803
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.062−7.593

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

Score0.708

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.47+0.889
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.47−0.658
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.76.941+0.437
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.922+0.407
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.132−0.338
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.654+0.284

Intercept 0.07 + feature contributions = 0.322 (log-odds).
Score = sigmoid(0.322) = 0.58.

Score0.755
Score28
Run 1

The code is well-structured with clear logical organization: each function handles a single networking concern (binding, accepting, receiving). Nesting is minimal, with only single-level conditional blocks for error handling. Intent is explicit through descriptive function names (net_accept, net_recv) and concise comments documenting key operations. Code length is appropriate — no unnecessary verbosity or over-abstraction. Action granularity is strong: variable declarations and operations are separated onto individual lines where clarity benefits, though multi-action lines like the accept() assignment are acceptable and readable. Reading flow is natural, progressing from bind → listen → accept → receive in a logical sequence. Minor deductions: inconsistent comment style (some uppercase, some lowercase), error handling repetition could be extracted into a helper, and the port variable is referenced in a fprintf without showing its declaration context. Overall, this is clean, idiomatic C networking code that is straightforward to follow and maintain.

Run 2

The code demonstrates good readability with clear structure and intent. Functions are well-separated and focused on single network operations. Error handling follows a consistent pattern using perror(), close(), and exit(), though this repetition could be extracted. Nesting is minimal with only single-level error checks. The code is concise without unnecessary verbosity, and action granularity is appropriate with one meaningful operation per line. Variable declarations are grouped logically and formatting is consistent. The main readability drawback is slight code duplication in error handling paths and the use of raw C socket programming which requires domain knowledge to fully understand. Comments are helpful but sparse. Overall the code is straightforward to follow for those familiar with socket programming.

Run 3

The code demonstrates clear, consistent structure with logical organization. Functions like net_accept and net_recv are well-separated, each handling one responsibility. Error handling follows a predictable pattern: system call check, perror, resource cleanup, exit. Nesting is minimal with flat if-error blocks rather than deep conditional chains. Variable declarations are grouped logically (bptr, rbytes for receiving; caddr, casize for connection info). Comments are short and purposeful, explaining non-obvious values like backlog size. Action granularity is appropriate - one meaningful operation per line with proper line breaks for long statements. Function calls with multiple arguments are formatted for readability. The code uses descriptive variable names (client_ip, client_port, sock_fd) and consistent indentation. Minor deductions: mixing declaration styles (mid-function char declarations after statements), the fprintf formatting could be slightly more compact, and some lines approach reasonable length limits. Overall very readable C networking code with no significant structure problems.

Run 1

Code Structure: Distinct networking functions and clear error-handling blocks provide logical organization, although the excerpt begins and ends mid-function. Nesting: Shallow conditionals keep the code easy to follow. Clarity of intent: Descriptive function names, conventional socket APIs, comments, and diagnostic messages communicate purpose well; abbreviated variables such as caddr and casize are less explicit. Code length: The code is concise, with modest repetition in failure handling. Action granularity: Most statements perform one action, but assigning client_fd inside the accept error condition combines assignment and comparison. Reading flow: Binding, listening, accepting, and logging follow a natural sequence. Uneven declaration alignment and declarations appearing after executable statements slightly interrupt the visual flow.

Run 2

Code Structure: Socket binding, listening, and accepting are logically organized into distinct operations and functions, although the snippet starts and ends mid-function. Nesting: Shallow error-checking blocks keep complexity low. Clarity of intent: Descriptive function names, conventional socket APIs, and helpful comments make the purpose clear; abbreviated variables such as caddr and casize are less informative. Code length: Concise overall, with minor repetition in error handling. Action granularity: Most lines perform one action, but assigning client_fd within the accept condition combines assignment and checking. Reading flow: The sequence naturally follows connection setup and acceptance, though uneven declaration alignment, mixed declaration placement, and the incomplete net_recv function slightly disrupt readability.

Run 3

Code Structure: Socket setup and connection acceptance are logically organized into functions, though the excerpt starts and ends mid-function. Nesting: Shallow error-handling blocks keep complexity low. Clarity of intent: Function names, standard socket calls, and comments clearly convey purpose; abbreviated variables such as caddr and casize are less descriptive. Code length: Concise overall, with modest repetition in error handling. Action granularity: Most lines perform one action, but assigning client_fd inside the accept condition combines assignment and checking. Reading flow: Operations follow a natural bind, listen, accept, and log sequence. Uneven declaration alignment, mixed declaration placement, and the incomplete net_recv body slightly reduce readability.