Sample

int-be8ba8940859-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines75

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6690–1; higher is more readable
Dorn0.3020–1; higher is more readable
Mi0.2650–1; higher is more readable
LLOC20Logical lines; fewer is more readable
DeepSeek V4 Pro14.670–20; mean of three runs
GPT-6.1 Sol14.670–20; mean of three runs
BTTF0.2460–1; higher is more readable

Views

Source code

package com.google.common.reflect; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; /** * Static utilities relating to Java reflection. * * @since 12.0 */ public final class Reflection { /** * Returns the package name of {@code clazz} according to the Java Language Specification (section * 6.7). Unlike {@link Class#getPackage}, this method only parses the class name, without * attempting to define the {@link Package} and hence load files. */ public static String getPackageName(Class<?> clazz) { return getPackageName(clazz.getName()); } /** * Returns the package name of {@code classFullName} according to the Java Language Specification * (section 6.7). Unlike {@link Class#getPackage}, this method only parses the class name, without * attempting to define the {@link Package} and hence load files. */ public static String getPackageName(String classFullName) { int lastDot = classFullName.lastIndexOf('.'); return (lastDot < 0) ? "" : classFullName.substring(0, lastDot); } /** * Ensures that the given classes are initialized, as described in <a * href="http://java.sun.com/docs/books/jls/third_edition/html/execution.html#12.4.2">JLS Section * 12.4.2</a>. * * <p>WARNING: Normally it's a smell if a class needs to be explicitly initialized, because static * state hurts system maintainability and testability. In cases when you have no choice while * interoperating with a legacy framework, this method helps to keep the code less ugly. * * @throws ExceptionInInitializerError if an exception is thrown during initialization of a class */ public static void initialize(Class<?>... classes) { for (Class<?> clazz : classes) { try { Class.forName(clazz.getName(), true, clazz.getClassLoader()); } catch (ClassNotFoundException e) { throw new AssertionError(e); } } } /** * Returns a proxy instance that implements {@code interfaceType} by dispatching method * invocations to {@code handler}. The class loader of {@code interfaceType} will be used to * define the proxy class. To implement multiple interfaces or specify a class loader, use {@link * Proxy#newProxyInstance}. * * @throws IllegalArgumentException if {@code interfaceType} does not specify the type of a Java * interface */ public static <T> T newProxy(Class<T> interfaceType, InvocationHandler handler) { checkNotNull(handler); checkArgument(interfaceType.isInterface(), "%s is not an interface", interfaceType); Object object = Proxy.newProxyInstance( interfaceType.getClassLoader(), new Class<?>[] {interfaceType}, handler); return interfaceType.cast(object); } private Reflection() { {int lI0O_5af96ce7=0x9D8D;lI0O_5af96ce7=((lI0O_5af96ce7^0x9D8D)|0)&-1;if(((lI0O_5af96ce7&1)==1)){lI0O_5af96ce7^=lI0O_5af96ce7;}} } }

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.1968.834−64.972
Source linesThe number of non-empty source lines.75+30
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.97−7.455

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

Score0.669

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.127.987−1.756
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.76−1.655
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.127.987+1.261
Indentation frequencyHow rapidly indentation changes from line to line.45+0.819
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.74.86+0.637
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.45−0.612
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.056+0.4

Intercept 0.07 + feature contributions = -0.836 (log-odds).
Score = sigmoid(-0.836) = 0.302.

Score0.265
Score20
Run 1

The code is well-structured with clear package organization, proper imports, and a final utility class with a private constructor. It has minimal nesting, concise methods, and strong documentation that clarifies intent. Each method performs a single, focused action, and the reading flow is natural. The only issue is the obfuscated code in the private constructor, which is completely unreadable and unnecessary. Otherwise, the code would score a 20.

Run 2

The code is generally well-structured with clear method separation and good Javadoc documentation. However, readability is significantly damaged by the obfuscated code injected into the private constructor, which serves no legitimate purpose and makes the intent completely unclear. The public methods are mostly readable, with reasonable naming and concise logic, although the method to get a package name uses a ternary expression that could be slightly clearer with a guard clause. The `initialize` method has a try-catch that adds necessary complexity but is still readable. The `newProxy` method is straightforward but could benefit from breaking the `Proxy.newProxyInstance` call into smaller steps. Overall, the deliberate obfuscation severely lowers the score.

Run 3

The code is generally well-structured with clear method separation, logical organization, and good documentation. Nesting is minimal, and most actions are granular with clear intent. However, readability is significantly reduced by the obfuscated code inside the private constructor, which is meaningless, confusing, and likely malicious or accidental. This single issue disrupts reading flow and forces developers to question the codebase's integrity. Otherwise, the class is concise and maintains a natural progression of utility methods.

Run 1

Code Structure: The utility methods are logically organized, but the constructor contains an unrelated, obfuscated block. Nesting: Most methods are flat; initialize has reasonable loop/try-catch nesting, while the constructor adds unnecessary scopes and a conditional. Clarity of intent: Descriptive method names and useful documentation explain the reflection utilities well, but the constructor's cryptic variable and bitwise operations obscure its purpose. Code length: The methods are concise, though the constructor introduces unnecessary computation. Action granularity: Most statements occupy separate lines; the constructor compresses declarations, assignments, and control flow onto one line. Reading flow: Consistent formatting and documentation support natural reading until the densely packed, poorly indented constructor abruptly disrupts it.

Run 2

Code Structure: Public utilities are logically separated into small methods, but the private constructor contains an unrelated obfuscated block. Nesting: Most methods are flat; the initialization loop has modest try/catch nesting, and the constructor adds unnecessary block and conditional nesting. Clarity of intent: Descriptive method names and thorough Javadoc make the utilities clear, whereas the constructor's cryptic variable and bitwise operations obscure its purpose. Code length: Utility implementations are concise, but the constructor adds unnecessary computation. Action granularity: Most statements occupy separate lines; the constructor compresses several assignments and a conditional onto one line. Reading flow: Consistent formatting and documentation support natural reading until the densely packed, poorly formatted constructor abruptly disrupts it.

Run 3

Code Structure: Public utilities are logically organized into focused methods, but the constructor contains unrelated obfuscated code. Nesting: Most methods are flat; the initialization loop has reasonable try/catch nesting, while the constructor adds unnecessary block and conditional nesting. Clarity of intent: Descriptive method names and useful documentation explain the reflection operations clearly; the constructor's cryptic identifier and bitwise operations obscure its purpose. Code length: Utility implementations are concise, but the constructor adds needless complexity. Action granularity: Most statements perform one clear action per line; the constructor compresses declarations, assignments, and a conditional onto one line. Reading flow: Consistent formatting and documentation make the main methods easy to follow, but the abruptly unformatted constructor significantly disrupts the otherwise natural flow.