Sample

Schnappinger/argoUML/org.argouml.notation.providers.java.AssociationEndNameNotationJava

Human rating uses the original dataset scale.

Human3.91
Lines109

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
63.2Δ 7.3
Scalabrino0.7690–1; higher is more readable
54.1Δ 1.8
Dorn0.3880–1; higher is more readable
54.8Δ 1.2
Mi0.4840–1; higher is more readable
32.3Δ 23.6
LLOC19Logical lines; fewer is more readable
61.6Δ 5.6
DeepSeek V4 Pro15.670–20; mean of three runs
43.9Δ 12.0
GPT-6.1 Sol170–20; mean of three runs
55.3Δ 0.7
BTTF0.5320–1; higher is more readable
46.9Δ 9.1
Human3.911–4; original rating
55.9

Views

Source code

/* $Id: AssociationEndNameNotationJava.java 18615 2010-08-03 08:23:26Z mvw $ ***************************************************************************** * Copyright (c) 2009-2010 Contributors - see below * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * mvw ***************************************************************************** * * Some portions of this file was previously release using the BSD License: */ // Copyright (c) 2006-2009 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice // and this paragraph appear in all copies. This software program and // documentation are copyrighted by The Regents of the University of // California. The software program and documentation are supplied "AS // IS", without any accompanying services from The Regents. The Regents // does not warrant that the operation of the program will be // uninterrupted or error-free. The end-user understands that the program // was developed for research purposes and is advised not to rely // exclusively on the program for any reason. IN NO EVENT SHALL THE // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. package org.argouml.notation.providers.java; import org.argouml.application.events.ArgoEventPump; import org.argouml.application.events.ArgoEventTypes; import org.argouml.application.events.ArgoHelpEvent; import org.argouml.model.Model; import org.argouml.notation.NotationSettings; import org.argouml.notation.providers.AssociationEndNameNotation; import org.argouml.notation.providers.uml.NotationUtilityUml; /** * The Java notation for an associationEnd name (i.e. the role). * * @author michiel */ public class AssociationEndNameNotationJava extends AssociationEndNameNotation { /** * The constructor. * * @param associationEnd the UML element */ public AssociationEndNameNotationJava(Object associationEnd) { super(associationEnd); } /* * @see org.argouml.notation.providers.NotationProvider#getParsingHelp() */ public String getParsingHelp() { // return "parsing.help.fig-association-end-name"; return "Parsing in Java not yet supported"; } /* * @see org.argouml.notation.providers.NotationProvider#parse(java.lang.Object, java.lang.String) */ public void parse(Object modelElement, String text) { ArgoEventPump.fireEvent(new ArgoHelpEvent( ArgoEventTypes.HELP_CHANGED, this, "Parsing in Java not yet supported")); } private String toString(Object modelElement, boolean useGuillemets) { String name = Model.getFacade().getName(modelElement); if (name == null) { name = ""; } Object visi = Model.getFacade().getVisibility(modelElement); String visibility = ""; if (visi != null) { visibility = NotationUtilityJava.generateVisibility(visi); } if (name.length() < 1) { visibility = ""; //this is the temporary solution for issue 1011 } String stereoString = NotationUtilityUml.generateStereotype(modelElement, useGuillemets); return stereoString + visibility + name; } @Override public String toString(Object modelElement, NotationSettings settings) { return toString(modelElement, settings.isUseGuillemets()); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.1715.779−56.621
Source linesThe number of non-empty source lines.109+43.6
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.094−7.641

Intercept 8.87 + feature contributions = -11.791 (log-odds).
Score = sigmoid(-11.791) = 0.

Score0.769

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.110−2.858
Indentation frequencyHow rapidly indentation changes from line to line.60+1.338
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.108.922+1.113
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.60−0.956
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.100.973+0.825
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.032+0.628
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.101−0.613

Intercept 0.07 + feature contributions = -0.454 (log-odds).
Score = sigmoid(-0.454) = 0.388.

Score0.484
Score19
Run 1

