Sample

Schnappinger/argoUML/org.argouml.core.propertypanels.ui.UMLTemplateParameterParameterComboBoxModel

Human rating uses the original dataset scale.

Human3.27
Lines146

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
46.2Δ 10.8
Scalabrino0.7730–1; higher is more readable
56.2Δ 20.9
Dorn0.2470–1; higher is more readable
44.6Δ 9.2
Mi0.4790–1; higher is more readable
31.0Δ 4.3
LLOC32Logical lines; fewer is more readable
48.5Δ 13.2
DeepSeek V4 Pro15.330–20; mean of three runs
41.3Δ 5.9
GPT-6.1 Sol160–20; mean of three runs
38.9Δ 3.6
BTTF0.5210–1; higher is more readable
45.9Δ 10.6
Human3.271–4; original rating
35.3

Views

Source code

/* $Id: UMLTemplateParameterParameterComboBoxModel.java 19907 2012-12-30 13:06:01Z closettop_nightlybuild $ ***************************************************************************** * Copyright (c) 2009-2012 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: * Bob Tarling ***************************************************************************** * * Some portions of this file was previously release using the BSD License: */ // Copyright (c) 1996-2008 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.core.propertypanels.ui; import java.util.ArrayList; import java.util.Collection; import java.util.Set; import java.util.TreeSet; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.Action; import org.argouml.kernel.Project; import org.argouml.kernel.ProjectManager; import org.argouml.model.Model; import org.argouml.uml.util.PathComparator; /** * The combobox model for the parameter belonging to some TemplateParameter. */ class UMLTemplateParameterParameterComboBoxModel extends UMLComboBoxModel { /** * The class uid. */ private static final long serialVersionUID = -1295242702819038923L; private static final Logger LOG = Logger.getLogger(UMLTemplateParameterParameterComboBoxModel.class .getName()); /** * Constructor for UMLStructuralFeatureTypeComboBoxModel. */ public UMLTemplateParameterParameterComboBoxModel(Object target) { super(target, "parameter", true); // Allow null } /* * @see org.argouml.uml.ui.UMLComboBoxModel#isValidElement(Object) */ protected boolean isValidElement(Object element) { return Model.getFacade().isAModelElement(element); } /* * @see org.argouml.uml.ui.UMLComboBoxModel#buildModelList() */ @SuppressWarnings("unchecked") protected void buildModelList() { Set<Object> elements = new TreeSet<Object>(new PathComparator()); Project p = ProjectManager.getManager().getCurrentProject(); if (p == null) { return; } for (Object model : p.getUserDefinedModelList()) { elements.addAll(Model.getModelManagementHelper() .getAllModelElementsOfKind( model, Model.getMetaTypes().getModelElement())); } elements.addAll(p.getProfileConfiguration().findByMetaType( Model.getMetaTypes().getClassifier())); setElements(elements); } @SuppressWarnings("unchecked") @Override protected void buildMinimalModelList() { Collection list = new ArrayList(1); Object element = getSelectedModelElement(); LOG.log(Level.INFO, "The selected element is {0}", element); if (element != null) { LOG.log(Level.INFO, "The selected element is {0}", Model.getFacade().getName(element)); } if (element != null) { list.add(element); } setElements(list); } @Override protected boolean isLazy() { return true; } /* * @see org.argouml.uml.ui.UMLComboBoxModel#getSelectedModelElement() */ protected Object getSelectedModelElement() { Object o = null; if (getTarget() != null) { o = Model.getFacade().getParameter(getTarget()); } return o; } public Action getAction() { return null; } }

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.2975.902−98.205
Source linesThe number of non-empty source lines.146+58.4
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.061−7.592

Intercept 8.87 + feature contributions = -38.526 (log-odds).
Score = sigmoid(-38.526) = 0.

