Sample

Schnappinger/argoUML/org.argouml.gefext.ArgoModeCreateFigLine

Human rating uses the original dataset scale.

Human3.98
Lines72

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett10–1; higher is more readable
94.3Δ 7.7
Scalabrino0.8750–1; higher is more readable
82.2Δ 4.4
Dorn0.6620–1; higher is more readable
71.6Δ 15.0
Mi0.5520–1; higher is more readable
42.6Δ 44.1
LLOC5Logical lines; fewer is more readable
83.0Δ 3.6
DeepSeek V4 Pro17.330–20; mean of three runs
73.9Δ 12.7
GPT-6.1 Sol170–20; mean of three runs
55.3Δ 31.4
BTTF0.7570–1; higher is more readable
91.4Δ 4.8
Human3.981–4; original rating
86.6

Views

Source code

/* $Id: ArgoModeCreateFigLine.java 19614 2011-07-20 12:10:13Z 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: * tfmorris ***************************************************************************** * * Some portions of this file was previously release using the BSD License: */ // Copyright (c) 2007 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.gefext; import java.awt.event.MouseEvent; import org.argouml.i18n.Translator; import org.tigris.gef.base.ModeCreateFigLine; import org.tigris.gef.presentation.Fig; /** * A Mode to interpret user input while creating a FigLine. All of * the actual event handling is inherited from ModeCreate. This class * just implements the differences needed to make it specific to * lines. * * @author Michiel */ public class ArgoModeCreateFigLine extends ModeCreateFigLine { @Override public Fig createNewItem(MouseEvent me, int snapX, int snapY) { Fig line = new ArgoFigLine(snapX, snapY, snapX, snapY); // TODO: We need a way to set the line color and width here, but // TestDependencies thinks this creates a dependency cycle // Fig line = new ArgoFigLine(snapX, snapY, snapX, snapY, // ArgoFig.LINE_COLOR); // line.setLineWidth(ArgoFig.LINE_WIDTH); return line; } @Override public String instructions() { return Translator.localize("statusmsg.help.create.line"); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.72+28.8
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.564.332−18.623
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.149−7.723

Intercept 8.87 + feature contributions = 11.324 (log-odds).
Score = sigmoid(11.324) = 1.

Score0.875

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.73−1.548
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.015+0.801
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.71.81+0.594
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.75.822+0.419
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.77.959+0.363
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.25−0.153
Indentation frequencyHow rapidly indentation changes from line to line.25+0.128

Intercept 0.07 + feature contributions = 0.673 (log-odds).
Score = sigmoid(0.673) = 0.662.

Score0.552
Score5
Run 1

The code is well-structured and easy to follow. It has a clear package and import section, a concise class with two overridden methods, and minimal nesting. Intent is evident from the class name and method names. Each method performs a single logical action. The main readability drawbacks are the extensive copyright headers, which dominate the file before the actual code, and the commented-out TODO block, which adds noise. Minor issues include slight inconsistency in brace placement after method signatures. Overall, the actual logic is concise and highly readable, but the boilerplate headers reduce the score.

Run 2

The code is highly readable with a clear and logical structure. It follows standard Java conventions, including package declaration, imports, class definition, and method overrides. The class has a single responsibility and minimal nesting. Intent is evident from the class name, method names, and concise Javadoc comments. Code length is minimal and focused, with no unnecessary repetition. Each action is separated clearly, and the flow is natural: define class, override creation behavior, provide instructions. The only minor issues are the commented-out TODO block and lengthy license header, which slightly interrupt the reading flow but do not significantly harm readability. Overall, the code is clean and maintainable.

Run 3

The code is highly readable. It has a clear, logical structure with standard license headers, package declaration, imports, and a well-documented class. The class has a single clear purpose: creating FigLine items with Argo-specific behavior. Nesting is minimal—only two methods, each with one level of indentation. Intent is obvious from the class and method names plus Javadoc. The code is concise; methods contain only the essential logic without unnecessary lines. Action granularity is good, with one meaningful operation per line in the methods. Reading flow is natural: imports, class declaration, then overridden methods in order. The commented-out TODO code is slightly noisy but clearly marked and doesn't obstruct understanding. Minor deductions for the large license header (common in open-source projects) and the commented block, but overall this is exemplary readable code.

Run 1

Code Structure: A small, logically organized class with two focused overrides and clearly separated imports and documentation. Nesting: No nested control flow, making both methods easy to follow. Clarity of intent: Descriptive class and method names, straightforward object creation, and a clear localization call communicate purpose; inherited behavior requires some framework knowledge. Code length: Executable code is concise, but the lengthy license header and commented-out implementation add visual clutter. Action granularity: Each statement performs one action, with object creation and return kept separate. Reading flow: Natural top-to-bottom organization and consistent method layout support scanning, although inconsistently indented commented-out code interrupts the flow.

Run 2

Code Structure: The class is logically organized, with imports, documentation, and two focused overrides. Nesting: Both methods are flat and immediately understandable. Clarity of intent: Descriptive class and method names, straightforward construction, and the localization key clearly communicate line creation and user guidance; inherited behavior requires some external context. Code length: Executable code is concise, although extensive license headers and obsolete commented-out code add visual bulk. Action granularity: Each executable statement performs one clear action on its own line. Reading flow: The implementation reads naturally from object creation to return, followed by instructions, but inconsistent indentation in commented-out code and minor formatting issues interrupt the otherwise clean presentation.

Run 3

Code Structure: A small, well-organized class with two focused overrides and clearly separated imports. Nesting: No nested control flow, making both methods easy to follow. Clarity of intent: Descriptive class and method names, documentation, and straightforward construction make the purpose clear, although the unused MouseEvent parameter and dependency-related TODO introduce minor distractions. Code length: The executable code is concise; extensive license headers and obsolete commented-out code add visual bulk. Action granularity: Each executable statement performs one clear action. Reading flow: The implementation progresses naturally from creating a line to returning localized instructions, but inconsistent indentation in the commented-out block interrupts otherwise clean formatting.