The code is generally well-structured and readable. It uses standard Java conventions, clear naming, and logical organization with a single public class in its own file. The constructor and methods are straightforward, and the inheritance structure is evident. The `toString` helper method cleanly separates the text-generation logic from the `parse` and `getParsingHelp` stubs. However, a few issues reduce readability: the long historical license headers add significant noise before the actual code, and the `parse` method contains an inconsistent indentation in its argument list. The commented-out `return` statement in `getParsingHelp` is a minor leftover. Nesting is minimal, and each line generally performs a single action, aiding comprehension. The method flow is logical, but the overloaded `toString` names could slightly obscure intent. Overall, the code is approachable and maintainable for a Java developer.

Run 2

The code is generally readable due to clear method names, moderate comments, and consistent formatting. However, readability is reduced by the lengthy license header (which obscures the actual code), the commented-out return statement in getParsingHelp, and the placeholder parse method that does not actually implement parsing. The toString method is logically structured but contains a redundant check (name.length() < 1) after already defaulting an empty name. Nesting is minimal, which is good, but the intent of some methods is unclear due to stubbed functionality. The code is concise but includes unnecessary comments that add noise. Overall, it is understandable but not exemplary in clarity or maintainability.

Run 3

The code is well-structured with clear separation of concerns: license headers, package declaration, imports, class definition, constructor, and methods follow a logical order. Nesting is minimal—the deepest level is two (method to if-statement), keeping the logic flat and easy to follow. Intent is clear from descriptive method and variable names like 'toString', 'generateVisibility', and 'useGuillemets'. The code length is appropriate; each method is concise and focused on a single responsibility. Action granularity is mostly one action per line, which improves readability, though a few lines like the fireEvent call break this slightly. Reading flow is natural, with methods arranged from simple to more complex. Minor deductions: the commented-out return statement and inline comment could be cleaner, and license headers add length but are standard practice. Overall, the code demonstrates good readability with minor room for polish.

Run 1

Code Structure: Methods are logically separated into construction, parsing help, parsing, and formatting responsibilities. Nesting: Simple, shallow conditionals make execution easy to follow. Clarity of intent: Descriptive class and method names clarify the purpose, though 'visi' is abbreviated, Object parameters obscure types, and the issue-reference comment provides little explanation. Code length: Implementation is concise, but extensive license headers and a commented-out return add visual clutter. Action granularity: Statements generally perform one action per line; multiline calls remain understandable. Reading flow: Formatting logic proceeds naturally from name to visibility to stereotype and final output, with a straightforward public wrapper. Minor indentation inconsistencies and duplicated unsupported-parsing messages slightly reduce readability.

Run 2

Code Structure: The class is logically organized into construction, parsing support, and notation rendering, with a small helper method. Nesting: Simple conditionals keep nesting shallow and easy to follow. Clarity of intent: Method names and documentation communicate the purpose, although 'visi' is abbreviated and the unnamed-role visibility workaround needs more explanation. Code length: The implementation is concise, but extensive license headers, boilerplate comments, and a commented-out return add visual noise. Action granularity: Statements generally perform one action per line; the event construction and firing expression remains understandable. Reading flow: Rendering proceeds naturally from name normalization to visibility and stereotypes, then final concatenation. Minor indentation inconsistencies and overloaded toString methods slightly interrupt an otherwise straightforward reading experience.

Run 3

Code Structure: The class is logically organized into construction, parsing support, and formatting methods, with focused responsibilities. Nesting: Shallow conditionals keep control flow easy to follow. Clarity of intent: Method names and straightforward formatting logic communicate purpose, though 'visi' is abbreviated and the temporary visibility workaround lacks explanation. Code length: Implementation is concise, but extensive license headers, boilerplate documentation, and a commented-out return add visual noise. Action granularity: Statements generally perform one action per line; wrapped calls remain understandable. Reading flow: Formatting proceeds naturally from name to visibility to stereotype and final composition, with a simple delegation method. Minor indentation inconsistencies and the unexplained workaround slightly reduce readability.