Sample

Schnappinger/argoUML/org.argouml.model.euml.CollaborationsFactoryEUMLImpl

Human rating uses the original dataset scale.

Human3.96
Lines198

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
33.1Δ 47.3
Scalabrino0.7520–1; higher is more readable
49.3Δ 31.0
Dorn0.9550–1; higher is more readable
97.7Δ 17.3
Mi0.5710–1; higher is more readable
51.5Δ 28.9
LLOC76Logical lines; fewer is more readable
28.1Δ 52.3
DeepSeek V4 Pro13.670–20; mean of three runs
26.9Δ 53.5
GPT-6.1 Sol160–20; mean of three runs
38.9Δ 41.4
BTTF0.6250–1; higher is more readable
61.7Δ 18.6
Human3.961–4; original rating
80.4

Views

Source code

// $Id: CollaborationsFactoryEUMLImpl.java 19617 2011-07-23 09:04:49Z linus $ /*************************************************************************** * Copyright (c) 2007,2010 Tom Morris and other contributors * 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: * Tom Morris - initial API and implementation ***************************************************************************/ package org.argouml.model.euml; import org.argouml.model.AbstractModelFactory; import org.argouml.model.CollaborationsFactory; import org.eclipse.uml2.uml.Collaboration; import org.eclipse.uml2.uml.ConnectableElement; import org.eclipse.uml2.uml.Connector; import org.eclipse.uml2.uml.ConnectorEnd; import org.eclipse.uml2.uml.Element; import org.eclipse.uml2.uml.Interaction; import org.eclipse.uml2.uml.Lifeline; import org.eclipse.uml2.uml.Message; import org.eclipse.uml2.uml.MessageOccurrenceSpecification; import org.eclipse.uml2.uml.UMLFactory; /** * Eclipse UML2 implementation of CollaborationsFactory. */ class CollaborationsFactoryEUMLImpl implements CollaborationsFactory, AbstractModelFactory { /** * The model implementation. */ private EUMLModelImplementation modelImpl; /** * Constructor. * * @param implementation The ModelImplementation. */ public CollaborationsFactoryEUMLImpl( EUMLModelImplementation implementation) { modelImpl = implementation; } public Object buildActivator(Object owner, Object interaction) { throw new NotYetImplementedException(); } public ConnectorEnd buildAssociationEndRole(Object atype) { Lifeline lifeline = (Lifeline) atype; ConnectorEnd end = UMLFactory.eINSTANCE.createConnectorEnd(); ConnectableElement prop = lifeline.getRepresents(); if (prop == null) { prop = UMLFactory.eINSTANCE.createProperty(); lifeline.setRepresents(prop); } end.setRole(prop); // lifeline.setRepresents(prop); return end; } public Connector buildAssociationRole(Object from, Object to) { return buildAssociationRole((Lifeline) from, (Lifeline) to); } /** * Internal type-checked version of buildAssociationRole. */ private Connector buildAssociationRole(Lifeline from, Lifeline to) { Connector connector = UMLFactory.eINSTANCE.createConnector(); from.getInteraction().getOwnedConnectors().add(connector); connector.getEnds().add(buildAssociationEndRole(from)); connector.getEnds().add(buildAssociationEndRole(to)); return connector; } @Deprecated public Object buildAssociationRole(Object from, Object agg1, Object to, Object agg2, Boolean unidirectional) { if (unidirectional == null) { return buildAssociationRole(from, agg1, to, agg2, false); } else { return buildAssociationRole(from, agg1, to, agg2, unidirectional.booleanValue()); } } public Object buildAssociationRole(Object from, Object agg1, Object to, Object agg2, boolean unidirectional) { // TODO: Auto-generated method stub return null; } public Object buildAssociationRole(Object link) { // TODO: Auto-generated method stub return null; } public Object buildClassifierRole(Object collaboration) { throw new IllegalArgumentException( "No such thing as ClassifierRole in UML2"); //$NON-NLS-1$ } public Object buildLifeline(Object interaction) { Lifeline lifeline = createLifeline(); lifeline.setInteraction((Interaction) interaction); return lifeline; } // TODO: All build/create methods need Undo support - tfm public Collaboration buildCollaboration(Object handle) { Collaboration collab = createCollaboration(); ((Element) handle).getOwnedElements().add(collab); return collab; } public Collaboration buildCollaboration(Object namespace, Object representedElement) { throw new IllegalArgumentException( "A collaboration is only attached to a namespace in UML2"); } public Object buildInteraction(Object collaboration) { Interaction interaction = createInteraction(); Collaboration collab = (Collaboration) collaboration; modelImpl.getCoreHelper().addOwnedElement(collab, interaction); return interaction; } public Message buildMessage(Object from, Object to) { Lifeline l1 = (Lifeline) from; Lifeline l2 = (Lifeline) to; Message message = UMLFactory.eINSTANCE.createMessage(); MessageOccurrenceSpecification receive = UMLFactory.eINSTANCE.createMessageOccurrenceSpecification(); MessageOccurrenceSpecification send = UMLFactory.eINSTANCE.createMessageOccurrenceSpecification(); message.setReceiveEvent(receive); message.setSendEvent(send); l1.getCoveredBys().add(send); l2.getCoveredBys().add(receive); return message; } public Object createAssociationEndRole() { // TODO: Auto-generated method stub return null; } public Object createAssociationRole() { // TODO: Auto-generated method stub return null; } public Object createClassifierRole() { return UMLFactory.eINSTANCE.createLifeline(); } public Collaboration createCollaboration() { return UMLFactory.eINSTANCE.createCollaboration(); } public Object createCollaborationInstanceSet() { // TODO: Auto-generated method stub return null; } public Interaction createInteraction() { return UMLFactory.eINSTANCE.createInteraction(); } public Object createInteractionInstanceSet() { // TODO: Auto-generated method stub return null; } public Lifeline createLifeline() { return UMLFactory.eINSTANCE.createLifeline(); } public Message createMessage() { return UMLFactory.eINSTANCE.createMessage(); } }

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.5497.064−181.403
Source linesThe number of non-empty source lines.198+79.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.4.729−7.094

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

