Sample

Schnappinger/junit4/org.junit.runners.model.TestTimedOutException

Human rating uses the original dataset scale.

Human4
Lines44

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.7770–1; higher is more readable
85.3Δ 11.1
Scalabrino0.940–1; higher is more readable
96.6Δ 0.2
Dorn0.6820–1; higher is more readable
73.3Δ 23.1
Mi0.7890–1; higher is more readable
95.0Δ 1.3
LLOC10Logical lines; fewer is more readable
72.4Δ 23.9
DeepSeek V4 Pro17.670–20; mean of three runs
83.0Δ 13.4
GPT-6.1 Sol190–20; mean of three runs
92.6Δ 3.8
BTTF0.480–1; higher is more readable
42.9Δ 53.5
Human41–4; original rating
96.4

Views

Source code

package org.junit.runners.model; import java.util.concurrent.TimeUnit; /** * Exception thrown when a test fails on timeout. * * @since 4.12 * */ public class TestTimedOutException extends Exception { private static final long serialVersionUID = 31935685163547539L; private final TimeUnit fTimeUnit; private final long fTimeout; /** * Creates exception with a standard message "test timed out after [timeout] [timeUnit]" * * @param timeout the amount of time passed before the test was interrupted * @param timeUnit the time unit for the timeout value */ public TestTimedOutException(long timeout, TimeUnit timeUnit) { super(String.format("test timed out after %d %s", timeout, timeUnit.name().toLowerCase())); fTimeUnit = timeUnit; fTimeout = timeout; } /** * Gets the time passed before the test was interrupted */ public long getTimeout() { return fTimeout; } /** * Gets the time unit for the timeout value */ public TimeUnit getTimeUnit() { return fTimeUnit; } }

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.560.801−18.506
Source linesThe number of non-empty source lines.44+17.6
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.477−6.715

Intercept 8.87 + feature contributions = 1.249 (log-odds).
Score = sigmoid(1.249) = 0.777.

Score0.94

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.90.067+0.649
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.043+0.527
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.43−0.486
Indentation frequencyHow rapidly indentation changes from line to line.30+0.301
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.30−0.268
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.91.978−0.231
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.43.753+0.202

Intercept 0.07 + feature contributions = 0.764 (log-odds).
Score = sigmoid(0.764) = 0.682.

Score0.789
Score10
Run 1

The code is highly readable due to its clear, logical structure and minimal nesting. The class has a single responsibility—representing a timeout exception—with well-named fields and methods that clearly convey intent. Javadoc comments explain the purpose, constructor, and getters, enhancing clarity. The constructor uses String.format with a line break for readability, though it could be slightly cleaner with a separate message variable. Action granularity is good: each logical step is on its own line, and the reading flow is natural. The only minor drawbacks are the legacy field naming convention (fTimeUnit, fTimeout) and a marginally longer message formatting across two lines. Overall, the code is concise, well-organized, and easy to follow.

Run 2

The code is highly readable. It has a clear, logical structure with a single class, well-organized fields, constructor, and getters. Nesting is essentially flat. Intent is obvious from the class name, Javadoc, and method names. The code is concise and avoids unnecessary verbosity. Each statement is on its own line, respecting action granularity. Reading flow is natural: declaration, fields, constructor, then accessors. Minor deductions: the 'f' prefix on fields is a legacy convention that slightly reduces clarity, and Javadoc for getters could be more precise, but overall it is an exemplary model of clean, maintainable exception code.

Run 3

The code is well-structured and readable. It follows a clear logical organization with package, imports, class declaration, fields, constructor, and methods. Nesting is flat with no conditional or loop complexity. The intent is clear: represent a test timeout exception with the timeout value and unit. Code length is concise, with no unnecessary methods or fields. Action granularity is appropriate—constructor and getters each perform a single clear action. Reading flow is natural: fields, constructor, then getters. Javadoc comments further clarify purpose. Minor deductions might include the slightly unconventional 'f' field prefix, but overall the code is highly readable.

Run 1

Code Structure: Logically organized with constants and fields followed by the constructor and getters. Nesting: Flat method bodies with no nested control flow. Clarity of intent: The class name, documentation, constructor message, and getter names clearly communicate a timeout exception; the legacy f-prefixed field names are slightly less natural. Code length: Short and focused, with useful documentation and no unnecessary logic. Action granularity: Each statement performs a single clear action; the message-formatting expression remains easy to understand. Reading flow: Natural progression from exception definition to initialization and accessors, supported by consistent formatting.

Run 2

Code Structure: Fields, constructor, and getters are logically organized in a small, cohesive exception class. Nesting: No nested control flow; methods are flat and easy to scan. Clarity of intent: The class name, documentation, timeout message, and accessor names clearly communicate purpose. The legacy 'f' field prefixes slightly reduce naming naturalness. Code length: Concise implementation with useful documentation and no unnecessary logic. Action granularity: Each statement performs one clear action; the nested formatting calls remain straightforward. Reading flow: Natural progression from class purpose to stored state, initialization, and accessors, supported by consistent formatting.

Run 3

Code Structure: Logically organized into fields, a constructor, and getters. Nesting: Flat, with no nested control flow. Clarity of intent: The class name, documentation, and method names clearly communicate its purpose; the legacy 'f' field prefixes are slightly less intuitive than plain names. Code length: Concise, with appropriate documentation and no unnecessary implementation. Action granularity: Each statement performs a distinct action; the message formatting expression remains easy to follow. Reading flow: Natural progression from exception metadata to initialization and accessors, supported by consistent formatting.