Sample
Schnappinger/jsweet/def.dom.CloseEvent
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 67.2Δ 2.2 |
| Scalabrino | 0.526 | 0–1; higher is more readable | 11.6Δ 57.8 |
| Dorn | 0.006 | 0–1; higher is more readable | 16.2Δ 53.3 |
| Mi | 0.008 | 0–1; higher is more readable | 2.0Δ 67.5 |
| LLOC | 6 | Logical lines; fewer is more readable | 79.7Δ 10.2 |
| DeepSeek V4 Pro | 13 | 0–20; mean of three runs | 21.1Δ 48.3 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 55.3Δ 14.2 |
| BTTF | 0.452 | 0–1; higher is more readable | 39.3Δ 30.2 |
| Human | 3.95 | 1–4; original rating | 69.5 |
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. | 442.609 | −14.606 |
| 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.591 | −6.887 |
| Source linesThe number of non-empty source lines. | 11 | +4.4 |
Intercept 8.87 + feature contributions = -8.223 (log-odds).
Score = sigmoid(-8.223) = 0.
| Score | 0.526 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 203.917 | −4.972 |
| 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. | 12 | +0.611 |
| 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. | 10.863 | −0.258 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.081 | +0.155 |
Intercept 0.07 + feature contributions = -5.191 (log-odds).
Score = sigmoid(-5.191) = 0.006.
| Score | 0.008 |
|---|
| Score | 6 |
|---|
Run 1
The code is concise and straightforward, with clear intent for representing a CloseEvent. Structure is logical, with fields, a native method, prototype, and constructor grouped together. Nesting is nonexistent, and reading flow is natural for a simple data class. However, readability is slightly reduced by a long method signature on a single line, which combines multiple parameters and actions, making it harder to scan. The use of fully qualified names like java.lang.String and java.lang.Boolean adds verbosity and clutters the code. The empty constructor is also unclear in purpose. Overall, the code is maintainable but could benefit from line breaks in the method signature and use of imports to improve clarity.
Run 2
The code is concise and clearly structured. It defines a class with three public fields, one native method, a static prototype field, and a default constructor. Naming follows standard Java conventions, making intent clear. The reading flow is natural: fields, method, static member, constructor. Nesting is minimal and action granularity is one action per line. Minor deductions: the native method signature is long, and the class lacks Javadoc, reducing clarity slightly. Overall, it is highly readable.
Run 3
The code is simple and concise, but readability is dragged down by several major issues. The class has no logical structure, as fields are jumbled together with a native method, a static prototype field, and an empty constructor. The purpose of the class is unclear without context, and Java naming conventions are not followed—fields like `code`, `reason`, and `wasClean` lack clarity without comments. The native method signature is overly long, making it hard to read. There is no documentation explaining what the class represents or how the native method should be used. The empty constructor and prototype field add no meaningful information. Overall, while it is not deeply nested and has few lines, the lack of organization, ambiguous intent, and unclear field meaning keep it from being readable.
Run 1
Code Structure: The small class is logically organized, though the static prototype field could be grouped with other fields. Nesting: There is no nested logic, making scanning easy. Clarity of intent: CloseEvent, its fields, and descriptive parameter names communicate purpose, although native binding conventions and the empty constructor lack explanation. Code length: Concise, with little unnecessary code; fully qualified java.lang types add visual noise. Action granularity: Each declaration occupies its own line, but the long method signature is harder to scan. Reading flow: Generally natural, moving from fields to a method and constructor, though conventional modifier ordering, consistent spacing, and wrapping the method parameters would improve readability.
Run 2
Code Structure: A straightforward class declaration groups event fields, an initializer, a prototype, and a constructor, though separating instance and static members would improve organization. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Class and field names clearly convey a close event; the native initializer and prototype are less obvious without context. Code length: Concise, with no unnecessary logic, although fully qualified java.lang types add visual noise. Action granularity: Each declaration occupies its own line, but the initializer packs many parameters onto one long line. Reading flow: Generally natural, though blank lines between member groups, a multiline parameter list, and conventional constructor spacing would improve readability.
Run 3
Code Structure: A straightforward event class with logically grouped fields, though the static prototype and constructor could be organized more conventionally. Nesting: Minimal, with no nested logic. Clarity of intent: The class name, inheritance, and descriptive fields clearly identify a close-event API; the native method and prototype suggest binding code. Code length: Concise, but fully qualified java.lang types add unnecessary visual noise. Action granularity: Each field and method declaration occupies its own line; the empty constructor is appropriately compact. Reading flow: Generally natural, but the long initCloseEvent signature would benefit from multiline formatting, and spacing between fields, methods, and the constructor would improve scanning.