Score0.752

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.199−6.01
Indentation frequencyHow rapidly indentation changes from line to line.169+5.108
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.197.923+2.357
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.76.548+0.431
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.76.95+0.406
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.066+0.3

Intercept 0.07 + feature contributions = 3.06 (log-odds).
Score = sigmoid(3.06) = 0.955.

Score0.571
Score76
Run 1

The code demonstrates good structure with clear separation of methods and logical organization, but several factors reduce readability. The class is well-documented with Javadoc comments and follows consistent naming conventions. Method lengths are generally appropriate, with most methods being short and focused. However, there are multiple TODO stubs returning null, which create ambiguity about intent. The deprecated method with Boolean wrapper parameter adds unnecessary complexity. Some methods contain commented-out code, which clutters the implementation. The buildAssociationRole method has poor parameter naming (agg1, agg2) that doesn't clearly convey meaning. Action granularity is mostly good with one action per line, though the method chaining in buildMessage could be clearer. The code lacks deep nesting, which is positive. Overall, while the structure is sound, the incomplete implementations and unclear parameter names prevent higher readability scores.

Run 2

The code has a clear, logical structure with well-placed method groupings and helpful comments, making navigation straightforward. Nesting is generally flat, and most methods are concise with clear intent — especially the typed `buildAssociationRole` and `buildLifeline` methods. However, readability suffers in places: several methods have empty or stub implementations (e.g., `createAssociationEndRole`, `createAssociationRole`, `createCollaborationInstanceSet`) with only TODO comments, which introduces ambiguity about intended functionality. Some deprecated or overloaded methods add length without much value, and the commented-out code (`// lifeline.setRepresents(prop);`) is distracting. Reading flow is mostly natural, but the mix of public, private, and deprecated members interrupts smooth scanning. Action granularity is mostly one action per line, which is good. Overall, the code is fairly readable but would benefit from removing dead code and clarifying stub methods.

Run 3

The code is generally readable but has some issues. The structure is logical, with clear separation of methods, but many methods are auto-generated stubs with TODO comments, which hurts clarity of intent. Nesting is mostly flat, with only one conditional block. Method names are descriptive, but the presence of deprecated methods and multiple overloaded versions adds ambiguity. Code length is moderate, but the many stub methods returning null or throwing exceptions feel unnecessarily long. Action granularity is mostly one action per line, which is good, but some lines are overly long (e.g., the deprecated method body). Reading flow is natural, moving from simple constructors to more complex methods. The commented-out code and TODOs disrupt readability. Overall, it is understandable but not polished, with significant portions of unfinished or placeholder code.

Run 1

Code Structure: Small, focused factory methods and a typed helper provide logical organization, though implemented methods are interspersed with stubs and legacy overloads. Nesting: Almost entirely flat, with only simple conditionals. Clarity of intent: Descriptive method names and straightforward UML operations communicate purpose, but Object parameters, casts, abbreviated variables (l1, l2, prop), and createClassifierRole returning a Lifeline weaken clarity. Code length: Implementations are concise; boilerplate comments, repeated stubs, and commented-out code add clutter. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Consistent formatting and sequential construction steps support natural reading, although uneven spacing, compatibility methods, and unfinished implementations interrupt the flow.

Run 2

Code Structure: Small, focused factory methods and adjacent overloads provide logical organization, although implemented methods are mixed with stubs. Nesting: Almost entirely flat, with only simple conditionals, making control flow easy to follow. Clarity of intent: Descriptive method names and explicit UML types explain most operations; generic Object parameters, abbreviated variables such as l1, l2, and prop, and legacy terminology obscure some meaning. Code length: Implementations are concise, but repetitive stubs, boilerplate documentation, and a commented-out statement add noise. Action granularity: Statements generally perform one action per line; chained calls remain manageable. Reading flow: Creation, configuration, and return steps follow a natural sequence, with whitespace separating stages. Minor formatting inconsistencies, sparse behavioral documentation, and mixed approaches to unsupported operations interrupt an otherwise straightforward reading experience.

Run 3

Code Structure: Factory responsibilities are organized into short methods, with related overloads grouped together; unfinished stubs add clutter. Nesting: Almost entirely flat, with only simple conditionals, making control flow easy to follow. Clarity of intent: Descriptive method names and UML types communicate purpose, but generic Object parameters, abbreviated variables such as l1, l2, and prop, and legacy role terminology reduce clarity. Code length: Implemented methods are concise, though repetitive stubs, boilerplate comments, and commented-out code increase noise. Action granularity: Statements generally perform one action per line; chained calls remain understandable. Reading flow: Creation, configuration, and return steps follow a natural sequence, but inconsistent whitespace and the mixture of implemented, unsupported, and unfinished methods interrupt the flow.