Sample

Schnappinger/argoUML/org.argouml.notation.providers.ActionStateNotation

Human rating uses the original dataset scale.

Human3.58
Lines83

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.140–1; higher is more readable
74.6Δ 34.6
Scalabrino0.5930–1; higher is more readable
21.2Δ 18.7
Dorn0.7790–1; higher is more readable
80.5Δ 40.6
Mi0.5990–1; higher is more readable
62.7Δ 22.8
LLOC13Logical lines; fewer is more readable
68.2Δ 28.2
DeepSeek V4 Pro17.330–20; mean of three runs
73.9Δ 34.0
GPT-6.1 Sol170–20; mean of three runs
55.3Δ 15.3
BTTF0.6830–1; higher is more readable
75.6Δ 35.6
Human3.581–4; original rating
39.9

Views

Source code

/* $Id: ActionStateNotation.java 18852 2010-11-20 19:27:11Z 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: * Michiel van der Wulp ***************************************************************************** * * Some portions of this file was previously release using the BSD License: */ // Copyright (c) 2005-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.notation.providers; import java.util.Collection; import java.util.Iterator; import org.argouml.model.Model; import org.argouml.notation.NotationProvider; /** * This abstract class forms the basis of all Notation providers * for the text shown in the Fig that represents the ActionState. * Subclass this for all languages. * * @author Michiel van der Wulp */ public abstract class ActionStateNotation extends NotationProvider { /** * The constructor. * * @param actionState the uml element */ public ActionStateNotation(Object actionState) { if (!Model.getFacade().isAActionState(actionState)) { throw new IllegalArgumentException("This is not an ActionState."); } } @Override public void initialiseListener(Object modelElement) { addElementListener(modelElement, new String[] {"entry", "remove", "stereotype"} ); Object entry = Model.getFacade().getEntry(modelElement); if (entry != null) { addElementListener(entry, "script"); } Collection c = Model.getFacade().getStereotypes(modelElement); Iterator i = c.iterator(); while (i.hasNext()) { Object st = i.next(); addElementListener(st, "name"); } } }

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.1097.186−36.207
Source linesThe number of non-empty source lines.83+33.2
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.119−7.678

Intercept 8.87 + feature contributions = -1.816 (log-odds).
Score = sigmoid(-1.816) = 0.14.

Score0.593

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.84−1.938
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.82.797+0.748
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.029+0.662
Indentation frequencyHow rapidly indentation changes from line to line.38+0.577
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.73.393+0.38
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.964+0.363

Intercept 0.07 + feature contributions = 1.259 (log-odds).
Score = sigmoid(1.259) = 0.779.

Score0.599
Score13
Run 1

The code is highly readable with clear structure, minimal nesting, and explicit intent. The class has a single responsibility, methods are short, and validation is clear. The constructor throws a specific exception, improving debuggability. Listener initialization uses flat logic with well-named variables (entry, c, i, st). Long copyright headers are historical noise but not part of the code's operational readability. The score is slightly reduced because the header is disproportionately long, and some variable names ('c', 'i') are less descriptive, although acceptable for loop locals.

Run 2

The code is well-structured with a clear purpose and clean organization. The class has a single responsibility, and the constructor validates input properly. Nesting is minimal, with only one level in the while loop. Variable names are descriptive (e.g., 'entry', 'stereotypes', 'modelElement'). However, the method `initialiseListener` performs multiple related but distinct actions, making it longer than necessary. The `while` loop could be a for-each loop for improved readability. The string array on one line is acceptable but slightly reduces readability. Overall, the code is clear, but could benefit from breaking `initialiseListener` into smaller helper methods.

Run 3

The code is highly readable. It has a clear, logical structure with a single class that has a focused purpose. The nesting is flat: only one if-statement and one while-loop, both with minimal inner logic. The intent of each method is plainly expressed through naming and a concise Javadoc. The code is not unnecessarily long, and the majority of the lines are license headers and comments, which, while verbose for this specific task, do not affect the actual logic's readability. Action granularity is good, typically one statement per line with clear method calls. The reading flow is natural, moving from validation to listener setup. The only minor deductions are for the multi-line `addElementListener` call due to an awkward array formatting and the heavy license header that could obscure the actual code when first opening the file.

Run 1

Code Structure: The class is logically organized into a validating constructor and a listener-initialization method, with clear separation of responsibilities. Nesting: Control flow is shallow, using only simple conditionals and a single loop. Clarity of intent: Descriptive method names and explicit event names convey the purpose, although abbreviated variables c, i, and st and raw collection types reduce clarity. Code length: The implementation is concise; extensive license headers and a trivial constructor comment add reading overhead without explaining behavior. Action granularity: Statements generally perform one action per line, making execution easy to follow. Reading flow: Initialization proceeds naturally from the model element to its entry and stereotypes, though repeated facade access and minor formatting inconsistencies slightly interrupt the flow.

Run 2

Code Structure: The class is logically organized, separating constructor validation from listener initialization. Nesting: A single conditional and a simple loop keep nesting shallow. Clarity of intent: Class documentation and descriptive method names explain the purpose, although Object types, raw collections, and abbreviated variables c, i, and st obscure model details. Code length: Executable code is concise; the extensive license header and generic constructor documentation add reading overhead. Action granularity: Statements generally perform one action per line, with validation, retrieval, and listener registration clearly separated. Reading flow: Initialization proceeds naturally from the model element to its entry and stereotypes. Minor spacing inconsistencies and repeated facade calls slightly interrupt an otherwise straightforward flow.

Run 3

Code Structure: The class is logically organized into validation and listener initialization, with clear separation of responsibilities. Nesting: A single conditional and a simple loop keep nesting shallow. Clarity of intent: Descriptive method names, event names, and class documentation explain the purpose, although abbreviated variables c, i, and st and raw collection types reduce clarity. Code length: The executable code is concise; lengthy license headers and a redundant constructor comment add scanning overhead. Action granularity: Each statement performs one clear action, with no compressed multi-action lines. Reading flow: Listener registration proceeds naturally from the model element to its entry and stereotypes, supported by consistent indentation and spacing.