Sample
Schnappinger/aoi/nik777.xlate.StringEditor
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 36.5Δ 12.4 |
| Scalabrino | 0.867 | 0–1; higher is more readable | 80.5Δ 56.4 |
| Dorn | 0.054 | 0–1; higher is more readable | 29.4Δ 5.3 |
| Mi | 0.541 | 0–1; higher is more readable | 39.6Δ 15.5 |
| LLOC | 99 | Logical lines; fewer is more readable | 25.2Δ 1.2 |
| DeepSeek V4 Pro | 11 | 0–20; mean of three runs | 12.0Δ 12.0 |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs | 9.4Δ 14.7 |
| BTTF | 0.407 | 0–1; higher is more readable | 35.0Δ 10.9 |
| Human | 2.99 | 1–4; original rating | 24.1 |
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. | 5981.017 | −197.374 |
| Source linesThe number of non-empty source lines. | 311 | +124.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.831 | −7.246 |
Intercept 8.87 + feature contributions = -71.35 (log-odds).
Score = sigmoid(-71.35) = 0.
| Score | 0.867 |
|---|
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. | 312 | −10.011 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 198 | +6.111 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 198 | −4.123 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 310.825 | +3.935 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 77.683 | +0.449 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.058 | +0.375 |
| 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. | 78.971 | +0.32 |
Intercept 0.07 + feature contributions = -2.873 (log-odds).
Score = sigmoid(-2.873) = 0.054.
| Score | 0.541 |
|---|
| Score | 99 |
|---|
Run 1
The code has reasonable structure (clear fields, constructor, size/edit/add/compile methods) and good Javadoc, but the core methods suffer from deep nesting and unclear flow. The `edit` method uses a large switch inside conditionals with multiple break statements and variable reassignments, making its logic hard to follow. Some branches (e.g., case 'p') have confusing group parsing with off-by-one character indexing. `compile` is a long method with nested conditionals, magic numbers, and variable reuse (`cut`, `cut2`) that obscures intent. Action granularity is mixed: some operations are compact while others pack multiple actions per line. The regex parsing is terse and relies on implicit delimiter semantics. Overall, it is maintainable by an experienced Java developer but not immediately readable. The score would improve with smaller helper methods, fewer mutable variables reused across branches, and simpler control flow (e.g., early returns or state objects).
Run 2
The code shows dated style with several readability issues. Structure is somewhat organized (clear separation of methods, Javadoc present) but the core edit/compile logic is tangled. Nesting is moderate but switch cases contain lengthy inline logic. Intent is documented but actual code is ambiguous in places: magic numbers, single-letter variables (op, cut, cut2), and unclear control flow reduce clarity. Code length is excessive for what it does, especially compile() and edit(). Action granularity is poor—multiple actions are packed into lines (e.g., group digit accumulation, switch-based value concatenation). Reading flow is disjointed: constants like EMPTY use anonymous subclass with odd indentation; while loops have non-obvious termination; conditional branches lack braces. The code works but requires careful study to understand, and doesn't meet modern readability expectations.
Run 3
The code is generally structured but has several readability issues. The main edit() method uses a large switch with inconsistent braces and indentation, and one case ('p') is missing its break, relying on fall-through. Variable names like sb, pos, group, cut, cut2 are terse and ambiguous. The compile() method mixes parsing, validation, and chaining logic in one long method, making intent harder to follow. Nesting is moderate but uneven; some blocks are flat while others have nested switches inside switch cases. Action granularity is mixed: some lines pack multiple operations (e.g., matcher.appendReplacement in loops), while others are clear. Reading flow suffers from the dense Javadoc and inconsistent formatting. Positive aspects include a clear class purpose, logical field grouping, and helpful comments. Overall, it is understandable but requires effort to parse the editing logic.
Run 1
Code Structure: Methods separate editing, compilation, and rule chaining logically, but compile combines parsing, operation configuration, and chain construction. Nesting: Mostly moderate, with nested switches and conditionals making compilation harder to follow. Clarity of intent: Extensive documentation and operation comments explain the purpose, but abbreviated names such as op, qual, cut, nx, and sb obscure details. Character-coded operations and index manipulation require careful interpretation. Code length: Implementation is reasonably compact, although lengthy documentation and duplicated uppercase/lowercase cases add bulk. Action granularity: Most statements perform one action, but inline loop bodies, combined declarations, and increments embedded in character access complicate tracing. Reading flow: Method organization is sensible, but inconsistent indentation, compressed formatting, shared mutable fields, and recursive chaining interrupt readability. Overall, understandable with effort, especially in the command parser.
Run 2
Code Structure: Methods logically separate editing, compilation, and rule chaining, but compile and edit each combine several responsibilities. Nesting: Generally moderate, although nested switches and conditionals make command parsing harder to follow. Clarity of intent: Class documentation and operation comments explain the purpose well; terse identifiers such as op, cut, cut2, nx, and sb obscure implementation details, especially delimiter handling and group parsing. Code length: The implementation is reasonably compact, but extensive, sometimes repetitive documentation interrupts navigation. Action granularity: Most statements perform one action, though inline conditionals, combined declarations, and an increment embedded in a condition increase cognitive load. Reading flow: Method organization and switch-based dispatch are natural, but inconsistent spacing, compressed method bodies, omitted braces, and character-to-index dispatch reduce smoothness. Overall, understandable with careful reading, but parsing logic and formatting prevent high readability.
Run 3
1. Code Structure: Methods separate editing, compilation, and chaining logically, but compile() mixes parsing, validation, and state mutation. 2. Nesting: Mostly shallow, although nested switches and conditionals in compile() require extra attention. 3. Clarity of intent: Extensive documentation explains command syntax and purpose; terse names such as op, cut, cut2, and nx, plus character-based dispatch, obscure implementation details. 4. Code length: Generally compact, but lengthy documentation and duplicated uppercase/lowercase cases add bulk; parsing could benefit from helper methods. 5. Action granularity: Most statements perform one action, but inline conditionals, combined declarations, and pos++ inside a condition make some lines harder to interpret. 6. Reading flow: Method ordering and comments support navigation, while inconsistent spacing, indentation, omitted braces, and dense substring/index arithmetic interrupt the flow.