Sample
Dorn/java/219
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 53.2Δ 2.8 |
| Scalabrino | 0.738 | 0–1; higher is more readable | 80.6Δ 30.2 |
| Dorn | 0.773 | 0–1; higher is more readable | 73.3Δ 22.8 |
| Mi | 0.589 | 0–1; higher is more readable | 62.7Δ 12.3 |
| LLOC | 11 | Logical lines; fewer is more readable | 57.0Δ 6.5 |
| DeepSeek V4 Pro | 12 | 0–20; mean of three runs | 53.6Δ 3.2 |
| GPT-6.1 Sol | 12.33 | 0–20; mean of three runs | 24.4Δ 26.0 |
| BTTF | 0.49 | 0–1; higher is more readable | 42.1Δ 8.4 |
| Human | 3.35 | 1–5; original rating | 50.4 |
Views
Select the downloaded ZIP or its extracted folder. Files stay in your browser.
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 680.691 | −22.463 |
| 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. | 5.122 | −7.683 |
Intercept 8.87 + feature contributions = -9.275 (log-odds).
Score = sigmoid(-9.275) = 0.
| Score | 0.738 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 57.903 | +1.213 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 27 | −0.199 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 27 | +0.197 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.111 | −0.134 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 58 | +0.131 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 31 | −0.061 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.763 | +0.006 |
Intercept 0.07 + feature contributions = 1.223 (log-odds).
Score = sigmoid(1.223) = 0.773.
| Score | 0.589 |
|---|
| Score | 11 |
|---|
Run 1
The code shows moderate readability with some clear intent in the variable and method naming, but suffers from structural issues. The package and imports are orderly, and the test method name ('testAssertNodeTwo') clearly communicates its purpose. However, the polling loop with `for (int second = 0;; second++)` is an unconventional infinite loop pattern that obscures intent and creates mixed action granularity—the break, try-catch, and timeout check happen on different lines but are logically related. The empty catch block is problematic: it silently swallows exceptions with no logging or comment explaining why that is safe. The loop's structure (checking time, then visibility, then sleeping) creates a backward reading flow that forces the reader to mentally reorder operations. The code is not deeply nested, but the try-catch adds an unnecessary layer for what is essentially a polling operation. A more readable approach would use an explicit while loop with named constants for the timeout and polling interval, and handle exceptions meaningfully. The magic number 90 (seconds) and 1000 (milliseconds) should be constants.
Run 2
The code has clear intent and uses a linear top-to-bottom flow which aids readability. However, the for-loop timeout pattern is awkwardly constructed: the incrementing variable 'second' never advances via a clean loop increment, relying on Thread.sleep and a break. The empty catch block is problematic as it silently swallows exceptions, hiding potential issues. The nesting level is manageable but the timeout mechanism could be extracted into a reusable helper. Action granularity is good with one main action per line, though selenium.isVisible is nested within the if statement. Code length is concise for the task. Structure is acceptable but the loop condition and timeout fail logic feel tangled compared to modern alternatives like WebDriverWait. The intent to wait for element visibility is clear but the implementation is unnecessarily verbose and error-prone, reducing overall clarity.
Run 3
The code has some positive qualities: clear method naming, appropriate use of helper methods like loadRequiredJavaScriptModules(), and minimal nesting. However, several issues reduce readability. The wait loop is a non-idiomatic construct that would be clearer as a for loop with a meaningful variable name and condition, though the logic itself is not inherently bad. The empty catch block silently swallowing exceptions without comment or logging is problematic for both maintainability and clarity. The unused 'second' loop variable is misleading - it's incremented but never actually checked in the loop condition. The code shows evidence of a framework-specific testing pattern but lacks modern wait utilities that would make the intent clearer. The comment header and package structure suggest this is part of a larger test suite but the excerpt feels incomplete. Overall, the code is functional but could be more expressive and maintainable with better exception handling and loop construction.
Run 1
Code Structure: The setup followed by a visibility-wait loop is logically organized, but the excerpt has an orphaned comment terminator and lacks closing braces. Nesting: The loop contains a try block and conditional, creating moderate nesting. Clarity of intent: Waiting for the login input is understandable, but the method name suggests a node assertion that is not evident here; the empty catch and generic timeout message obscure failures. Code length: Short overall, though manual polling adds boilerplate. Action granularity: Each statement generally performs one action. Reading flow: Formatting and blank lines support sequential reading, but the infinite-loop syntax, swallowed exceptions, and incomplete boundaries interrupt comprehension.
Run 2
Code Structure: The test follows a logical sequence—open the page, load modules, and wait for a login element—but the snippet begins with a stray comment terminator and lacks closing braces. Nesting: The loop contains a timeout check and a try block with another conditional, creating moderate nesting. Clarity of intent: Selenium calls make the waiting behavior understandable, but the test name does not explain how login visibility verifies node two, and the empty catch silently suppresses exceptions. Code length: The snippet is short, though a reusable explicit-wait helper could replace the polling boilerplate. Action granularity: Each statement generally performs one action per line. Reading flow: Spacing and indentation support sequential reading, but the unconventional infinite-loop syntax, magic timeout values, and incomplete ending interrupt comprehension.
Run 3
Code Structure: The setup and polling loop are logically organized, but the snippet is incomplete, with a stray comment terminator and missing closing braces. Nesting: Moderate nesting through the loop, try/catch, and conditional adds some complexity. Clarity of intent: Waiting for a login input is understandable, but the test name does not explain how this asserts node two; the empty catch silently hides errors. Code length: Fairly concise, though a reusable explicit-wait helper would simplify the polling boilerplate. Action granularity: Each statement performs one action, making individual steps easy to follow. Reading flow: Execution proceeds naturally from navigation to polling and sleeping, but the unusual infinite-loop syntax, hard-coded timeout, and swallowed exceptions interrupt readability.