Sample

Schnappinger/argoUML/org.argouml.ui.explorer.rules.AbstractPerspectiveRule

Human rating uses the original dataset scale.

Human4
Lines66

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett10–1; higher is more readable
98.0Δ 6.1
Scalabrino0.8970–1; higher is more readable
88.0Δ 3.9
Dorn0.9690–1; higher is more readable
99.0Δ 7.1
Mi0.6120–1; higher is more readable
65.0Δ 26.9
LLOC4Logical lines; fewer is more readable
87.0Δ 5.0
DeepSeek V4 Pro17.330–20; mean of three runs
73.9Δ 18.0
GPT-6.1 Sol180–20; mean of three runs
73.8Δ 18.2
BTTF0.7450–1; higher is more readable
90.4Δ 1.5
Human41–4; original rating
91.9

Views

Source code

/* $Id: AbstractPerspectiveRule.java 17844 2010-01-12 19:35:07Z 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.ui.explorer.rules; import java.util.Collection; /** * * @author alexb */ public abstract class AbstractPerspectiveRule implements PerspectiveRule { /* * @see org.argouml.ui.explorer.rules.PerspectiveRule#getRuleName() */ public abstract String getRuleName(); /* * @see org.argouml.ui.explorer.rules.PerspectiveRule#getChildren(java.lang.Object) */ public abstract Collection getChildren(Object parent); /* * @see java.lang.Object#toString() */ public String toString() { return getRuleName(); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.66+26.4
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.262.331−8.657
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.207−7.811

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

Score0.897

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.008+0.86
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.86.94+0.598
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.65.864+0.511
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.22+0.024
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.87−0.02

Intercept 0.07 + feature contributions = 3.443 (log-odds).
Score = sigmoid(3.443) = 0.969.

Score0.612
Score4
Run 1

The code is highly readable overall. The structure is logical: license headers are clearly separated from the package declaration and class definition, and the class implements a single, clear responsibility via the PerspectiveRule interface. Nesting is effectively flat—there are no conditional blocks or nested method bodies. Intent is clear: this is an abstract base class defining a contract for rule naming and child retrieval, with a sensible toString override. The code is concise and avoids unnecessary length, though the extensive license header adds significant preamble before the actual code. Action granularity is clean, with one statement per line. Reading flow is natural, with imports, Javadoc comments, method declarations, and implementation ordered conventionally. Minor deductions come from the verbose multi-license header and the lack of Javadoc descriptions (only @see tags), but these do not materially harm comprehension.

Run 2

The code is highly readable. It has a clear, logical structure with a single class implementing an interface and minimal dependencies. Nesting is flat—there are no conditional blocks or loops. The intent is evident: it provides an abstract base for perspective rules with a rule name and children collection. Code length is concise and appropriate for an abstract class. Action granularity is clean, with each method containing one simple action. Reading flow is natural, from package declaration and imports to the class definition and straightforward method implementations. The only minor drawbacks are the lengthy legal header and redundant Javadoc comments, but these do not significantly hinder readability.

Run 3

The code is very readable. Structure is logical with a clear package declaration, imports, and a single abstract class implementing an interface. Nesting is flat—there is only one method with a body, and it contains a single return statement. Intent is clear: the class provides a base implementation of PerspectiveRule, delegating toString() to getRuleName(). Code length is concise, though the lengthy license headers slightly impact initial readability before reaching the actual code. Action granularity is good, with one operation per line. Reading flow is natural, with abstract methods annotated by comments indicating their origin. Deductions are mainly due to the verbose copyright blocks, which add noise, and the somewhat redundant Javadoc comments that do not add much value. Overall, the code is clean and maintainable.

Run 1

Code Structure: Clearly organized into package, import, class, and three related methods. Nesting: Minimal, with no nested control flow. Clarity of intent: Descriptive class and method names make the abstraction understandable, and toString clearly delegates to getRuleName; however, the empty class documentation and raw Collection type leave some details unspecified. Code length: The implementation is concise, though the extensive license header dominates the file visually. Action granularity: Each declaration or return statement occupies its own line. Reading flow: Consistent formatting and straightforward method ordering make the code easy to follow; repetitive reference comments provide limited additional context.

Run 2

Code Structure: Clearly organized into package, import, class declaration, and three focused methods. Nesting: Minimal, with no conditional or loop nesting. Clarity of intent: Descriptive class and method names make the purpose understandable, and toString() plainly delegates to getRuleName(); however, class documentation lacks a meaningful description and the raw Collection leaves child types unspecified. Code length: The implementation is concise, though the extensive license header dominates the file and repeated abstract declarations add some boilerplate. Action granularity: Each declaration or statement occupies its own line, with a single action in toString(). Reading flow: Conventional Java ordering and consistent formatting make the code easy to follow, with only minor distraction from verbose header comments and sparse explanatory documentation.

Run 3

Code Structure: The class is logically organized, with abstract rule methods followed by a simple toString implementation. Nesting: There is no nested control flow, making the code easy to scan. Clarity of intent: Class and method names communicate their roles, and toString clearly delegates to getRuleName; however, the class lacks a meaningful description, and the raw Collection type leaves child types unspecified. Code length: The implementation is concise, although the extensive license header dominates the file visually. Action granularity: Each declaration or statement expresses a single action. Reading flow: Package, import, class declaration, and methods appear in a conventional, natural order. Sparse explanatory documentation and lengthy boilerplate slightly reduce otherwise strong readability.