Sample

Schnappinger/argoUML/org.argouml.uml.ui.foundation.core.UMLGeneralizableElementLeafCheckBox

Human rating uses the original dataset scale.

Human3.9
Lines73

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.9990–1; higher is more readable
91.0Δ 41.8
Scalabrino0.7030–1; higher is more readable
39.0Δ 10.1
Dorn0.6280–1; higher is more readable
69.6Δ 20.5
Mi0.5520–1; higher is more readable
42.9Δ 6.3
LLOC6Logical lines; fewer is more readable
79.7Δ 30.5
DeepSeek V4 Pro16.670–20; mean of three runs
59.9Δ 10.7
GPT-6.1 Sol17.670–20; mean of three runs
62.2Δ 13.0
BTTF0.7250–1; higher is more readable
87.8Δ 38.6
Human3.91–4; original rating
49.2

Views

Source code

/* $Id: UMLGeneralizableElementLeafCheckBox.java 17897 2010-01-12 21:36:40Z 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-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.uml.ui.foundation.core; import org.argouml.i18n.Translator; import org.argouml.model.Model; import org.argouml.uml.ui.UMLCheckBox2; /** * * @author jaap.branderhorst@xs4all.nl * @since Jan 27, 2003 */ public class UMLGeneralizableElementLeafCheckBox extends UMLCheckBox2 { /** * Constructor for UMLGeneralizableElementLeafCheckBox. */ public UMLGeneralizableElementLeafCheckBox() { super(Translator.localize("checkbox.leaf-lc"), ActionSetGeneralizableElementLeaf.getInstance(), "isLeaf"); } /* * @see org.argouml.uml.ui.UMLCheckBox2#buildModel() */ public void buildModel() { Object target = getTarget(); if (target != null && Model.getFacade().isAUMLElement(target)) { setSelected(Model.getFacade().isLeaf(target)); } else { setSelected(false); } } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.73+29.2
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.707.016−23.332
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.26−7.89

Intercept 8.87 + feature contributions = 6.848 (log-odds).
Score = sigmoid(6.848) = 0.999.

Score0.703

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.74−1.584
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.024+0.713
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.72.857+0.609
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.82.905+0.533
Indentation frequencyHow rapidly indentation changes from line to line.30+0.301
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.30−0.268
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.82.986+0.15

Intercept 0.07 + feature contributions = 0.525 (log-odds).
Score = sigmoid(0.525) = 0.628.

Score0.552
Score6
Run 1

The code is highly readable. It is well-structured: package declaration, imports, class definition, constructor, and a single overridden method are clearly organized. Nesting is minimal—there is only one conditional with a flat if/else. Intent is clear: the class represents a checkbox that reflects whether a UML element is a leaf. The constructor succinctly wires the label, action, and property. The buildModel method is concise, performing a target fetch, validation, and setSelected in a logical sequence. Action granularity is appropriate, with one meaningful operation per line. Reading flow is natural, moving from setup to runtime behavior. The only minor drawbacks are the lengthy historical license header and the slightly redundant null-plus-type check, but these do not meaningfully impair readability.

Run 2

The code is well-structured and readable. It has a clear class hierarchy, a concise constructor, and a single method with straightforward logic. The nesting is minimal (one if-else block), and the intent of each part is evident. The method performs one logical action per line, and the reading flow is natural. The lengthy license header is the main drawback, but it is standard practice and does not affect the core code readability. Overall, the implementation is clean and maintainable.

Run 3

The code follows a clear and logical structure with a single class and two simple methods. It is mostly flat with only one level of nesting inside buildModel(), and the condition briefly checks null and type validity. Intent is obvious: a checkbox for the 'isLeaf' property of a UML element. The constructor delegates localization and action setup cleanly. Length is minimal and appropriate, though the large license header inflates the file size without adding readability to the logic itself. Action granularity is good—one meaningful action per line. Reading flow is natural: imports, class declaration, constructor, then buildModel(). Minor readability improvements could include a guard clause to avoid the else branch, but overall the code is clear, concise, and well organized.

Run 1

Code Structure: Clearly organized into imports, a class, a constructor, and a model-update method. Nesting: Only one simple if/else, making control flow easy to follow. Clarity of intent: Descriptive class and method names convey the checkbox's purpose, though framework-specific calls and the string "isLeaf" require some context; documentation adds little explanation. Code length: Executable code is concise, but the lengthy license header dominates the file and extra blank lines add minor clutter. Action granularity: Each statement performs a single clear action; the constructor's wrapped superclass call remains readable. Reading flow: Conventional Java layout and straightforward top-to-bottom logic support natural reading, with only the header and chained facade calls adding friction.

Run 2

Code Structure: The class is logically organized into imports, a constructor, and a focused model-update method. Nesting: A single if/else keeps control flow shallow and easy to follow. Clarity of intent: Descriptive class and method names make the checkbox's purpose clear, although framework-specific calls require some context. Code length: The executable code is concise; the extensive license header and redundant constructor documentation add visual bulk. Action granularity: Statements generally perform one action per line, with the wrapped superclass call remaining readable. Reading flow: Consistent formatting and a straightforward target-validation-to-selection sequence support natural reading; extra blank lines and minimal explanatory class documentation slightly reduce polish.

Run 3

Code Structure: The class is logically organized, with imports, a constructor, and a focused model-update method. Nesting: A single if/else keeps control flow shallow and easy to follow. Clarity of intent: Descriptive class and method names, along with isLeaf and setSelected, make the checkbox's purpose clear, although framework behavior requires some external knowledge. Code length: The implementation is concise; the extensive license header and largely redundant comments add visual bulk without clarifying behavior. Action granularity: Statements generally perform one action per line, and the multiline constructor call is formatted clearly. Reading flow: Execution proceeds naturally from obtaining the target to validating it and updating selection, with consistent indentation and only minor extra whitespace.