Sample

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

Human rating uses the original dataset scale.

Human3.95
Lines67

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett10–1; higher is more readable
95.0Δ 25.5
Scalabrino0.7750–1; higher is more readable
56.8Δ 12.6
Dorn0.7910–1; higher is more readable
83.2Δ 13.7
Mi0.580–1; higher is more readable
54.8Δ 14.7
LLOC6Logical lines; fewer is more readable
79.7Δ 10.2
DeepSeek V4 Pro170–20; mean of three runs
66.8Δ 2.6
GPT-6.1 Sol180–20; mean of three runs
73.8Δ 4.3
BTTF0.7240–1; higher is more readable
87.1Δ 17.7
Human3.951–4; original rating
69.5

Views

Source code

/* $Id: EnumerationListModel.java 17896 2010-01-12 21:36:11Z 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: * bobtarling ***************************************************************************** * * Some portions of this file was previously release using the BSD License: */ // Copyright (c) 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 org.argouml.model.Model; /** * The list model for the enumeration of a literal. * * @author mvw@tigris.org */ class EnumerationListModel extends UMLModelElementListModel { /** * Constructor for EnumerationListModel. */ public EnumerationListModel(Object target, String propertyName) { super(propertyName); setTarget(target); } @Override protected void buildModelList() { addElement(Model.getFacade().getEnumeration(getTarget())); } @Override protected boolean isValidElement(Object element) { return Model.getFacade().isAEnumeration(element); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.67+26.8
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.494.939−16.333
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.179−7.769

Intercept 8.87 + feature contributions = 11.568 (log-odds).
Score = sigmoid(11.568) = 1.

Score0.775

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.68−1.371
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.018+0.77
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.66.848+0.525
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.75.662+0.416
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.971+0.363
Indentation frequencyHow rapidly indentation changes from line to line.26+0.162

Intercept 0.07 + feature contributions = 1.332 (log-odds).
Score = sigmoid(1.332) = 0.791.

Score0.58
Score6
Run 1

The code is highly readable with clear structure and intent. The class has a single responsibility, and methods are concise with one action per line. Nesting is minimal and the flow is natural. License headers are long but separate from logic, and do not impact readability of the actual implementation. The only minor drawback is the lack of a null check or validation in buildModelList and isValidElement, but that does not significantly hurt clarity. Overall, the code is maintainable and easy to follow.

Run 2

The code is highly readable. It has a clear, logical structure with a standard license header, package declaration, and a single small class. The class is well-named and its purpose is evident from the context and Javadoc. There is no unnecessary nesting; the methods are flat and perform exactly one task each. The code length is minimal and avoids boilerplate. Each method contains a single statement, aligning with the action granularity criterion. The reading flow is natural: constructor, then list-building method, then validation method. The only minor drawback is the presence of two long copyright headers, which slightly disrupts the initial flow, but this is common in open-source projects and does not significantly impact readability. Overall, the code is concise, clear, and well-organized.

Run 3

The code is well-structured and readable. It has a clear class with a single responsibility, a simple constructor, and two concise overridden methods. Nesting is minimal, and intent is evident from method names and comments. Action granularity is appropriate—one meaningful operation per line. The main drawback is the excessive license header (over 40 lines) before the actual code, which disrupts reading flow and adds unnecessary length. The inline Javadoc is helpful but sparse. Overall, the logic is straightforward and maintainable.

Run 1

Code Structure: A small, cohesive class cleanly separates initialization, list construction, and element validation. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive class and method names, the class documentation, and explicit overrides make the purpose clear, although inherited behavior and chained facade calls require some framework knowledge. Code length: The implementation is concise, but the extensive legal header and redundant constructor documentation add reading overhead. Action granularity: Each statement performs one clear operation on its own line. Reading flow: Consistent formatting and the natural constructor-to-method ordering make the implementation easy to follow.

Run 2

Code Structure: A focused class with clearly separated constructor, list-building, and validation methods. Nesting: No nested control flow; method bodies are flat and simple. Clarity of intent: Descriptive class and method names make the purpose apparent, although Object parameters and framework dependencies leave some context implicit. Code length: Implementation is concise, but the extensive license header dominates the file and delays reaching the functional code. Action granularity: Each statement performs one clear operation, with short method chains that remain easy to understand. Reading flow: Consistent formatting and a natural constructor-to-behavior order support smooth reading; redundant constructor documentation adds minor noise.

Run 3

Code Structure: The class is logically organized, with a constructor followed by two focused overrides. Nesting: There is no nested control flow, making the implementation easy to scan. Clarity of intent: Descriptive class and method names, plus the class documentation, clearly communicate the model's purpose; generic Object parameters and framework dependencies slightly limit standalone understanding. Code length: The implementation is concise, although the extensive license header dominates the file and the constructor comment adds little information. Action granularity: Each statement occupies its own line and performs a focused operation. Reading flow: Consistent formatting and conventional Java organization provide a natural progression from initialization to list construction and element validation.