Sample

MBJP/7

Human rating uses the original dataset scale.

DatasetMBJP
Human3.5
Lines24

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0190–1; higher is more readable
56.2Δ 6.2
Scalabrino0.7970–1; higher is more readable
56.2Δ 6.2
Dorn0.5920–1; higher is more readable
37.5Δ 12.5
Mi0.4080–1; higher is more readable
12.5Δ 37.5
LLOC7Logical lines; fewer is more readable
81.2Δ 31.2
DeepSeek V4 Pro10.670–20; mean of three runs
25.0Δ 25.0
GPT-6.1 Sol17.670–20; mean of three runs
43.8Δ 6.2
BTTF0.5480–1; higher is more readable
43.8Δ 6.2
Human3.51–5; original rating
50.0

Views

Source code

import java.util.*; import java.util.regex.*; class FindCharLong { /** * * Write a function to find all words which are at least 4 characters long in a string by using regex. * * > findCharLong("Please move back to stream") * ["Please", "move", "back", "stream"] * > findCharLong("Jing Eco and Tech") * ["Jing", "Tech"] * > findCharLong("Jhingai wulu road Zone 3") * ["Jhingai", "wulu", "road", "Zone"] */ public static List<String> findCharLong(String text) { List<String> result = new ArrayList<>(); Pattern pattern = Pattern.compile("\\\\b\\\\w{4,}\\\\b"); Matcher matcher = pattern.matcher(text); while (matcher.find()) { result.add(matcher.group()); } return result; } }

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.465.293−15.355
Source linesThe number of non-empty source lines.24+9.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.694−7.042

Intercept 8.87 + feature contributions = -3.926 (log-odds).
Score = sigmoid(-3.926) = 0.019.

Score0.797

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.107.958+0.937
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.107.917−0.906
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.064+0.318
Indentation frequencyHow rapidly indentation changes from line to line.15−0.218
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.24+0.187
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.22.807−0.091
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.15+0.077

Intercept 0.07 + feature contributions = 0.374 (log-odds).
Score = sigmoid(0.374) = 0.592.

Score0.408
Score7
Run 1

The code has a clear overall structure with a single public method and a simple regex approach, but several issues make it harder to read than it should be. The method name and class name are somewhat unclear (FindCharLong is not descriptive; findCharLong is misleading since it doesn't 'find characters'). The regex pattern uses excessive backslashes (\\b and \\w) which suggest escaping errors that would cause incorrect matching—this introduces ambiguity about intent. The code lacks any validation for null or empty input. The while loop is straightforward but the overall flow feels minimal and natural. The documentation comments are helpful but could be cleaner. Action granularity is decent—one main action per line. However, the excessive escaping and unclear naming significantly reduce readability despite the simple structure.

Run 2

The code is well-structured with a clear single-purpose method, proper use of regex, and consistent formatting. While the variable naming and Javadoc are clear, the unnecessary import of java.util.regex.* and a slightly misleading regex escaping pattern (\\b) slightly reduce clarity.

Run 3

The code is functional but suffers from a critical readability issue: the regex pattern is over-escaped due to copy/paste from Java string literals into a raw string context. This makes the intent unclear and would cause a runtime failure in actual use. Beyond that, structure is logical but unnecessary imports (`java.util.*`, `java.util.regex.*`) could be more specific. Nesting is flat, and action granularity is good — one logical action per line. Reading flow is mostly natural. The excessively long Javadoc with examples is clutter rather than helpful documentation. Overall, the core logic is simple, but the pattern escaping error and verbose comments make the code confusing and less maintainable.

Run 1

Code Structure: Imports, class, documentation, and method are logically organized. Nesting: A single shallow loop keeps control flow simple. Clarity of intent: Documentation and examples clearly explain the goal, and variable names are descriptive, though findCharLong is vague and the regex appears overescaped, obscuring its intended behavior. Code length: The implementation is concise with no unnecessary logic. Action granularity: Each statement performs one clear action. Reading flow: Initialization, matching, collection, and return follow a natural sequence. Wildcard imports and minor documentation formatting reduce polish.

Run 2

Code Structure: A single focused method logically separates result initialization, regex setup, matching, and return. Nesting: Only one shallow loop keeps complexity low. Clarity of intent: The documentation and examples clearly explain the goal, and local variable names are descriptive, though findCharLong is awkwardly named. The overescaped regex obscures the intended word-boundary matching and does not implement the documented behavior. Code length: The implementation is concise; the documentation is useful despite minor formatting noise. Action granularity: Each statement performs one clear action. Reading flow: Execution proceeds naturally from setup through collection to return. Wildcard imports slightly reduce dependency clarity.

Run 3

Code Structure: Imports, class, documentation, and method are logically organized. Nesting: A single shallow loop keeps complexity low. Clarity of intent: The documentation, examples, and descriptive local names clearly communicate the goal, though findCharLong is less precise than a word-oriented name. The regex is overescaped for Java, obscuring its intended word-boundary matching and contradicting the documented behavior. Code length: The implementation is concise without unnecessary steps; the examples provide useful context. Action granularity: Each statement performs one distinct action. Reading flow: Execution proceeds naturally from result initialization through regex compilation, matching, collection, and return. Wildcard imports and minor documentation formatting reduce polish.