Sample

Schnappinger/jsweet/org.jsweet.transpiler.ModuleImportDescriptor

Human rating uses the original dataset scale.

Human3.97
Lines60

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett10–1; higher is more readable
92.3Δ 6.8
Scalabrino0.8130–1; higher is more readable
65.8Δ 19.7
Dorn0.6960–1; higher is more readable
75.6Δ 9.9
Mi0.0840–1; higher is more readable
9.9Δ 75.6
LLOC13Logical lines; fewer is more readable
68.2Δ 17.3
DeepSeek V4 Pro18.670–20; mean of three runs
98.3Δ 12.9
GPT-6.1 Sol190–20; mean of three runs
92.6Δ 7.1
BTTF0.7340–1; higher is more readable
89.1Δ 3.6
Human3.971–4; original rating
85.5

Views

Source code

/* * JSweet transpiler - http://www.jsweet.org * Copyright (C) 2015 CINCHEO SAS <renaud.pawlak@cincheo.fr> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package org.jsweet.transpiler; import javax.lang.model.element.PackageElement; /** * This class describes a module import. * * @author Renaud Pawlak */ public class ModuleImportDescriptor { public ModuleImportDescriptor(PackageElement targetPackage, String importedName, String pathToImportedClass) { super(); this.targetPackage = targetPackage; this.importedName = importedName; this.pathToImportedClass = pathToImportedClass; } private PackageElement targetPackage; private String importedName; private String pathToImportedClass; /** * Gets the package of the element being imported. */ public PackageElement getTargetPackage() { return targetPackage; } /** * Gets the name of the import. */ public String getImportedName() { return importedName; } /** * Gets the path to the imported class. */ public String getPathToImportedClass() { return pathToImportedClass; } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.

Score0.813

Feature contributions

FeatureValueContribution
(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.

Score0.084
Score13
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.