Sample

Schnappinger/argoUML/org.argouml.uml.diagram.ui.FigEdgePort

Human rating uses the original dataset scale.

Human3.89
Lines154

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
64.5Δ 16.2
Scalabrino0.8660–1; higher is more readable
79.8Δ 31.4
Dorn0.3560–1; higher is more readable
51.8Δ 3.5
Mi0.5660–1; higher is more readable
48.2Δ 0.2
LLOC30Logical lines; fewer is more readable
49.2Δ 0.8
DeepSeek V4 Pro15.670–20; mean of three runs
43.9Δ 4.5
GPT-6.1 Sol170–20; mean of three runs
55.3Δ 6.9
BTTF0.3510–1; higher is more readable
27.4Δ 21.0
Human3.891–4; original rating
48.3

Views

Source code

/* $Id: FigEdgePort.java 17865 2010-01-12 20:45:26Z linus $ ***************************************************************************** * Copyright (c) 2009 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) 1996-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.uml.diagram.ui; import java.awt.Rectangle; import org.argouml.uml.diagram.DiagramSettings; import org.tigris.gef.presentation.Fig; import org.tigris.gef.presentation.FigCircle; import org.tigris.gef.presentation.FigEdge; /** * This node cannot be dragged and manipulated in the same way as other * FigNodes in ArgoUML. It is actually an optional child fig (or more precisely * a path item) of a FigEdgeModelElement. * This allows the dashed edge of an association class to connect the * association edge and allows the dashed edge of a comment edge to attach a * comment to some other edge type. * GEF can only attach edges to nodes, by making this fig both a node and * containing it as a child of an edge we push the rules to allow edge to edge * connections. * TODO: We are inheriting a lot of functionality here that we don't really * require. We should attempt to make FigEdgePort extend FigNode. * * @author Bob Tarling */ public class FigEdgePort extends FigNodeModelElement { private FigCircle bigPort; private void initialize() { invisibleAllowed = true; bigPort = new FigCircle(0, 0, 1, 1, LINE_COLOR, FILL_COLOR); addFig(bigPort); } /** * @param owner owning uml element * @param bounds ignored * @param settings ignored */ public FigEdgePort(Object owner, Rectangle bounds, DiagramSettings settings) { super(owner, bounds, settings); initialize(); bigPort.setOwner(owner); } /* * @see org.tigris.gef.presentation.Fig#hit(java.awt.Rectangle) */ @Override public boolean hit(Rectangle r) { return false; } @Override public Object getOwner() { if (super.getOwner() != null) { return super.getOwner(); } Fig group = this; while (group != null && !(group instanceof FigEdge)) { group = group.getGroup(); } if (group == null) { return null; } else { return group.getOwner(); } } /* * @see org.tigris.gef.presentation.Fig#classNameAndBounds() */ // USED BY PGML.tee @Override public String classNameAndBounds() { return getClass().getName() + "[" + getX() + ", " + getY() + ", " + getWidth() + ", " + getHeight() + "]"; } /* * @see org.tigris.gef.presentation.FigNode#hitPort(int, int) */ @Override public Object hitPort(int x, int y) { return null; } /* * @see org.tigris.gef.presentation.FigGroup#hitFig(java.awt.Rectangle) */ @Override public Fig hitFig(Rectangle r) { return null; } /* * @see org.tigris.gef.presentation.Fig#isSelectable() */ @Override public boolean isSelectable() { return false; } /* * @see org.tigris.gef.presentation.FigNode#getPortFig(java.lang.Object) */ public Fig getPortFig(Object port) { return bigPort; } /** * The UID. */ private static final long serialVersionUID = 3091219503512470458L; }

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.2172.346−71.687
Source linesThe number of non-empty source lines.154+61.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.036−7.553

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

Score0.866

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.155−4.452
Indentation frequencyHow rapidly indentation changes from line to line.86+2.238
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.153.875+1.741
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.86−1.553
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.034+0.613
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.76.458+0.429
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.78.981+0.32

Intercept 0.07 + feature contributions = -0.594 (log-odds).
Score = sigmoid(-0.594) = 0.356.

Score0.566
Score30
Run 1

The code is generally well-structured and readable. Class organization is logical, with fields, constructor, and overridden methods clearly separated. Nesting is minimal except for a slightly deeper if-else in getOwner(), but it remains understandable. Intent is mostly clear through Javadoc comments and method names. Code length is concise, avoiding unnecessary verbosity. Action granularity is good, with one primary operation per line. Reading flow is natural, with overrides grouped near the end of the class. Minor deductions: the getOwner() method contains a nested conditional that could be flattened for slightly better clarity, and a few comments are redundant (e.g., placing @Override above a method with a Javadoc note). Overall, it is clean and professional.

Run 2

The code is well-structured and readable overall. It follows standard Java conventions with a logical organization: copyright headers, package declaration, imports, class documentation, fields, constructor, and methods. Nesting is minimal, with only one while loop and a simple if-else block in getOwner()—no deep nesting issues. Intent is clear through descriptive method names (hit, getOwner, isSelectable) and Javadoc comments documenting non-obvious behavior. The class is concise, with each method performing a single action or short sequence. Action granularity is appropriate—most logical operations occupy single lines, and method chaining in classNameAndBounds() is formatted across multiple lines for readability. Reading flow is natural, following a consistent ordering of related methods and including explanatory comments for unusual design decisions. Minor deductions: the indentation in getOwner() uses tabs inconsistently with the rest of the file, the serialVersionUID is placed at the end rather than near the top, and some comments reference external documentation rather than explaining the rationale inline. These are minor style inconsistencies that don't significantly impact readability.

Run 3

The code is generally readable, with clear class purpose and organized methods. The structure is logical: fields, initialization, constructor, then overrides. Nesting is minimal except for the while loop in getOwner(), which is easy to follow. Intent is clear from the Javadoc and method names. Code length is moderate and appropriate for the functionality. However, readability is reduced by inconsistent indentation (e.g., mix of tabs/spaces in getOwner()), a long boilerplate license header, and inconsistent Javadoc formatting. The initialize() method does multiple actions per line (creates FigCircle, adds it), which slightly reduces action granularity. The getOwner() method contains a slightly convoluted fallback loop but is still understandable. Overall, the code is maintainable but could benefit from formatting cleanup.

Run 1

Code Structure: Small, focused methods and clearly separated initialization, ownership lookup, and interaction overrides provide logical organization. Nesting: Shallow conditionals and one simple loop keep control flow easy to follow. Clarity of intent: The class documentation explains its unusual edge-to-edge connection role, although bigPort is vague and constant-return overrides lack explanations. Code length: The implementation is concise; extensive license text and repetitive @see comments add visual bulk without complicating the logic. Action granularity: Statements generally perform one action per line, with only straightforward expression composition. Reading flow: Method boundaries and spacing support scanning, but mixed indentation in getOwner, initialization preceding the constructor, and placement of serialVersionUID at the end slightly disrupt consistency.

Run 2

Code Structure: A focused class with small, logically separated methods, although initialization before the constructor and the serialization field at the end slightly fragment organization. Nesting: Shallow conditionals and a simple loop make control flow easy to follow. Clarity of intent: Class documentation clearly explains the edge-to-edge connection workaround, and method names convey their roles; terse variable names and constructor documentation labeling forwarded parameters as ignored introduce ambiguity. Code length: Implementation is concise, but extensive licensing text and repetitive override comments add reading overhead. Action granularity: Statements generally perform one action per line, with no compressed multi-statement logic. Reading flow: Mostly natural and consistent, though mixed indentation in getOwner(), a redundant else after return, and legacy comments slightly disrupt it.

Run 3

Code Structure: The class is logically organized into initialization, construction, and small behavioral overrides, though placing the constructor before the helper would be more conventional. Nesting: Control flow is shallow, with a straightforward loop and simple conditionals in getOwner(). Clarity of intent: Class documentation explains the unusual edge-to-edge connection mechanism, and most methods have clear purposes. However, bigPort is vague, and constructor documentation labels parameters ignored despite passing them to the superclass. Code length: Implementation is concise, but extensive license text and repetitive reference comments add visual bulk. Action granularity: Statements generally perform one action per line; the multiline string construction remains understandable. Reading flow: Small methods and consistent separation support easy scanning, but mixed indentation in getOwner(), repeated superclass access, and an unnecessary else after an early return slightly disrupt flow.