Sample

Schnappinger/junit4/org.junit.internal.ExactComparisonCriteria

Human rating uses the original dataset scale.

Human3.95
Lines10

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.3450–1; higher is more readable
76.6Δ 7.1
Scalabrino0.7080–1; higher is more readable
40.4Δ 29.1
Dorn0.6170–1; higher is more readable
69.0Δ 0.5
Mi0.6280–1; higher is more readable
67.7Δ 1.8
LLOC2Logical lines; fewer is more readable
94.6Δ 25.1
DeepSeek V4 Pro17.670–20; mean of three runs
83.0Δ 13.5
GPT-6.1 Sol200–20; mean of three runs
99.3Δ 29.9
BTTF0.6910–1; higher is more readable
78.5Δ 9.1
Human3.951–4; original rating
69.5

Views

Source code

package org.junit.internal; import org.junit.Assert; public class ExactComparisonCriteria extends ComparisonCriteria { @Override protected void assertElementsEqual(Object expected, Object actual) { Assert.assertEquals(expected, actual); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
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.562−6.842
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.202.119−6.67
Source linesThe number of non-empty source lines.10+4

Intercept 8.87 + feature contributions = -0.642 (log-odds).
Score = sigmoid(-0.642) = 0.345.

Score0.708

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.11+0.647
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.72+0.616
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.10−0.391
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.9.849−0.272
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.075+0.212

Intercept 0.07 + feature contributions = 0.475 (log-odds).
Score = sigmoid(0.475) = 0.617.

Score0.628
Score2
Run 1

The code is highly readable due to its clear structure and intent. It defines a single-purpose class that extends a base class and overrides one method, demonstrating good separation of concerns. Nesting is minimal, with only package and class-level blocks. The method name 'assertElementsEqual' clearly conveys its purpose, and the single line of logic delegates to JUnit's assertEquals, keeping action granularity at one action per line. Code length is concise but not overly abbreviated. Reading flow is natural—package, imports, class declaration, method override—following standard Java conventions. Minor deductions: the class could benefit from a brief Javadoc comment explaining its role or when exact element comparison is appropriate, and the method lacks documentation about its contract. Overall, the code is straightforward, maintainable, and easy to understand at a glance.

Run 2

The code is highly readable. It has a clear, logical structure with a single class extending a parent class, all organized in a proper package. Nesting is minimal (one method inside a class). The intent is obvious: to provide an exact comparison criteria using JUnit's assertEquals. The code is concise and not unnecessarily long. Action granularity is good, with one clear method call. Reading flow is natural and straightforward. The only minor deduction is due to the lack of a class-level Javadoc comment, which would further clarify the purpose for future maintainers.

Run 3

The code is highly readable. It has a clear, single-purpose structure: a class extending a base class and overriding one method. The package and import statements are standard and appropriate. Nesting is minimal, with only one method containing a single line of delegation. Intent is clear—the class name and method name explicitly indicate exact comparison criteria and equating elements. Code length is concise with no unnecessary boilerplate. Action granularity is ideal—one action per line. Reading flow is natural, moving from package declaration to import to class definition to method implementation. The only minor drawbacks are the missing Javadoc and the reliance on external context (the base class) to fully understand behavior, which prevents a perfect score.

Run 1

Code Structure: Logically organized with a package declaration, import, and a focused subclass. Nesting: Minimal, limited to the class and method. Clarity of intent: Descriptive class and method names, plus @Override, make the exact element-comparison purpose clear. Code length: Concise, with no unnecessary logic or boilerplate beyond the required structure. Action granularity: The method performs one clearly expressed assertion on a single line. Reading flow: Standard Java formatting and declaration order make the code easy to follow.

Run 2

Code Structure: Clean organization with a package declaration, import, and focused subclass. Nesting: Minimal, limited to the class and method. Clarity of intent: Descriptive class and method names, the override annotation, and direct delegation to Assert.assertEquals clearly express the purpose. Code length: Concise, with no unnecessary logic or boilerplate. Action granularity: A single assertion occupies its own line. Reading flow: Standard Java layout and consistent formatting make the code easy to follow.

Run 3

Code Structure: Package, import, class, and overridden method are logically organized. Nesting: Minimal, with only the class and method scopes. Clarity of intent: Descriptive class and method names, the @Override annotation, and direct delegation to Assert.assertEquals clearly express exact element comparison. Code length: Concise, with no unnecessary statements. Action granularity: The method performs one action on one line. Reading flow: Conventional Java formatting and a straightforward top-to-bottom layout make the code easy to follow.