Sample

Schnappinger/argoUML/org.argouml.ui.SettingsTabLayout

Human rating uses the original dataset scale.

Human3.01
Lines216

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
57.9Δ 28.2
Scalabrino0.8220–1; higher is more readable
68.2Δ 38.4
Dorn0.150–1; higher is more readable
37.3Δ 7.6
Mi0.5680–1; higher is more readable
50.5Δ 20.8
LLOC37Logical lines; fewer is more readable
45.2Δ 15.5
DeepSeek V4 Pro10.670–20; mean of three runs
10.6Δ 19.1
GPT-6.1 Sol130–20; mean of three runs
9.4Δ 20.3
BTTF0.5650–1; higher is more readable
52.5Δ 22.8
Human3.011–4; original rating
29.7

Views

Source code

/* $Id: SettingsTabLayout.java 17841 2010-01-12 19:17:52Z 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: * mvw ***************************************************************************** * * 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.ui; import java.awt.BorderLayout; import javax.swing.BorderFactory; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; import org.argouml.application.api.GUISettingsTabInterface; import org.argouml.configuration.Configuration; import org.argouml.configuration.ConfigurationKey; import org.argouml.i18n.Translator; import org.tigris.swidgets.Property; /** * Settings dialog tab panel for layout options.<p> * * TODO: This class contains a lot of references to org.argouml.uml.ui. * It would probably be better to move it there. * * TODO: This class breaks too many dependency limitations. * And it is not used anywhere. So I (MVW) disabled its functionality. * * @author Linus Tolke */ class SettingsTabLayout extends JPanel implements GUISettingsTabInterface { // private Property prpTodo; // private Property prpProperties; // private Property prpDocumentation; // private Property prpStyle; // private Property prpSource; // private Property prpConstraints; // private Property prpTaggedValues; /** * The constructor. * */ SettingsTabLayout() { super(); setLayout(new BorderLayout()); // TODO: Localize these final String[] positions = {"North", "South", "East"}; final String paneColumnHeader = "Pane"; final String positionColumnHeader = "Position"; JPanel top = new JPanel(new BorderLayout()); // prpTodo = createProperty("label.todo-pane", positions, TabToDo.class); // prpProperties = // createProperty("label.properties-pane", // positions, TabProps.class); // prpDocumentation = // createProperty("label.documentation-pane", // positions, TabDocumentation.class); // prpStyle = // createProperty("label.style-pane", // positions, TabStyle.class); // prpSource = // createProperty("label.source-pane", // positions, TabSrc.class); // prpConstraints = // createProperty("label.constraints-pane", // positions, TabConstraints.class); // prpTaggedValues = // createProperty("label.tagged-values-pane", // positions, TabTaggedValues.class); // // Property[] propertyList = new Property[] { // prpTodo, prpProperties, prpDocumentation, prpStyle, // prpSource, prpConstraints, prpTaggedValues, // }; // Arrays.sort(propertyList); // // top.add(new JScrollPane(new PropertyTable( // propertyList, // paneColumnHeader, // positionColumnHeader)), // BorderLayout.CENTER); top.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); add(top, BorderLayout.CENTER); JLabel restart = new JLabel(Translator.localize("label.restart-application")); restart.setHorizontalAlignment(SwingConstants.CENTER); restart.setVerticalAlignment(SwingConstants.CENTER); restart.setBorder(BorderFactory.createEmptyBorder(10, 2, 10, 2)); add(restart, BorderLayout.SOUTH); } /** * Create a Property for the position of the given tab pane, selecting * the current display value from the user properties file. */ private Property createProperty(String text, String[] positions, Class tab) { ConfigurationKey key = makeKey(tab); String currentValue = Configuration.getString(key, "South"); return new Property(Translator.localize(text), String.class, currentValue, positions); } private void loadPosition(Property position, Class tab) { ConfigurationKey key = makeKey(tab); position.setCurrentValue(Configuration.getString(key, "South")); } private void savePosition(Property position, Class tab) { ConfigurationKey key = makeKey(tab); Configuration.setString(key, position.getCurrentValue().toString()); } private ConfigurationKey makeKey(Class tab) { String className = tab.getName(); String shortClassName = className.substring(className.lastIndexOf('.') + 1).toLowerCase(); ConfigurationKey key = Configuration.makeKey("layout", shortClassName); return key; } /** * When the setting values should be reloaded. */ public void handleSettingsTabRefresh() { // loadPosition(prpTodo, TabToDo.class); // loadPosition(prpProperties, TabProps.class); // loadPosition(prpDocumentation, TabDocumentation.class); // loadPosition(prpStyle, TabStyle.class); // loadPosition(prpSource, TabSrc.class); // loadPosition(prpConstraints, TabConstraints.class); // loadPosition(prpTaggedValues, TabTaggedValues.class); } /** * When the ok or apply button is pressed. */ public void handleSettingsTabSave() { // savePosition(prpTodo, TabToDo.class); // savePosition(prpProperties, TabProps.class); // savePosition(prpDocumentation, TabDocumentation.class); // savePosition(prpStyle, TabStyle.class); // savePosition(prpSource, TabSrc.class); // savePosition(prpConstraints, TabConstraints.class); // savePosition(prpTaggedValues, TabTaggedValues.class); } /* * @see GUISettingsTabInterface#handleSettingsTabCancel() */ public void handleSettingsTabCancel() { } /* * @see org.argouml.ui.GUISettingsTabInterface#handleResetToDefault() */ public void handleResetToDefault() { // Do nothing - these buttons are not shown. } /* * @see GUISettingsTabInterface#getTabKey() */ public String getTabKey() { return "tab.layout"; } /* * @see GUISettingsTabInterface#getTabPanel() */ public JPanel getTabPanel() { return this; } /** * The UID. */ private static final long serialVersionUID = 739259705815092510L; }

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.3208.938−105.895
Source linesThe number of non-empty source lines.216+86.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.025−7.538

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

Score0.822

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.217−6.647
Indentation frequencyHow rapidly indentation changes from line to line.97+2.618
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.215.914+2.608
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.97−1.805
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.03+0.655
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.79.949+0.486
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.79.945+0.279

Intercept 0.07 + feature contributions = -1.736 (log-odds).
Score = sigmoid(-1.736) = 0.15.

Score0.568
Score37
Run 1

The code readability is severely hampered by large blocks of commented-out code (~60 lines), which dominate the file and obscure the active logic. The file starts with a long copyright header, then jump-worthy import statements, but the class's structure is mostly logical. The constructor is slightly cluttered with unused local variables and a large commented section. Nesting is generally flat, which is good. Intent is partially clear from Javadoc but diluted by TODOs and obsolete comments. Code repetition in createProperty, loadPosition, and savePosition is notable but simple. Action granularity is reasonable. Reading flow is disrupted by dead code and comments, making it hard to follow the actual implementation.

Run 2

The code is generally structured, with clear sections for imports, fields, constructor, and methods. However, there are several readability issues. A significant amount of the code is commented out, which adds clutter and makes the active logic less obvious. The file includes a very long copyright header, further padding the file length. The `createProperty`, `loadPosition`, and `savePosition` methods are concise and each performs a limited number of actions, which is good. Yet, the presence of TODOs and commented-out blocks makes the intent ambiguous, especially since the class is noted as unused. Nesting is shallow. The reading flow is disrupted by the large commented chunks. Overall, it is readable but has unnecessary noise.

Run 3

The code has a logical structure with clear sections (imports, class declaration, constructor, methods), but readability is significantly reduced by large blocks of commented-out code and mixed formatting. The nesting is mostly flat, which is positive, but the excessive TODO and commented-out Property declarations obscure the active logic. Intent is somewhat clear—it's a settings tab layout panel—but the disabled functionality makes the actual purpose ambiguous. Code length is inflated by legacy comments and unused helper methods (createProperty, loadPosition, savePosition, makeKey), which add noise without contributing to current behavior. Action granularity is adequate, with one action per line in most active sections. Reading flow is disrupted by inconsistent indentation (e.g., tabs in method signatures) and scattered commented code. Overall, while the active code is simple, the surrounding clutter prevents it from being highly readable.

Run 1

Code Structure: Constructor, configuration helpers, and interface callbacks are logically separated, but disabled functionality leaves unused helpers and variables. Nesting: Very flat, with no complex control flow. Clarity of intent: Descriptive method names and comments explain the layout settings purpose, although the largely disabled implementation makes actual behavior less obvious. Code length: Extensive commented-out code substantially increases reading effort without contributing to execution. Action granularity: Most statements perform one action per line; compact getters and empty callbacks are still understandable. Reading flow: Active methods follow a natural sequence, but large inactive blocks and inconsistent indentation interrupt scanning. Overall, the active code is straightforward, while accumulated disabled code reduces readability.

Run 2

Code Structure: Constructor, configuration helpers, and interface callbacks are logically separated, but disabled functionality and unused helpers clutter the class. Nesting: Very flat, with no complex control flow. Clarity of intent: Descriptive method names and comments explain the layout-settings purpose, but commented-out implementation, unused variables, and empty callbacks obscure what actually works. Code length: Active logic is concise, yet extensive commented-out code and repetitive disabled calls make the file unnecessarily cumbersome to scan. Action granularity: Most statements perform one action per line; compact one-line methods are still understandable. Reading flow: UI setup and configuration operations follow a natural sequence, but large inactive blocks and inconsistent indentation interrupt that flow. Overall, the executable code is straightforward, while accumulated dead code significantly reduces readability.

Run 3

Code Structure: The constructor, configuration helpers, and interface callbacks are logically separated, but disabled functionality and unused helpers clutter the class. Nesting: Nearly all code is flat, making individual operations easy to follow. Clarity of intent: Names and documentation convey a layout-settings panel, and TODOs explain its disabled state; however, commented-out implementation and unused variables obscure what actually works. Code length: Small active methods are concise, but extensive commented-out code substantially increases reading effort. Action granularity: Most statements perform one action per line; a few inline methods compress declarations and returns. Reading flow: UI setup and configuration operations follow a natural sequence, but large inactive blocks and inconsistent indentation interrupt that flow.