Sample
Schnappinger/jsweet/org.jsweet.transpiler.ModuleImportDescriptor
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 1 | 0–1; higher is more readable | 92.3Δ 6.8 |
| Scalabrino | 0.813 | 0–1; higher is more readable | 65.8Δ 19.7 |
| Dorn | 0.696 | 0–1; higher is more readable | 75.6Δ 9.9 |
| Mi | 0.084 | 0–1; higher is more readable | 9.9Δ 75.6 |
| LLOC | 13 | Logical lines; fewer is more readable | 68.2Δ 17.3 |
| DeepSeek V4 Pro | 18.67 | 0–20; mean of three runs | 98.3Δ 12.9 |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs | 92.6Δ 7.1 |
| BTTF | 0.734 | 0–1; higher is more readable | 89.1Δ 3.6 |
| Human | 3.97 | 1–4; original rating | 85.5 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Source linesThe number of non-empty source lines. | 60 | +24 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 505 | −16.665 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 5.031 | −7.546 |
Intercept 8.87 + feature contributions = 8.659 (log-odds).
Score = sigmoid(8.659) = 1.
| Score | 0.813 |
|---|
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. | 60 | −1.088 |
| 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. | 110.983 | −1.036 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 110.983 | +0.986 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.027 | +0.683 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 58.786 | +0.412 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 33 | +0.404 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 0.829 (log-odds).
Score = sigmoid(0.829) = 0.696.
| Score | 0.084 |
|---|
| Score | 13 |
|---|
Run 1
The code is highly readable and follows clean Java conventions. Structure is logical: license header, package, imports, class declaration, constructor, fields, and getters. Nesting is minimal—there are no nested blocks or conditionals. Intent is clear from the class name, field names, and Javadoc comments. Code length is appropriate for a simple data holder; no unnecessary boilerplate beyond standard getters. Action granularity is clean; each statement is simple and single-purpose. Reading flow is natural: constructor initializes fields in declared order, and getters mirror the fields. The only minor deductions are the redundant super() call (implicit) and slightly terse Javadoc, but neither meaningfully affects readability. Overall, this is exemplary straightforward code.
Run 2
The code is highly readable. It has a clear, logical structure: license header, package declaration, imports, class declaration, constructor, fields, and getters. Nesting is minimal, with no conditional blocks or loops. Intent is unambiguous—this is a simple data holder for module import information. Code length is concise and appropriate for its purpose; there is no unnecessary boilerplate. Action granularity is excellent, with one statement per line in the constructor and getters. Reading flow is natural, progressing from documentation through fields to accessor methods. Overall, the code demonstrates clean, maintainable Java with proper documentation and consistent formatting.
Run 3
The code is exceptionally readable. It has a clear logical structure: license header, package declaration, import, class definition, constructor, fields, and getters. Nesting is flat—no conditional or loop blocks. Intent is clear through descriptive class, field, and method names, plus Javadoc comments. Code length is minimal and appropriate for a simple data holder. Action granularity follows one-statement-per-line consistently. Reading flow is natural, progressing from context (package/imports) to constructor, then fields, then accessors. Minor deductions only for the slightly redundant `super()` call and Javadoc comments that add little beyond the already self-explanatory method names.
Run 1
Code Structure: A small, cohesive data class with a constructor, private fields, and getters; placing fields before the constructor would improve conventional organization. Nesting: Minimal, with no nested control flow. Clarity of intent: Descriptive class, field, and method names, supported by straightforward documentation, clearly communicate its purpose. Code length: Concise implementation, though the explicit super() call is unnecessary and getter comments mostly repeat their names. Action granularity: Each assignment and return occupies its own line. Reading flow: Consistent formatting and predictable getter ordering make the class easy to scan; the long license header adds visual bulk but is clearly separated from the implementation.
Run 2
Code Structure: A simple, logically organized data class with a constructor, private fields, and getters; declaring fields before the constructor would slightly improve convention-based readability. Nesting: Minimal, with no nested control flow. Clarity of intent: Descriptive class, field, and method names, reinforced by concise documentation, clearly communicate its purpose. Code length: Appropriately short; the explicit super() call is unnecessary, and the license header adds visual length without complicating the implementation. Action granularity: Each assignment and return occupies its own line. Reading flow: Consistent formatting and straightforward initialization followed by accessors make the code easy to scan.
Run 3
Code Structure: A small, cohesive descriptor class with clearly separated constructor, fields, and getters; placing fields before the constructor would slightly improve conventional organization. Nesting: Flat methods with no conditional or loop nesting. Clarity of intent: Descriptive class, field, and method names plus brief documentation make its purpose immediately clear. Code length: Concise implementation, although the explicit super() call is unnecessary and getter comments largely repeat their names. Action granularity: Each assignment and return occupies its own line. Reading flow: Consistent formatting and predictable accessor ordering support easy scanning, with only the constructor-before-fields arrangement mildly interrupting the flow.