Sample

Schnappinger/argoUML/org.argouml.model.AbstractUseCasesHelperDecorator

Human rating uses the original dataset scale.

Human3.93
Lines168

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
46.8Δ 14.7
Scalabrino0.7320–1; higher is more readable
44.5Δ 17.0
Dorn0.8890–1; higher is more readable
95.7Δ 34.2
Mi0.5670–1; higher is more readable
49.2Δ 12.4
LLOC51Logical lines; fewer is more readable
38.8Δ 22.8
DeepSeek V4 Pro170–20; mean of three runs
66.8Δ 5.3
GPT-6.1 Sol170–20; mean of three runs
55.3Δ 6.3
BTTF0.6820–1; higher is more readable
74.6Δ 13.0
Human3.931–4; original rating
61.6

Views

Source code

/* $Id: AbstractUseCasesHelperDecorator.java 17747 2010-01-10 21:16:51Z 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-2006 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.model; import java.util.Collection; /** * An abstract Decorator for the {@link UseCasesHelper}. * * @author Bob Tarling */ public abstract class AbstractUseCasesHelperDecorator implements UseCasesHelper { /** * The component. */ private UseCasesHelper impl; /** * @param component The component to decorate. */ protected AbstractUseCasesHelperDecorator(UseCasesHelper component) { impl = component; } /** * The component we are decorating. * * @return Returns the component. */ protected UseCasesHelper getComponent() { return impl; } public Collection getExtensionPoints(Object useCase) { return Model.getFacade().getExtensionPoints(useCase); } /* * @see org.argouml.model.UseCasesHelper#getAllUseCases(java.lang.Object) */ public Collection getAllUseCases(Object ns) { return impl.getAllUseCases(ns); } public Collection getAllActors(Object ns) { return impl.getAllActors(ns); } public Collection getExtendedUseCases(Object ausecase) { return impl.getExtendedUseCases(ausecase); } public Object getExtends(Object abase, Object anextension) { return impl.getExtends(abase, anextension); } public Collection getIncludedUseCases(Object ausecase) { return impl.getIncludedUseCases(ausecase); } public Object getIncludes(Object abase, Object aninclusion) { return impl.getIncludes(abase, aninclusion); } public Collection getSpecificationPath(Object ausecase) { return impl.getSpecificationPath(ausecase); } public void setBase(Object extend, Object base) { impl.setBase(extend, base); } public void removeExtend(Object elem, Object extend) { impl.removeExtend(elem, extend); } public void removeExtensionPoint(Object elem, Object ep) { impl.removeExtensionPoint(elem, ep); } public void removeInclude(Object usecase, Object include) { impl.removeInclude(usecase, include); } public void addExtend(Object elem, Object extend) { impl.addExtend(elem, extend); } public void addExtensionPoint(Object handle, Object extensionPoint) { impl.addExtensionPoint(handle, extensionPoint); } public void addExtensionPoint(Object handle, int position, Object extensionPoint) { impl.addExtensionPoint(handle, position, extensionPoint); } public void addInclude(Object usecase, Object include) { impl.addInclude(usecase, include); } public void setAddition(Object handle, Object useCase) { impl.setAddition(handle, useCase); } public void setCondition(Object handle, Object booleanExpression) { impl.setCondition(handle, booleanExpression); } public void setExtension(Object handle, Object ext) { impl.setExtension(handle, ext); } public void setExtensionPoints(Object handle, Collection extensionPoints) { impl.setExtensionPoints(handle, extensionPoints); } public void setIncludes(Object handle, Collection includes) { impl.setIncludes(handle, includes); } public void setLocation(Object handle, String loc) { impl.setLocation(handle, loc); } public void setUseCase(Object elem, Object usecase) { impl.setUseCase(elem, usecase); } }

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.3236.426−106.802
Source linesThe number of non-empty source lines.168+67.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.005−7.508

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

Score0.732

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.169−4.947
Indentation frequencyHow rapidly indentation changes from line to line.119+3.379
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.167.938+1.938
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.044+0.514
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.77.598+0.448
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.79.923+0.28

Intercept 0.07 + feature contributions = 2.079 (log-odds).
Score = sigmoid(2.079) = 0.889.

