Sample

Schnappinger/argoUML/org.argouml.uml.diagram.state.ui.ButtonActionNewCallEvent

Human rating uses the original dataset scale.

Human3.9
Lines61

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett10–1; higher is more readable
96.3Δ 42.5
Scalabrino0.8910–1; higher is more readable
86.6Δ 32.8
Dorn0.7850–1; higher is more readable
82.2Δ 28.4
Mi0.5520–1; higher is more readable
42.2Δ 11.6
LLOC6Logical lines; fewer is more readable
79.7Δ 25.9
DeepSeek V4 Pro17.670–20; mean of three runs
83.0Δ 29.2
GPT-6.1 Sol190–20; mean of three runs
92.6Δ 38.8
BTTF0.7840–1; higher is more readable
94.4Δ 40.6
Human3.91–4; original rating
53.8

Views

Source code

/* $Id: ButtonActionNewCallEvent.java 17862 2010-01-12 20:06:14Z 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) 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.uml.diagram.state.ui; import org.argouml.model.Model; /** * This is an Action to be used for Buttons to create a Call-Event. * * @author Michiel */ public class ButtonActionNewCallEvent extends ButtonActionNewEvent { protected Object createEvent(Object ns) { return Model.getStateMachinesFactory().buildCallEvent(ns); } protected String getKeyName() { return "button.new-callevent"; } protected String getIconName() { return "CallEvent"; } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.61+24.4
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.353.108−11.653
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 = 13.823 (log-odds).
Score = sigmoid(13.823) = 1.

Score0.891

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.62−1.159
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.012+0.822
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.60.886+0.441
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
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.968+0.363
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.70.629+0.335
Indentation frequencyHow rapidly indentation changes from line to line.22+0.024

Intercept 0.07 + feature contributions = 1.294 (log-odds).
Score = sigmoid(1.294) = 0.785.

Score0.552
Score6
Run 1

The code is highly readable with a clear, logical structure. The class has a single responsibility and extends an appropriate base class. Methods are short, focused, and well-named, with zero nesting depth. Each method performs one action, maintaining good action granularity. The reading flow is natural: the methods follow a logical order (create, getKeyName, getIconName). The extensive license header is the only detractor from readability, as it adds significant length before reaching the actual code. However, the code itself is concise and unambiguous. The class and method purposes are immediately clear from their names. Overall, this is exemplary readable code with the only minor issue being the verbose legal header that could be shortened or moved to an external file.

Run 2

The code is highly readable due to its clean structure, clear intent, and concise implementation. Each method performs a single action, demonstrating excellent action granularity. The class has a logical organization with minimal nesting and a natural reading flow from class declaration to simple method implementations. The only minor deductions are for lengthy boilerplate license headers that delay reaching the actual code logic, but they do not significantly impact understanding. Method names like createEvent, getKeyName, and getIconName clearly convey their purposes. The code is well-formatted, follows consistent naming conventions, and maintains a flat hierarchy without unnecessary complexity. The inherited base class provides context, keeping this class focused and maintainable.

Run 3

The code is highly readable. The structure is logical and minimal, with a simple class extending a base class and overriding three concise methods. Nesting is essentially flat, with no conditional or loop structures. The intent is clear from the class name and method names: creating a new call event action. Code length is appropriately concise for its purpose. Each method performs a single action, maintaining excellent action granularity. Reading flow is natural, following a standard getter/build method pattern. Minor deductions could be made for the lengthy license header and lack of explicit Javadoc on the overridden methods, but the actual code is clean and maintainable.

Run 1

Code Structure: The class is logically organized into three small, focused methods. Nesting: There is no conditional or loop nesting, making the implementation easy to scan. Clarity of intent: The class name, documentation, method names, and factory call clearly convey creation of a call event; the abbreviated parameter 'ns' and generic Object types slightly reduce clarity. Code length: The implementation is concise, although the lengthy license header delays reaching the relevant code. Action granularity: Each method contains a single return statement, with one clear action per line. Reading flow: The package, import, class documentation, and methods follow a natural Java layout, with consistent indentation and spacing.

Run 2

Code Structure: A small, focused subclass cleanly separates event creation, localization key, and icon name into three methods. Nesting: No nested control flow; each method is flat and easy to scan. Clarity of intent: Descriptive class and method names, plus a short class comment, clearly communicate the purpose. The generic Object type and abbreviated parameter ns slightly reduce clarity. Code length: The implementation is concise, although lengthy license headers dominate the file visually. Action granularity: Each method contains a single return statement, keeping actions clearly separated. Reading flow: Conventional package, import, class, and method ordering makes navigation natural and predictable.

Run 3

Code Structure: A focused class with three small, clearly separated methods and a single import. Nesting: No conditional or loop nesting; method bodies are flat. Clarity of intent: The class name, documentation, factory call, and resource names clearly convey call-event creation, although 'ns' and Object types provide limited context. Code length: Implementation is concise; extensive licensing comments add visual bulk but do not complicate the logic. Action granularity: Each method contains one return statement, keeping operations easy to distinguish. Reading flow: Conventional Java organization and consistent formatting make the code straightforward to scan and understand.