Sample

Schnappinger/argoUML/org.argouml.dev.UndoManagerWrapper

Human rating uses the original dataset scale.

Human3.29
Lines93

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett10–1; higher is more readable
99.7Δ 63.7
Scalabrino0.9490–1; higher is more readable
97.9Δ 62.0
Dorn0.9740–1; higher is more readable
99.3Δ 63.4
Mi0.6140–1; higher is more readable
65.3Δ 29.4
LLOC1Logical lines; fewer is more readable
98.3Δ 62.4
DeepSeek V4 Pro5.670–20; mean of three runs
2.3Δ 33.7
GPT-6.1 Sol110–20; mean of three runs
3.3Δ 32.7
BTTF0.6460–1; higher is more readable
66.7Δ 30.7
Human3.291–4; original rating
36.0

Views

Source code

/* $Id: UndoManagerWrapper.java 17807 2010-01-12 18:29:32Z 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) 2006-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.dev; /** * By using this wrapper we are able to show the contents of the Undo stack. */ //public class UndoManagerWrapper extends UndoManager { public class UndoManagerWrapper { /** * The Constructor. */ public UndoManagerWrapper() { } // /* // * @see org.tigris.gef.undo.UndoManager#addMemento(org.tigris.gef.undo.Memento) // */ // public void addMemento(Memento memento) { // super.addMemento(memento); // UndoLogPanel.getInstance().addMemento(memento); // } // // /** // * @see org.tigris.gef.undo.UndoManager#empty() // */ // public void empty() { // super.empty(); // UndoLogPanel.getInstance().removeAll(); // } // // /** // * @see org.tigris.gef.undo.UndoManager#emptyUndo() // */ // public void emptyUndo() { // super.emptyUndo(); // } // // /* // * @see org.tigris.gef.undo.UndoManager#redo(org.tigris.gef.undo.Memento) // */ // protected void redo(Memento memento) { // UndoLogPanel.getInstance().addMemento(memento); // super.redo(memento); // } // // /* // * @see org.tigris.gef.undo.UndoManager#undo(org.tigris.gef.undo.Memento) // */ // protected void undo(Memento memento) { // UndoLogPanel.getInstance().removeMemento(memento); // super.undo(memento); // } // }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
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.129−7.694
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.66.608−2.198

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

Score0.949

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.1+1.001
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.003+0.917
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.92.721+0.886
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.83.191+0.538
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.14−0.253
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.85+0.065

Intercept 0.07 + feature contributions = 3.622 (log-odds).
Score = sigmoid(3.622) = 0.974.

Score0.614
Score1
Run 1

The code consists almost entirely of commented-out blocks and lengthy license headers, leaving only an empty wrapper class. Structure is confusing: the class is declared but all meaningful logic is disabled, and it no longer extends UndoManager despite the name suggesting it should. Nesting is flat, and action granularity is irrelevant since there are no active actions. Clarity of intent is poor—the purpose of the wrapper is unclear and the commented code raises ambiguity about whether functionality is intentionally removed or pending restoration. Code length is inflated by verbose legal text and dead comments. Reading flow is disjointed, forcing the reader to scroll past irrelevant blocks before reaching the trivial active code. Overall, the file is largely unreadable due to dead code and lack of substantive implementation.

Run 2

The code is largely unreadable due to excessive commented-out code, which obscures any actual implementation. The active class contains only an empty constructor, making its purpose unclear. The structure is tangled with large copyright blocks and dead code. Nesting is flat but the file lacks meaningful content. Clarity of intent is very low; the class name suggests a wrapper but no behavior is present. Code length is unnecessarily long due to commented blocks. Action granularity is irrelevant since there is no logic. Reading flow is poor because the reader must navigate through noise to find that nothing is implemented.

Run 3

This code is essentially a skeleton with all functionality commented out. The active class contains only an empty constructor, while the entire UndoManager logic is disabled via large block comments. Structure is poor - the massive copyright headers consume most of the file, burying the actual code. The commented-out methods create confusion about intent: is this a wrapper, a stub, or dead code? Nesting is minimal but only because there is no logic. Clarity of intent is ambiguous - the class name suggests UndoManager wrapping, but no wrapping occurs. Code length is unnecessarily long due to verbose license text and dead code comments. Action granularity and reading flow cannot be properly evaluated because there are no actions to read. The file violates basic readability by requiring readers to wade through dozens of lines of comments before reaching two lines of functional code. This appears to be disabled or abandoned code that should either be restored or deleted.

Run 1

Code Structure: The package and class are conventionally organized, but nearly all functionality is commented out, leaving an empty shell. Nesting: Minimal nesting makes the remaining code easy to scan. Clarity of intent: The class name and documentation suggest undo-stack logging, but the active implementation does nothing, creating a mismatch between stated purpose and behavior. Code length: Extensive license text and disabled methods overwhelm the tiny active implementation; the explicit empty constructor adds little value. Action granularity: The disabled methods generally contain one clear action per line. Reading flow: Conventional ordering helps, but commented-out inheritance and large blocks of inactive code interrupt the flow and obscure the class's current role.

Run 2

Code Structure: The class is logically organized, but nearly all functionality is commented out, obscuring its current role. Nesting: Very shallow, with no complex control flow. Clarity of intent: The class name and documentation suggest undo-stack monitoring, but the active implementation is only an empty constructor, contradicting that purpose. Code length: Excessive relative to the active functionality; the lengthy license notices and disabled implementation dominate the file. Action granularity: The commented methods generally contain one action per line, making individual operations easy to follow. Reading flow: Conventional Java organization helps, but extensive commented-out code and the disabled inheritance declaration interrupt the flow and require readers to distinguish historical behavior from actual behavior.

Run 3

Code Structure: The package and class are conventionally organized, but commented-out inheritance and methods obscure the actual implementation. Nesting: Very shallow and easy to follow. Clarity of intent: The class name and documentation suggest an undo-stack wrapper, yet the active class only has an empty constructor, making its current purpose unclear. Code length: The extensive license header and disabled implementation overwhelm the tiny amount of active code; the empty constructor and its generic documentation add little value. Action granularity: Statements in the disabled methods generally perform one action per line. Reading flow: Formatting is consistent, but readers must separate inactive historical code from executable code, disrupting an otherwise straightforward flow.