Score0.567
Score51
Run 1

The code follows a clear decorator pattern with a flat, consistent structure, making it easy to understand. Methods are short, each performing a single delegation to the wrapped component, which improves readability. However, the code is repetitive, with many one-line delegation methods that add length without complexity. The copyright header is excessively long and could distract from the actual code. Method names are descriptive and self-explanatory, aiding clarity of intent. Nesting is minimal, and the reading flow is natural, grouping getter-like methods before setter-like methods. Overall, the structure is logical and readable, but brevity could be improved by using inheritance or generated delegates, which would slightly reduce the score.

Run 2

The code is highly readable due to its consistent structure and clear intent. It follows a standard decorator pattern with a single private field, a protected constructor, and a getter, followed by numerous one-line delegating methods. Nesting is minimal, and the method bodies are extremely flat and concise. Each method performs exactly one delegation action, demonstrating excellent action granularity. The reading flow is natural: package, imports, class declaration, field, constructor, getter, then a logical grouping of methods. The only minor deductions are due to the long license header, which, while standard, slightly delays the start of the actual code, and a small formatting inconsistency in one method signature (line wrap), which slightly interrupts visual rhythm.

Run 3

The code demonstrates excellent structure and readability. It begins with a lengthy license header, which is typical for open-source projects but can distract from the core logic. The class is well-organized: a single private field with a clear name, a constructor with a descriptive parameter comment, and a simple accessor. Method names follow standard Java conventions and clearly convey their intent. Nesting is minimal—there are no conditional blocks or loops, so the flow is entirely flat. Each method contains a single action (delegating to the underlying implementation), maintaining concise granularity. The reading flow is natural, grouping related methods like 'get', 'set', 'add', and 'remove' operations. The only minor drawbacks are the extensive copyright headers and the slightly inconsistent indentation (4 spaces vs tab) on the class declaration line, which slightly disrupt visual flow. Overall, this is a highly readable decorator class.

Run 1

Code Structure: The class is logically organized around a decorator component, with construction and access followed by delegation methods. Nesting: Methods are flat, with no conditional or loop nesting. Clarity of intent: The class documentation and method names make delegation clear, but generic Object parameters, raw Collection types, and abbreviated names such as ep, ext, and loc reduce precision. getExtensionPoints unexpectedly uses Model.getFacade() rather than the decorated component. Code length: Individual methods are concise; repetitive forwarding is appropriate for this pattern, although extensive licensing text and sparse documentation add reading overhead. Action granularity: Each method contains a single clear action, with one statement per line. Reading flow: Consistent method formatting supports easy scanning, but uneven naming, mixed indentation, and the exceptional delegation path slightly disrupt predictability.

Run 2

Code Structure: A clearly organized decorator class with its field, constructor, accessor, and delegation methods separated logically. Nesting: Completely flat method bodies make execution easy to follow. Clarity of intent: The class documentation and descriptive method names communicate its purpose, but abbreviated parameters such as ns, ep, and ext, generic Object types, and raw Collections reduce precision. getExtensionPoints unexpectedly uses Model.getFacade() rather than the decorated component, without explaining why. Code length: Individual methods are concise; repetitive forwarding methods and the lengthy license header increase overall scanning effort, though much of this is conventional boilerplate. Action granularity: Each method contains a single action, with one statement per line. Reading flow: Consistent formatting and predictable delegation support smooth reading, but inconsistent parameter naming and limited method grouping slightly weaken navigation.

Run 3

Code Structure: The decorator is logically organized around a wrapped component, with small delegation methods. Nesting: Methods are flat, with no nested control flow. Clarity of intent: The class documentation and method names make the purpose clear, but vague parameter names such as elem, handle, and ep, raw Collections, and Object types reduce precision. getExtensionPoints unexpectedly uses Model.getFacade() rather than the wrapped component, without explanation. Code length: Individual methods are concise; repetitive delegation and the lengthy license header increase overall length but are largely justified. Action granularity: Each statement performs one clear action, usually a single delegated call. Reading flow: Consistent method formatting supports easy scanning, though inconsistent naming, sparse documentation, and limited grouping of related operations slightly weaken the flow.