Sample

Schnappinger/argoUML/org.argouml.util.PredicateTrue

Human rating uses the original dataset scale.

Human3.9
Lines66

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett10–1; higher is more readable
98.3Δ 47.0
Scalabrino0.9430–1; higher is more readable
97.3Δ 45.9
Dorn0.7820–1; higher is more readable
80.9Δ 29.5
Mi0.6420–1; higher is more readable
71.3Δ 20.0
LLOC6Logical lines; fewer is more readable
79.7Δ 28.4
DeepSeek V4 Pro17.670–20; mean of three runs
83.0Δ 31.7
GPT-6.1 Sol180–20; mean of three runs
73.8Δ 22.4
BTTF0.8930–1; higher is more readable
100.0Δ 48.7
Human3.91–4; original rating
51.3

Views

Source code

/* $Id: PredicateTrue.java 17887 2010-01-12 21:17:18Z 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-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.util; /** * A Predicate that always returns true. Based on GEF utility class of the same * name. This is implemented as a singleton with a private constructor. * * @author Jason Robbins */ public class PredicateTrue implements Predicate { private PredicateTrue() { } public boolean evaluate(Object obj) { return true; } private static PredicateTrue theInstance = new PredicateTrue(); /** * @return the instance */ public static PredicateTrue getInstance() { return theInstance; } }

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.252.009−8.316
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.149−7.723

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

Score0.943

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.67−1.336
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.008+0.859
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.65.838+0.51
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.74.463+0.397
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.78.925+0.322
Indentation frequencyHow rapidly indentation changes from line to line.23+0.058

Intercept 0.07 + feature contributions = 1.28 (log-odds).
Score = sigmoid(1.28) = 0.782.

Score0.642
Score6
Run 1

The code is highly readable with excellent structure: a single class with a clear singleton pattern, minimal methods, and logical organization. Nesting is completely flat, and intent is unambiguous—a Predicate that always returns true. Code length is concise and appropriate for its purpose. Each action in the methods is on its own line, aiding readability. The reading flow is natural from constructor to evaluate to singleton accessor. The only minor drawback is the lengthy copyright header, which can obscure the actual code at first glance; removing it from the visible portion would improve the immediate readability without affecting the code logic.

Run 2

The code is highly readable due to its clear structure and simple purpose. It implements a singleton predicate with a private constructor, a single evaluate method, and a static accessor. There is no nesting and each line performs one action, aiding clarity. The class is concise and focused. The only drawback is the lengthy license header, which, while standard for open-source files, adds visual noise before the actual code and somewhat disrupts the initial reading flow. Excluding the header, the implementation is exemplary in clarity and intent.

Run 3

The code is highly readable. It follows a clear logical structure with license headers, package declaration, class definition, constructor, methods, and singleton field in sensible order. The nesting is flat, with no conditional or loop complexity. The intent of the PredicateTrue class is immediately clear from the class name and Javadoc comment, which explains the singleton pattern and purpose. The code is concise, containing only what is necessary with minimal boilerplate beyond required licensing. Each action occupies its own line with clear method boundaries, demonstrating good action granularity. The reading flow is natural, progressing from documentation through declaration to implementation details. Minor deductions include the long license header, which interrupts the flow before reaching code, and the singleton field placement after methods rather than at the top, which is slightly unconventional. Overall, the implementation is straightforward and self-documenting.

Run 1

Code Structure: A simple, logically organized singleton class, though placing the instance field before the methods would improve conventional organization. Nesting: Minimal nesting with no conditional branches. Clarity of intent: The class name, documentation, and unconditional return clearly convey an always-true predicate. Code length: The implementation is concise; the extensive license header adds reading overhead but serves a legitimate purpose. Action granularity: Each statement performs one action, with no compressed multi-action lines. Reading flow: Consistent formatting and short methods make the code easy to follow, although the lengthy header delays reaching the implementation and the singleton field interrupts the method sequence.

Run 2

Code Structure: The small class cleanly separates construction, evaluation, and singleton access, though declaring the singleton field before methods would improve organization. Nesting: There is no nested control flow. Clarity of intent: The class name, documentation, and unconditional return clearly communicate an always-true predicate; the private constructor makes the singleton pattern evident. Code length: Implementation is concise, although extensive license comments dominate the file. Action granularity: Each statement performs one simple action. Reading flow: Formatting and short methods make the code easy to follow, with minor interruption from the field placement and lengthy header.

Run 3

Code Structure: The small class cleanly separates construction, predicate evaluation, and singleton access, although placing the singleton field before the methods would be more conventional. Nesting: There is no nested control flow. Clarity of intent: The class name, documentation, and unconditional return clearly communicate an always-true predicate; the private constructor makes the singleton design evident. Code length: The implementation is concise, but extensive licensing comments dominate the file. Action granularity: Each statement performs one action, with no compressed operations. Reading flow: Formatting and short methods make the implementation easy to follow, though the lengthy header and late field declaration slightly interrupt the flow.