Sample
Schnappinger/jsweet/def.dom.MSMediaKeySession
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.033 | 0–1; higher is more readable | 72.6Δ 3.1 |
| Scalabrino | 0.91 | 0–1; higher is more readable | 92.1Δ 22.7 |
| Dorn | 0.801 | 0–1; higher is more readable | 85.1Δ 15.7 |
| Mi | 0.684 | 0–1; higher is more readable | 79.5Δ 10.1 |
| LLOC | 7 | Logical lines; fewer is more readable | 75.9Δ 6.4 |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs | 73.9Δ 4.5 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 4.3 |
| BTTF | 0.629 | 0–1; higher is more readable | 62.7Δ 6.8 |
| 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. | 326.977 | −10.79 |
| 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.707 | −7.06 |
| Source linesThe number of non-empty source lines. | 14 | +5.6 |
Intercept 8.87 + feature contributions = -3.38 (log-odds).
Score = sigmoid(-3.38) = 0.033.
| Score | 0.91 |
|---|
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. | 51.933 | +1.466 |
| 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. | 15 | +0.505 |
| 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. | 13 | −0.287 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.07 | +0.263 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 13.792 | −0.217 |
Intercept 0.07 + feature contributions = 1.393 (log-odds).
Score = sigmoid(1.393) = 0.801.
| Score | 0.684 |
|---|
| Score | 7 |
|---|
Run 1
The code is concise and clear, with flat structure and no nesting. Intent is evident: it models a media key session with a few mutable properties and two native methods. Naming is descriptive, and follows Java conventions. Each member is declared on a separate line, aiding readability. However, the class appears to be a stub (empty constructor, native methods, static prototype) with no documentation, which slightly obscures purpose and intended usage in a real DOM context. Overall, it is highly readable but lacks explanatory context.
Run 2
The code is highly readable. It follows a clear, logical structure with package, import, and class declaration in a natural order. Nesting is minimal—only one class level exists. Intent is evident: the class models a media key session with error, key system, and session ID properties, plus native methods to close and update. Code length is concise; there is no redundancy. Each field, method, and constructor is on its own line, aligning with one-action-per-line granularity. The reading flow is natural, moving from package context to class definition, then members, then constructor. Minor deductions come from a lack of comments or documentation, and the presence of a `prototype` static field might be slightly unclear to those unfamiliar with JavaScript interop patterns in Java definitions, but overall this is an exemplary readable class definition.
Run 3
The code is highly readable. It follows a logical structure with clear package and import declarations, followed by a concise class definition. Nesting is minimal, with all members declared at the class level. The intent is clear: this class represents a media key session and exposes fields and methods related to media key management. The code is concise, avoiding unnecessary verbosity. Each member declaration occupies its own line, maintaining action granularity and a natural reading flow. Minor improvements could include adding documentation or clarifying the native method behavior, but overall the code is straightforward and easy to understand.
Run 1
Code Structure: The class is logically organized, with instance fields followed by methods, a static prototype, and a constructor, though separating these groups would improve readability. Nesting: There is no unnecessary nesting. Clarity of intent: The class and member names clearly suggest a media key session API, although the native bindings and prototype field require contextual knowledge. Code length: The code is concise without redundant implementation. Action granularity: Each declaration occupies its own line; the empty constructor is appropriately compact. Reading flow: The sequence is straightforward, but placing the static field with other fields, adding blank lines between groups, and using conventional modifier order ('public native') would make it more natural.
Run 2
Code Structure: The package, import, and class are logically organized, although grouping instance fields, constructors, methods, and static fields would improve consistency. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Class, field, and method names clearly convey a media key session API; native declarations indicate externally implemented behavior. Code length: Concise, with no unnecessary logic. Action granularity: Each declaration occupies its own line. Reading flow: Mostly natural, but placing the static prototype field after methods and the constructor last slightly interrupts the flow. Blank lines between member groups, conventional modifier ordering, and spacing in the empty constructor would improve readability.
Run 3
Code Structure: A simple, logically organized class, though separating instance fields, methods, and static members would improve grouping. Nesting: Flat, with no nested logic. Clarity of intent: Descriptive class, field, and method names clearly convey a media key session API; native declarations appropriately indicate external implementations. Code length: Concise, with no unnecessary logic. Action granularity: Each declaration occupies its own line. Reading flow: Easy to scan, but the static prototype field between methods and the constructor slightly disrupts grouping. Minor style issues include unconventional 'native public' modifier ordering, fully qualified String types, and missing spacing in the empty constructor.