Sample

Schnappinger/junit4/org.junit.internal.runners.InitializationError

Human rating uses the original dataset scale.

Human4
Lines30

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0020–1; higher is more readable
68.9Δ 27.5
Scalabrino0.7530–1; higher is more readable
49.7Δ 46.7
Dorn0.7490–1; higher is more readable
79.2Δ 17.2
Mi0.7680–1; higher is more readable
93.4Δ 3.0
LLOC8Logical lines; fewer is more readable
73.8Δ 22.6
DeepSeek V4 Pro180–20; mean of three runs
91.4Δ 5.0
GPT-6.1 Sol190–20; mean of three runs
92.6Δ 3.8
BTTF0.7130–1; higher is more readable
84.5Δ 11.9
Human41–4; original rating
96.4

Views

Source code

package org.junit.internal.runners; import java.util.Arrays; import java.util.List; /** * Use the published version: {@link org.junit.runners.InitializationError} * This may disappear as soon as 1 April 2009 */ @Deprecated public class InitializationError extends Exception { private static final long serialVersionUID = 1L; private final List<Throwable> fErrors; public InitializationError(List<Throwable> errors) { fErrors = errors; } public InitializationError(Throwable... errors) { this(Arrays.asList(errors)); } public InitializationError(String string) { this(new Exception(string)); } public List<Throwable> getCauses() { return fErrors; } }

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.605.403−19.978
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.687−7.03

Intercept 8.87 + feature contributions = -6.138 (log-odds).
Score = sigmoid(-6.138) = 0.002.

Score0.753

Feature contributions

FeatureValueContribution
(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.74.968+0.49
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.75+0.406
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.078+0.183
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.868+0.008

Intercept 0.07 + feature contributions = 1.093 (log-odds).
Score = sigmoid(1.093) = 0.749.

Score0.768
Score8
Run 1

The code is well-structured with clear logical organization: package, imports, Javadoc, deprecated annotation, class definition, and methods. Nesting is minimal—no deep indentation or conditional complexity. Intent is clear: a deprecated exception class for initialization errors, with three convenient constructors. Code length is concise; there is no unnecessary code. Action granularity is appropriate—each line performs a single purpose (delegating constructors, returning the error list). Reading flow is natural, moving from class-level documentation to fields, constructors, and then the accessor method. Minor deductions could be for the outdated Javadoc date and single-letter field prefix 'f', but these do not meaningfully impair readability.

Run 2

The code is highly readable due to its clear structure, minimal nesting, and concise implementation. Each method performs a single, well-defined action, and the flow from constructors to the getter is logical. Naming is descriptive, and the deprecated class with documentation signals intent clearly. The only minor detraction is the abbreviated field name 'fErrors', which is slightly less intuitive, but this is a common convention in older Java code. Overall, the code is straightforward and easy to follow.

Run 3

The code is highly readable. It has a clear, logical structure with a concise class definition and well-organized constructors. Nesting is minimal, with no deeply nested logic. The intent is unambiguous: it defines a deprecated exception type for storing initialization errors. The code is compact without being cryptic, avoiding unnecessary verbosity. Each constructor delegates cleanly, maintaining a single action per line. The reading flow is natural, starting with imports, class declaration, fields, constructors, and a simple accessor. The only minor drawbacks are the single-letter field prefix 'f' (a dated convention) and the lack of Javadoc on public methods, but these do not significantly hinder comprehension.

Run 1

Code Structure: Clearly organized exception class with fields, constructors, and an accessor. Nesting: Flat, with no nested control flow. Clarity of intent: Constructor delegation and getCauses() make the purpose clear; the deprecation documentation points to the replacement. However, fErrors and string are less descriptive than causes and message. Code length: Concise, with no unnecessary implementation. Action granularity: Each statement performs one focused action. Reading flow: Natural progression from metadata and state to construction and retrieval, supported by consistent formatting.

Run 2

Code Structure: The class is logically organized, with fields followed by constructors and an accessor. Nesting: There is no nested control flow, making the code easy to scan. Clarity of intent: The exception wrapper and constructor overloads clearly express their purpose, while the deprecation documentation directs readers to the replacement. However, fErrors is a dated naming convention, and string is less descriptive than message. Code length: The implementation is concise without unnecessary repetition; constructor delegation avoids duplicated initialization. Action granularity: Each statement performs a single action. Reading flow: Imports, documentation, fields, constructors, and the getter follow a natural order. Minor naming weaknesses prevent a perfect score.

Run 3

Code Structure: The class is logically organized into fields, constructors, and an accessor. Nesting: There is no unnecessary nesting; all methods are flat. Clarity of intent: The exception's purpose and constructor delegation are clear, and the deprecation documentation identifies its replacement. However, fErrors and string are less descriptive than causes and message. Code length: The implementation is concise without redundant logic. Action granularity: Each statement performs a single action, with constructor delegation keeping initialization centralized. Reading flow: The progression from state to construction to retrieval is natural and easy to follow.