Sample
int-0e179e74fe0e-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.617 | 0–1; higher is more readable |
| Dorn | 0.073 | 0–1; higher is more readable |
| Mi | 0.053 | 0–1; higher is more readable |
| LLOC | 108 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.156 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 7911.947 | −261.094 |
| Source linesThe number of non-empty source lines. | 206 | +82.4 |
| 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.484 | −6.727 |
Intercept 8.87 + feature contributions = -176.551 (log-odds).
Score = sigmoid(-176.551) = 0.
| Score | 0.617 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 207 | −6.293 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 197 | +6.077 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 197 | −4.1 |
| 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. | 144.957 | −2.475 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 205.829 | +2.467 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 144.961 | +1.534 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.078 | +0.183 |
Intercept 0.07 + feature contributions = -2.536 (log-odds).
Score = sigmoid(-2.536) = 0.073.
| Score | 0.053 |
|---|
| Score | 108 |
|---|
Run 1
The code has significant readability issues. While imports and class structure are logical, the regex patterns are extremely dense and lack explanation or comments. The RULE_PATTERN uses escape sequences that make it nearly unreadable, and magic group indices (1, 2, 4, 6) in parseRules obscure intent. The code has an unexplained dead-code block with startingPosition/endingPosition/travelDistance that serves no purpose, severely harming clarity. Nesting is generally shallow which is positive, but the escapeLiteralBackReferences method has confusing while-loop logic with unclear variable names like backRefNum and backRefIndex. Some comments help explain the back-reference escaping logic, but they are lengthy blocks that interrupt flow. Action granularity is mostly reasonable, with one operation per line in most areas. Overall the code mixes clear sections with deeply cryptic regex manipulation, reducing maintainability.
Run 2
The code has several readability issues. The regex pattern RULE_PATTERN is extremely complex and undocumented, making the parsing logic nearly impossible to understand quickly. There is a random block of dead code inside the apply() method (variables startingPosition, endingPosition, travelDistance) that serves no purpose, disrupting flow and clarity. The escapeLiteralBackReferences method has extensive comments but the logic remains complex with non-obvious truncation behavior. The code uses long lines with multiple method calls chains. Nesting is moderate but the regex-based parser and error checking add significant cognitive load. Positive aspects: the class has clear intent (Kafka SSL principal mapping), reasonable grouping of methods (splitRules, parseRules, apply), and descriptive method names. The Rule inner class is well-encapsulated and has a clear toString. However, the overall readability suffers from excessive regex complexity, unclear variable naming in some cases (e.g., matcher.group indices), unexplained magic numbers in regex groups, and the dead code block. The action granularity is inconsistent - some lines combine too much logic. The code would benefit from extracting better-named helper methods and adding documentation explaining the mapping rule syntax.
Run 3
The code has some structural organization with helper methods and constants, but overall readability suffers from several issues. There is an obvious dead code block inside the 'apply' method that computes 'travelDistance' and then does nothing with it. The 'RULE_PATTERN' regex is extremely complex and poorly documented, making intent unclear. The 'escapeLiteralBackReferences' method is very hard to follow with multiple levels of nesting and unclear variable names like 'backRefNum' and 'backRefIndex'. The class has mixed responsibilities and the action granularity varies, with multiple operations packed into single lines in the parsing logic. The reading flow is disorganized—comments are redundant or overly verbose in places, and the natural progression of logic is interrupted by the dead code and complex regex handling. While the code is not completely unreadable, it requires significant effort to understand.
Run 1
Code Structure: Parsing, mapping, and replacement handling are sensibly separated into methods and a Rule class, but the unrelated travel-distance block disrupts cohesion. Nesting: Generally shallow, with moderate nesting in back-reference processing and rule formatting. Clarity of intent: Descriptive method names and explanatory comments help, but dense regexes, numbered capture groups, and abbreviated variables obscure details. Code length: Mostly proportionate to the functionality; the unused arithmetic block and some verbose comments add unnecessary length. Action granularity: Statements generally perform one action per line, although a few expressions combine several operations. Reading flow: The progression from parsing to applying rules is natural, but inconsistent indentation, long lines, extra whitespace, and the irrelevant block interrupt it.
Run 2
Code Structure: Parsing, mapping, and rule behavior are sensibly separated into methods and a nested class, but an unrelated travel-distance block disrupts apply(). Nesting: Mostly shallow, with moderate nesting in back-reference handling and toString(). Clarity of intent: Descriptive names and explanatory comments help, but dense regular expressions, numeric capture-group references, and the irrelevant block obscure intent. Code length: Generally appropriate, though unused distance calculations and verbose string-building add unnecessary length. Action granularity: Most statements perform one action per line; a few long expressions combine several operations and require extra effort to read. Reading flow: Method organization and early returns support natural progression, but inconsistent indentation, extra blank lines, and the inserted block interrupt it.
Run 3
Code Structure: Responsibilities are logically separated into splitting, parsing, mapping, and rule application, but the unrelated travel-distance block disrupts cohesion. Nesting: Generally shallow, with moderate nesting in back-reference handling and string formatting. Clarity of intent: Descriptive method and field names help, and comments explain replacement behavior; however, dense regexes, numeric capture-group references, and abbreviated variables require careful interpretation. Code length: Mostly proportionate to functionality, but unused travel-distance calculations and some verbose formatting add unnecessary length. Action granularity: Statements generally perform one action per line, although chained calls and long constructor arguments increase cognitive load. Reading flow: Method ordering and early returns support natural progression, but the poorly indented extraneous block, long lines, and inconsistent comment spacing interrupt it.