Sample
Schnappinger/argoUML/org.argouml.core.propertypanels.ui.UMLDiscriminatorNameDocument
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 1 | 0–1; higher is more readable | 96.7Δ 40.7 |
| Scalabrino | 0.782 | 0–1; higher is more readable | 58.9Δ 3.0 |
| Dorn | 0.629 | 0–1; higher is more readable | 70.0Δ 14.0 |
| Mi | 0.656 | 0–1; higher is more readable | 75.6Δ 19.6 |
| LLOC | 6 | Logical lines; fewer is more readable | 79.7Δ 23.8 |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs | 73.9Δ 18.0 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 17.8 |
| BTTF | 0.379 | 0–1; higher is more readable | 32.3Δ 23.6 |
| Human | 3.91 | 1–4; original rating | 55.9 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Source linesThe number of non-empty source lines. | 79 | +31.6 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 565.661 | −18.667 |
| 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.197 | −7.795 |
Intercept 8.87 + feature contributions = 14.008 (log-odds).
Score = sigmoid(14.008) = 1.
| Score | 0.782 |
|---|
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. | 80 | −1.796 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.016 | +0.784 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 78.732 | +0.691 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 80.9 | +0.501 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 31 | +0.335 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 31 | −0.291 |
| 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. | 80.963 | +0.236 |
Intercept 0.07 + feature contributions = 0.53 (log-odds).
Score = sigmoid(0.53) = 0.629.
| Score | 0.656 |
|---|
| Score | 6 |
|---|
Run 1
The code is well-structured with clear separation of concerns: license headers, package declaration, imports, class definition, and methods are all logically organized. The class has a single clear responsibility as a document model for a discriminator field. Nesting is minimal—only one level inside method bodies where needed. Intent is explicit through descriptive method names like setProperty and getProperty, plus clear Javadoc comments. Code length is appropriate and concise; there is no redundancy or unnecessary verbosity beyond the required license text. Action granularity is appropriate: each method performs a single, focused operation in one line. Reading flow is natural—constructor flows to overridden methods, and each method directly expresses its purpose. Minor deductions: the class name 'UMLDiscriminatorNameDocument' is lengthy, and the license header adds visual noise before the actual code, slightly impacting initial readability.
Run 2
The code is well-structured and highly readable. It begins with extensive license headers, which are standard but contribute to length. The package and import statements are clear, and the class has a single, well-defined responsibility. Nesting is minimal—there are no conditional or loop structures, keeping the flow flat. Intent is clear: the class extends UMLPlainTextDocument to handle discriminator name editing. The constructor is concise, and setProperty/getProperty methods are straightforward, each performing one action per line by delegating to model helpers. Reading flow is natural, moving from class declaration to behavior. Deductions are mainly for lengthy legal comments and slightly redundant Javadoc, but these do not harm logic comprehension.
Run 3
The code is highly readable. It has a clear, logical structure: package declaration, imports, class definition, serial version UID, constructor, and two overridden methods. Nesting is minimal and flat. The intent of each method is explicit through names like setProperty and getProperty, supported by brief Javadoc comments. The code is concise without being cryptic; there is no unnecessary repetition or dead code. Action granularity is appropriate, with one logical operation per line in the methods. Reading flow is natural, moving from class-level metadata to constructor and then property accessors. The only minor issue is the lengthy license header, which is not part of the logic and is common in open-source projects. Overall, the code is easy to follow and maintain.
Run 1
Code Structure: A small, logically organized class separates construction, property updating, and property retrieval. Nesting: No nested control flow; all methods are flat. Clarity of intent: The class description and discriminator-specific API calls clearly communicate purpose, although the constructor comment names a different class and the @see references appear outdated. Code length: The implementation is concise, but lengthy licensing comments dominate the file and delay reaching the functional code. Action granularity: Each method performs a single clear operation, with one statement per line. Reading flow: Conventional Java ordering and consistent formatting make the implementation easy to follow; misleading comments and verbose headers slightly interrupt that flow.
Run 2
Code Structure: The class is logically organized into a constant, constructor, setter, and getter, with clear separation of responsibilities. Nesting: There is no control-flow nesting, making the implementation easy to scan. Clarity of intent: The class description and discriminator accessors clearly convey its purpose, although the constructor comment incorrectly names another class. Code length: The implementation is concise; the lengthy licensing header adds visual overhead without complicating the logic. Action granularity: Each executable statement performs one focused action, despite chained model-access calls. Reading flow: Conventional Java formatting and method ordering provide a natural flow, slightly weakened by stale documentation references and unnecessary constructor line wrapping.
Run 3
Code Structure: A well-organized class with a constant, constructor, and two focused property methods. Nesting: Flat implementation with no conditional or loop nesting. Clarity of intent: The class name, description, and discriminator accessors communicate the purpose clearly, although the constructor comment incorrectly names another class. Code length: The executable code is concise; extensive licensing text and routine comments add considerable visual overhead. Action granularity: Each statement performs one focused operation, with short helper-call chains that remain easy to follow. Reading flow: Conventional Java ordering and consistent formatting support natural reading, slightly weakened by outdated documentation references and the large header.