Sample

Dorn/cuda/116

Human rating uses the original dataset scale.

DatasetDorn
Human3.75
Lines30

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
49.0Δ 32.0
Scalabrino0.5170–1; higher is more readable
44.2Δ 36.9
Dorn0.5290–1; higher is more readable
45.4Δ 35.7
Mi0.640–1; higher is more readable
70.8Δ 10.3
LLOC17Logical lines; fewer is more readable
41.2Δ 39.8
DeepSeek V4 Pro160–20; mean of three runs
84.5Δ 3.5
GPT-6.1 Sol180–20; mean of three runs
93.5Δ 12.4
BTTF0.4560–1; higher is more readable
34.3Δ 46.8
Human3.751–5; original rating
81.1

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.744.14−24.557
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.841−7.262

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

Score0.517

Feature contributions

FeatureValueContribution
(log-odds)
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.1+0.398
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.77.871+0.367
Indentation frequencyHow rapidly indentation changes from line to line.29+0.266
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.121−0.23
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.28+0.045
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.29.785+0.007

Intercept 0.07 + feature contributions = 0.118 (log-odds).
Score = sigmoid(0.118) = 0.529.

Score0.64
Score17
Run 1

The code is highly readable with clear logical organization. Each function has a single responsibility, keeping methods short and focused. Nesting is minimal—only one level deep in conditional guards, which is good. Intent is explicit: lazy initialization, cleanup, seed configuration, and array filling are all named clearly. Code length is concise, avoiding unnecessary boilerplate. Action granularity is well-balanced; each line performs one meaningful operation, aiding debugging and understanding. Reading flow is natural, progressing from generator setup to cleanup to usage. Minor improvements could include adding comments explaining the atexit registration or the type-change logic, but overall the code is self-documenting and maintainable.

Run 2

The code is generally readable with clear, single-purpose functions and a logical structure. It uses early returns to avoid unnecessary nesting, and function names clearly express intent. The lazy initialization pattern in RandomGenerator is straightforward, and cleanup is handled cleanly with atexit. However, there are minor issues: the static member variable 'randomGenerator' is used but not declared in the visible snippet, which could confuse readers about its scope. The SetSeed function has an implicit dependency on randomGeneratorType that isn't immediately obvious from the function signature. Line length is mostly appropriate, though some lines could be shortened for better readability. Overall, the code demonstrates good practices with minimal nesting and clear separation of concerns.

Run 3

The code is generally readable with clear method names and logical grouping for a Random utility class. It uses a simple structure with a lazy singleton pattern and a cleanup function registered via atexit. Nesting is shallow (one level), and each line performs one action. However, readability suffers from a few issues: the intent of the static generator type and its interaction with cleanup is not immediately obvious; the code assumes global state and lacks comments explaining lifetime or thread safety. The `SetSeed` function does multiple conceptual things (changing generator type, cleaning up, setting seed) in a few lines without highlighting the conditional state change. The reading flow is natural, but the overall code length could be more concise with helper functions or clearer separation of concerns. Overall, it is understandable but not maximally clear.

Run 1

Code Structure: Well-organized methods separate generator initialization, cleanup, seeding, and array filling. Nesting: Only simple, single-level conditionals, making control flow easy to follow. Clarity of intent: Descriptive method names and recognizable cuRAND calls communicate purpose, though RandomGenerator() could more explicitly indicate lazy initialization. Code length: Concise, with little unnecessary code. Action granularity: Each statement performs one clear operation on its own line. Reading flow: Natural progression from initialization to cleanup and usage, supported by whitespace and consistent formatting. Minor readability limitations include the externally defined randomGenerator state and the implicit relationship between generator-type changes, cleanup, and recreation.

Run 2

Code Structure: Well-organized into focused methods for generator initialization, cleanup, seeding, and filling arrays. Nesting: Shallow, with only single-level conditionals. Clarity of intent: Descriptive method names and straightforward cuRAND calls make the purpose clear, though RandomGenerator() obscures its lazy initialization and cleanup-registration side effects. Code length: Concise without unnecessary repetition. Action granularity: Each statement performs one primary action on its own line. Reading flow: Natural progression from accessing the generator to managing its lifecycle and using it. Minor readability limitations include inconsistent whitespace and implicit shared-state dependencies; the generator's declaration and initial state are not shown.

Run 3

Code Structure: Well-organized methods separate generator initialization, cleanup, seeding, and array filling. Nesting: Only simple, single-level conditionals, making control flow easy to follow. Clarity of intent: Descriptive method names and straightforward cuRAND calls communicate purpose, though RandomGenerator() does not immediately reveal its lazy initialization and exit-handler registration. Code length: Concise, with little unnecessary code. Action granularity: Each statement performs one clear action, and operations are separated onto individual lines. Reading flow: The progression from initialization to cleanup, configuration, and generation is natural. Minor readability limitations include implicit shared state and the absence of visible error handling for cuRAND calls.