Sample

Scalabrio54

Human rating uses the original dataset scale.

DatasetScalabrino
Human4.11
Lines26

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
27.1Δ 51.0
Scalabrino0.3220–1; higher is more readable
28.6Δ 49.5
Dorn0.4410–1; higher is more readable
48.2Δ 29.9
Mi0.2270–1; higher is more readable
50.8Δ 27.4
LLOC21Logical lines; fewer is more readable
23.1Δ 55.0
DeepSeek V4 Pro150–20; mean of three runs
61.6Δ 16.6
GPT-6.1 Sol180–20; mean of three runs
83.7Δ 5.5
BTTF0.4550–1; higher is more readable
25.1Δ 53.0
Human4.111–5; original rating
78.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.1202.554−39.684
Source linesThe number of non-empty source lines.26+10.4
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.013−6.019

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

Score0.322

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.1−0.703
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.91+0.664
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.90.962−0.188
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.25−0.153
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.26+0.116
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.24.62−0.066
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.095+0.021

Intercept 0.07 + feature contributions = -0.238 (log-odds).
Score = sigmoid(-0.238) = 0.441.

Score0.227
Score21
Run 1

The code is fairly readable due to its clear if-else structure and flat nesting. Each branch handles a distinct type, and action granularity is generally one operation per line. The recursive call and loop are simple and easy to follow. However, readability is reduced by the use of raw type casting (multiple instanceof checks), which makes the intent slightly less obvious and adds boilerplate. The ternary for suite naming and the fallback comment are helpful, but the method could be shortened using modern pattern matching. Overall, structure and flow are logical, but verbosity and type-checking patterns prevent a higher score.

Run 2

The code demonstrates clear structure via a chain of type checks (instanceof) with distinct branches, each handling one case. It maintains relatively flat nesting—only one loop introduces a second level. Intent is mostly evident: convert a Test object into a Description, recursively handling suites and decorators. Individual actions are grouped per line, though some lines combine multiple operations (e.g., creating and adding a child). The ternary expression for name is concise but slightly hurts clarity. Overall length is appropriate, and the fallback comment aids understanding. Minor issues include repeated casting and lack of explanatory comments for the less common branches, but the flow remains natural and predictable.

Run 3

The code is well-structured, with a clear pattern of type-checking and conditional branching. Each branch handles one specific type, and the logic flows naturally from specific cases (TestCase, TestSuite) to more generic ones (Describable, TestDecorator) before falling back to a default. Nesting is minimal, with only a single loop in the TestSuite branch. The method is concise and focused, performing one action per line in most cases. Variable names are descriptive, and the recursive call is clear. One minor readability concern is the ternary expression on line 6, which slightly compresses logic. Overall, the code is maintainable and easy to follow, but could benefit from a brief comment explaining the fallback default case's rationale.

Run 1

Code Structure: Well-organized type-based branches separate the handling of each test category. Nesting: Shallow overall, with only the suite iteration nested inside a branch. Clarity of intent: The method name, description-building calls, and recursive handling clearly communicate its purpose; abbreviated names such as tc, ts, and n slightly reduce clarity. Code length: Concise and proportionate to the supported cases, with little unnecessary code. Action granularity: Statements generally perform one action each, making construction and child addition easy to follow. Reading flow: Consistent branch formatting and direct returns provide a natural progression, though repeated instanceof checks and casts add minor visual repetition.

Run 2

Code Structure: A well-organized type-based conditional separates each supported test category and provides a fallback. Nesting: Shallow overall, with only the suite loop nested inside a branch. Clarity of intent: The method name, description factories, and recursive calls clearly communicate conversion into a Description; abbreviated variables such as tc, ts, and n slightly reduce clarity. Code length: Concise, with little unnecessary code, though the else branches could be omitted after returning branches. Action granularity: Each statement performs a focused action, and intermediate variables make suite construction easy to follow. Reading flow: Handling proceeds naturally from individual tests to suites, adapters, decorators, and the fallback. Consistent formatting supports readability, although the significance of branch ordering is not explained.

Run 3

Code Structure: Well-organized type-based branches separate distinct test representations. Nesting: Shallow overall, with only the suite loop adding another level. Clarity of intent: The method name, description factory calls, and recursive processing clearly convey its purpose; abbreviations such as tc, ts, and n slightly reduce clarity. Code length: Concise for the number of supported types, though repeated casts and else branches add minor verbosity. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: A natural progression from individual tests to suites, adapters, decorators, and a fallback makes the method straightforward to scan.