Sample

Dorn/cuda/73

Human rating uses the original dataset scale.

DatasetDorn
Human3.2
Lines50

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
29.5Δ 11.4
Scalabrino0.6140–1; higher is more readable
61.2Δ 20.3
Dorn0.4260–1; higher is more readable
35.1Δ 5.8
Mi0.170–1; higher is more readable
17.0Δ 24.0
LLOC35Logical lines; fewer is more readable
4.5Δ 36.5
DeepSeek V4 Pro60–20; mean of three runs
15.3Δ 25.6
GPT-6.1 Sol13.670–20; mean of three runs
37.7Δ 3.2
BTTF0.5210–1; higher is more readable
50.4Δ 9.5
Human3.21–5; original rating
40.9

Views

Source code

{ numSeqs = 0; numThreshold = 0; maxSeqLength = 0; totalAminoAcids = 0; dbSeqsSize = 0; dbSeqs = 0; dbSeqsLen = 0; dbSeqsAlignedLen = 0; dbSeqsName = 0; sortedSeqs = 0; this->params = params; } CSearch::~CSearch() { int i; if(sortedSeqs){ pFreeHost(sortedSeqs); } //free database if(dbSeqs){ for(i = 0; i < numSeqs; i++){ free(dbSeqs[i]); free(dbSeqsName[i]); } free(dbSeqs); free(dbSeqsName); free(dbSeqsLen); free(dbSeqsAlignedLen); } } void CSearch::run () { //read in the input sequence char* query = params->getQueryFile(); char* mat = params->getSubMatrixName(); char* db = params->getDbFile(); //get the gap penalties gapOpen = params->getGapOpen(); gapExtend = params->getGapExtend(); printf("/**********************************/\n"); printf("\tModel:\t\t\t%s\n", params->isUseSIMTModel() == true ? "SIMT scalar" : "SIMD vectorized"); printf("\tScoring matrix:\t\t\t%s\n", mat); printf("\tGap Open penalty:\t\t%d\n", gapOpen); printf("\tGap Extension penalty:\t\t%d\n", gapExtend); printf("/**********************************/\n");

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.1352.208−44.623
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.151−7.727

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

Score0.614

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.47+0.889
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.100+0.809
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
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.99.922−0.567
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.134−0.359
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.871+0.287

Intercept 0.07 + feature contributions = -0.298 (log-odds).
Score = sigmoid(-0.298) = 0.426.

Score0.17
Score35
Run 1

The code has significant readability issues. Structure is inconsistent - mixing tabs and spaces creates visual misalignment across different blocks. The constructor initializes many variables in a flat, repetitive manner without grouping or comments explaining their relationships. The destructor contains nested conditionals and loops but lacks clear separation of concerns. Variable names like 'dbSeqsSize', 'dbSeqsLen', and 'dbSeqsAlignedLen' are semantically confusing and could represent similar concepts. Multiple operations occur on single lines in the destructor (e.g., combined free statements). The run() method begins reasonably by extracting parameters but then dumps output formatting in one block. Overall, the code lacks consistent indentation, meaningful variable grouping, and would benefit from better organization, comments, and more descriptive naming. The mixed indentation alone drops the readability score substantially.

Run 2

The code has several readability issues. The constructor initializes many variables with inconsistent indentation (tabs vs spaces), making the structure visually disorganized. The destructor has a flat but cluttered structure, mixing resource cleanup logic without clear separation, and uses raw pointers with manual memory management that obscures intent. Variable names are reasonably descriptive but abbreviated (numSeqs, dbSeqsLen) which reduces clarity. The run() method mixes concerns: reading configuration, printing output, and setting parameters all in one block without modular breakdown. There are multiple actions per line in places, and the inconsistent indentation (tab characters mixed with spaces) disrupts reading flow. While the code is functional and not deeply nested, the lack of consistent formatting, comments explaining complex memory management, and separation of concerns significantly impacts readability. The printf block is verbose and could be extracted to a helper method.

Run 3

The code suffers from several readability issues. The constructor (implied by 'this->params = params;') has all variables initialized without clear grouping or initialization lists, mixing types and purposes. Destructor uses inconsistent memory deallocation: pFreeHost for sortedSeqs but free() for dbSeqs arrays, creating confusion. The destructor manually iterates and frees each element without helper functions. Variable names are abbreviated inconsistently (dbSeqsLen vs dbSeqsAlignedLen vs totalAminoAcids). The run() method has no error checking, mixes output formatting with logic flaw, uses ternary operator for a simple string choice, and repeats 'params->' calls instead of caching values. Indentation is inconsistent (tabs vs spaces visible in dbSeqsName line). Comments are minimal and don't explain intent. Overall, the code lacks a coherent structure, demonstrates poor separation of concerns, and has multiple maintenance hazards.

Run 1

Code Structure: Initialization, cleanup, and run setup are logically separated, though the snippet omits the constructor signature and the end of run(). Nesting: Shallow overall; cleanup has a manageable loop inside a conditional. Clarity of intent: Most variable names and comments explain sequence storage, resource cleanup, and configuration reporting, but abbreviations such as mat and db and the unexplained pFreeHost reduce clarity. Code length: Concise, with some repetitive initialization and output statements that remain easy to follow. Action granularity: Generally one assignment, deallocation, or print operation per line; the inline conditional in printf adds minor complexity. Reading flow: The progression from initialization to destruction to execution is natural, but inconsistent indentation, spacing, and limited separation between functions interrupt scanning.

Run 2

Code Structure: Initialization, cleanup, and execution are logically separated, but the excerpt lacks a constructor signature and ends mid-function. Nesting: Mostly flat, with only modest nesting in the destructor. Clarity of intent: Member names and comments communicate sequence storage, cleanup, and parameter reporting, though abbreviations and unexplained allocation conventions require context. Code length: Concise overall; repetitive initialization and printing add some verbosity without substantially hindering comprehension. Action granularity: Generally one assignment, deallocation, or print per line, making individual operations easy to follow. Reading flow: Operations proceed naturally from setup to cleanup and parameter retrieval to reporting, but inconsistent tabs, spaces, brace spacing, and the incomplete boundaries reduce visual consistency.

Run 3

Code Structure: Initialization, cleanup, and run setup are logically separated, but the excerpt lacks the constructor signature and ends mid-function. Nesting: Mostly flat, with only modest nesting in destructor cleanup. Clarity of intent: Descriptive member names and comments make sequence storage, resource cleanup, and parameter reporting understandable; abbreviated names such as mat and db and unexplained pFreeHost reduce clarity. Code length: Reasonably concise, although repetitive initialization and printf calls add visual bulk. Action granularity: Each line generally performs one action, making operations easy to follow. Reading flow: Execution order is natural, but inconsistent indentation, spacing, and limited separation between functions disrupt scanning.