Score0.773

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.147−4.168
Indentation frequencyHow rapidly indentation changes from line to line.98+2.653
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.98−1.828
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.145.833+1.629
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.106.946+0.921
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.106.946−0.865
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.048+0.475

Intercept 0.07 + feature contributions = -1.113 (log-odds).
Score = sigmoid(-1.113) = 0.247.

Score0.479
Score32
Run 1

The code is moderately readable. Structure is clear with standard Java class organization and logical method grouping. Nesting is shallow, with only a few if-statements and loops. Intent is mostly clear, though some methods like isValidElement remain ambiguous without context. Length is reasonable, though the long copyright header adds noise. Action granularity is acceptable—one main action per line. Reading flow is natural with straightforward method names, but the code lacks modern Java features (generics, streams) and contains redundant null checks and logging that could be simplified. Consistency is good, but minor issues like repeated `element != null` checks and unused imports slightly reduce clarity. Overall, it's readable but could be improved with small refactoring.

Run 2

The code is well-structured and readable, with clear separation of methods, logical imports, and consistent formatting. The class has a single responsibility and methods are concise, performing focused tasks. Nesting is low, with only a few conditional blocks. Method names and variable names are descriptive, making intent clear. The code includes some redundancy, such as duplicate null checks in buildMinimalModelList(), and unnecessary logging that adds minor clutter. The long license header slightly reduces readability but is standard practice. Overall, the code is easy to follow, maintain, and understand, with only minor areas for improvement.

Run 3

The code is well-structured with clear method separation, consistent naming, and standard Java logging. Nesting is shallow (max 2 levels), and each line performs a single logical action. Intent is generally clear, especially in buildModelList and getSelectedModelElement. However, buildMinimalModelList contains redundant logging and a duplicated null check, which slightly hurts readability. The lengthy license header adds noise. Overall, the code follows good OO practices and is easy to follow.

Run 1

Code Structure: Well organized into small, focused methods with clear separation between validation, list construction, and selection retrieval. Nesting: Shallow conditionals and a single loop keep complexity low; an early return simplifies project handling. Clarity of intent: Descriptive method names and framework calls convey purpose, but generic variables (p, o, list), raw collection types, and an incorrect constructor comment reduce clarity. Code length: The implementation is reasonably concise, though extensive license headers, repetitive logging, and duplicate null checks add bulk. Action granularity: Statements generally perform one action per line; chained API calls remain understandable despite wrapping. Reading flow: Consistent formatting and predictable method boundaries support natural reading, but redundant checks and uneven annotation/comment conventions introduce minor distractions.

Run 2

Code Structure: Well-organized class with small, focused methods and clearly separated responsibilities. Nesting: Shallow conditionals and a single loop keep complexity low; the early return helps. Clarity of intent: Descriptive method names and straightforward model operations communicate purpose, but generic Object types, terse variables (p, o), an incorrect constructor comment, and an unexplained null action reduce clarity. Code length: Implementation is reasonably concise, although extensive license text, duplicate null checks, and repetitive logging add reading overhead. Action granularity: Statements generally perform one action per line; chained API calls remain understandable despite awkward wrapping. Reading flow: Conventional Java layout and method ordering support natural reading, but inconsistent indentation, raw collection types, and redundant comments slightly interrupt the flow.

Run 3

Code Structure: Well-organized class with small, focused methods and clear separation of list construction, selection, and validation. Nesting: Shallow conditionals and a single loop make control flow easy to follow; the early return helps. Clarity of intent: Descriptive method names explain the combobox model's purpose, but the incorrect constructor comment, abbreviated variables, raw Collection, and unexplained null action reduce clarity. Code length: Implementation is reasonably concise, though extensive license boilerplate, redundant null checks, and repeated logging add reading overhead. Action granularity: Statements generally perform one action per line; chained model API calls are somewhat dense but consistently formatted. Reading flow: Methods follow a coherent progression and formatting is consistent, although verbose API chains and duplicated checks interrupt the flow.