Sample

Schnappinger/argoUML/org.argouml.ui.explorer.rules.GoStateToDoActivity

Human rating uses the original dataset scale.

Human3.62
Lines93

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.6090–1; higher is more readable
81.3Δ 41.0
Scalabrino0.7540–1; higher is more readable
50.3Δ 10.1
Dorn0.5050–1; higher is more readable
61.1Δ 20.8
Mi0.5670–1; higher is more readable
49.5Δ 9.2
LLOC14Logical lines; fewer is more readable
66.8Δ 26.6
DeepSeek V4 Pro16.330–20; mean of three runs
53.1Δ 12.9
GPT-6.1 Sol170–20; mean of three runs
55.3Δ 15.0
BTTF0.6590–1; higher is more readable
68.6Δ 28.4
Human3.621–4; original rating
40.3

Views

Source code

/* $Id: GoStateToDoActivity.java 17844 2010-01-12 19:35:07Z 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) 1996-2006 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.ui.explorer.rules; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.argouml.i18n.Translator; import org.argouml.model.Model; /** * Go rule to navigate from a state to it's do-activity. Used in the package * perspective. * * @author jaap.branderhorst@xs4all.nl * @since Dec 25, 2002 */ public class GoStateToDoActivity extends AbstractPerspectiveRule { /* * @see org.argouml.ui.explorer.rules.PerspectiveRule#getChildren(java.lang.Object) */ public Collection getChildren(Object parent) { if (Model.getFacade().isAState(parent) && Model.getFacade().getDoActivity(parent) != null) { Collection children = new ArrayList(); children.add(Model.getFacade().getDoActivity(parent)); return children; } return Collections.EMPTY_SET; } /* * @see org.argouml.ui.explorer.rules.PerspectiveRule#getDependencies(java.lang.Object) */ public Set getDependencies(Object parent) { if (Model.getFacade().isAState(parent)) { Set set = new HashSet(); set.add(parent); return set; } return Collections.EMPTY_SET; } /* * @see org.argouml.ui.explorer.rules.PerspectiveRule#getRuleName() */ public String getRuleName() { return Translator.localize("misc.state.do-activity"); } }

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.1145.83−37.812
Source linesThe number of non-empty source lines.93+37.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.209−7.813

Intercept 8.87 + feature contributions = 0.444 (log-odds).
Score = sigmoid(0.444) = 0.609.

Score0.754

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.94−2.292
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.92.913+0.889
Indentation frequencyHow rapidly indentation changes from line to line.46+0.854
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.90.936+0.663
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.029+0.66
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.46−0.635
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.90.957−0.187

Intercept 0.07 + feature contributions = 0.022 (log-odds).
Score = sigmoid(0.022) = 0.505.

Score0.567
Score14
Run 1

The code is generally readable with clear logical organization, a flat structure, and concise methods. Intent is evident from method names and the straightforward logic. Each method performs a single, well-defined action. Minor issues include inconsistent indentation in getDependencies (spaces vs tabs), verbose multi-line license headers that add visual noise, and the use of Collections.EMPTY_SET (raw type) rather than generics. These slightly reduce clarity but do not significantly hinder understanding.

Run 2

The code has good structure with clear class and method separation. Overall nesting is shallow (single-level conditionals). Intent is mostly clear: methods retrieve children, dependencies, and rule name. The getChildren and getDependencies methods are concise, but could be slightly cleaner by returning early instead of using if/return/return. Action granularity is adequate: one or two actions per line. Reading flow is natural and method order follows rule interface convention. The main readability issues are the very long copyright header (not part of executable code but still adds noise) and some minor inconsistency in indentation (mixed tabs/spaces in getDependencies). Also, the repeated Model.getFacade() calls inside a single condition slightly reduce clarity. The code is overall quite readable for a small utility class, but not perfectly consistent.

Run 3

The code is well-structured and readable. It has a clear class purpose, logical method organization, and shallow nesting with simple if statements. Each method performs one action per line, and the reading flow is natural. The main readability issue is the excessive copyright header (not code logic), which adds clutter but does not affect functional clarity. The code is concise, uses meaningful method names, and follows consistent formatting. Minor deductions for duplicated condition checks and the use of Collections.EMPTY_SET without generic typing, which slightly reduces modern clarity.

Run 1

Code Structure: Three small, focused methods provide clear logical organization. Nesting: Only single-level conditionals appear, keeping control flow easy to follow. Clarity of intent: Descriptive class and method names, documentation, and straightforward model queries clearly express the navigation rule; generic local names and raw collection types slightly reduce clarity. Code length: The implementation is concise, although extensive license headers dominate the file and the do-activity lookup is repeated. Action granularity: Each statement performs one clear action, with collection creation, insertion, and return separated. Reading flow: Methods follow a natural sequence and use simple conditional returns, but inconsistent tab/space indentation in getDependencies disrupts visual consistency.

Run 2

Code Structure: Three small, clearly separated methods organize navigation, dependencies, and naming logically. Nesting: Each conditional has only one level, making control flow easy to follow. Clarity of intent: Class and method names, plus the class documentation, communicate the purpose; raw collection types and the generic variable name 'set' reduce precision slightly. Code length: Functional code is concise, though extensive license headers dominate the file and collection construction could be shorter. Action granularity: Statements generally perform one action per line, with clear separation of creation, insertion, and return. Reading flow: Methods follow a natural sequence and use straightforward fallback returns, but inconsistent tabs and spaces in getDependencies disrupt visual consistency. Repeated facade calls add minor reading overhead.

Run 3

Code Structure: Three small, clearly separated methods organize navigation, dependencies, and naming logically. Nesting: Only a single conditional level per relevant method keeps control flow simple. Clarity of intent: Descriptive class and method names and the class comment explain the purpose, though raw collection types and the generic variable name 'set' reduce precision. Code length: The implementation is concise, but extensive licensing text dominates the file, and repeated facade calls add minor redundancy. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Straightforward condition-check, collection-building, and return sequences support natural reading; inconsistent indentation in getDependencies slightly disrupts visual consistency.