Method getFacingSignalHead
has a Cognitive Complexity of 696 (exceeds 20 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public SignalHead getFacingSignalHead(
@CheckForNull Block facingBlock,
@CheckForNull Block protectedBlock) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File LayoutBlockManager.java
has 1962 lines of code (exceeds 300 allowed). Consider refactoring. Open
package jmri.jmrit.display.layoutEditor;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
Method getFacingBean
has a Cognitive Complexity of 255 (exceeds 20 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public NamedBean getFacingBean(@CheckForNull Block facingBlock,
@CheckForNull Block protectedBlock,
@CheckForNull LayoutEditor panel, Class< ?> T) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getFacingSignalHead
has 711 lines of code (exceeds 25 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public SignalHead getFacingSignalHead(
@CheckForNull Block facingBlock,
@CheckForNull Block protectedBlock) {
Method getFacingBean
has 290 lines of code (exceeds 25 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public NamedBean getFacingBean(@CheckForNull Block facingBlock,
@CheckForNull Block protectedBlock,
@CheckForNull LayoutEditor panel, Class< ?> T) {
Method getFacingBlockByBeanByPanel
has a Cognitive Complexity of 69 (exceeds 20 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
private LayoutBlock getFacingBlockByBeanByPanel(
@Nonnull NamedBean bean,
@Nonnull LayoutEditor panel) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
LayoutBlockManager
has 56 methods (exceeds 20 allowed). Consider refactoring. Open
public class LayoutBlockManager extends AbstractManager<LayoutBlock> implements jmri.InstanceManagerAutoDefault {
public LayoutBlockManager() {
super(InstanceManager.getDefault(InternalSystemConnectionMemo.class));
InstanceManager.sensorManagerInstance().addVetoableChangeListener(this);
Method getFacingBlockByBeanByPanel
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
private LayoutBlock getFacingBlockByBeanByPanel(
@Nonnull NamedBean bean,
@Nonnull LayoutEditor panel) {
Method getSensorAtEndBumper
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public Sensor getSensorAtEndBumper(
@CheckForNull Block facingBlock,
@CheckForNull LayoutEditor panel) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getSignalMastAtEndBumper
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public SignalMast getSignalMastAtEndBumper(
@CheckForNull Block facingBlock,
@CheckForNull LayoutEditor panel) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getProtectingBlocksByBeanByPanel
has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring. Open
@Nonnull
private List<LayoutBlock> getProtectingBlocksByBeanByPanel(
@CheckForNull NamedBean bean,
@CheckForNull LayoutEditor panel) {
List<LayoutBlock> protectingBlocks = new ArrayList<>();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getProtectingBlocksByBeanByPanel
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Nonnull
private List<LayoutBlock> getProtectingBlocksByBeanByPanel(
@CheckForNull NamedBean bean,
@CheckForNull LayoutEditor panel) {
List<LayoutBlock> protectingBlocks = new ArrayList<>();
Method setRoutingStabilised
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setRoutingStabilised() {
if (checking) {
return;
}
log.debug("routing table change has been initiated");
Method getProtectingBlocksBySensorOld
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Nonnull
public List<LayoutBlock> getProtectingBlocksBySensorOld(
@CheckForNull Sensor sensor, @Nonnull LayoutEditor panel) {
List<LayoutBlock> result = new ArrayList<>();
PositionablePoint pp = panel.getFinder().findPositionablePointByEastBoundBean(sensor);
Method getSignalMastAtEndBumper
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public SignalMast getSignalMastAtEndBumper(
@CheckForNull Block facingBlock,
@CheckForNull LayoutEditor panel) {
Method getSensorAtEndBumper
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public Sensor getSensorAtEndBumper(
@CheckForNull Block facingBlock,
@CheckForNull LayoutEditor panel) {
Method createNewLayoutBlock
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public LayoutBlock createNewLayoutBlock(
@CheckForNull String systemName,
String userName) {
Method initializeLayoutBlockPaths
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void initializeLayoutBlockPaths() {
log.debug("start initializeLayoutBlockPaths");
// cycle through all LayoutBlocks, completing initialization of associated jmri.Blocks
for (LayoutBlock b : getNamedBeanSet()) {
Method getProtectingBlocksBySensorOld
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
@Nonnull
public List<LayoutBlock> getProtectingBlocksBySensorOld(
@CheckForNull Sensor sensor, @Nonnull LayoutEditor panel) {
List<LayoutBlock> result = new ArrayList<>();
PositionablePoint pp = panel.getFinder().findPositionablePointByEastBoundBean(sensor);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (T.equals(SignalMast.class)) {
return lt.getSignalAMast();
} else if (T.equals(Sensor.class)) {
return lt.getSensorA();
}
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return p.getWestBoundSignalHead();
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return tLinked.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA3);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return tLinked.getSignalHead(LayoutTurnout.Geometry.POINTA3);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC2);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return p.getEastBoundSignalHead();
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA3);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return tLinked.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB2);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC2);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD2);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return ls.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return xing.getSignalHead(LevelXing.Geometry.POINTB);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return lt.getSensorD();
Avoid too many return
statements within this method. Open
return xing.getSignalHead(LevelXing.Geometry.POINTA);
Avoid too many return
statements within this method. Open
return xing.getSignalHead(LevelXing.Geometry.POINTC);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return p.getEastBoundSignalMast();
Avoid too many return
statements within this method. Open
return xing.getSensorD();
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return xing.getSignalHead(LevelXing.Geometry.POINTC);
Avoid too many return
statements within this method. Open
return p.getWestBoundSignalMast();
Avoid too many return
statements within this method. Open
return lt.getSensorA();
Avoid too many return
statements within this method. Open
return lt.getSensorA();
Avoid too many return
statements within this method. Open
return xing.getSensorB();
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return tLinked.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return ls.getSignalAMast();
Avoid too many return
statements within this method. Open
return xing.getSignalDMast();
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB2);
Avoid too many return
statements within this method. Open
return ls.getSignalHead(LayoutTurnout.Geometry.POINTC2);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalDMast();
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return ls.getSignalDMast();
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return p.getWestBoundSensor();
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD2);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalDMast();
Avoid too many return
statements within this method. Open
return ls.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return ls.getSignalCMast();
Avoid too many return
statements within this method. Open
return ls.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return xing.getSignalHead(LevelXing.Geometry.POINTA);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSensorB();
Avoid too many return
statements within this method. Open
return lt.getSensorC();
Avoid too many return
statements within this method. Open
return lt.getSensorC();
Avoid too many return
statements within this method. Open
return lt.getSensorD();
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD2);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return ls.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return p.getEastBoundSensor();
Avoid too many return
statements within this method. Open
return ls.getSensorC();
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return xing.getSignalHead(LevelXing.Geometry.POINTB);
Avoid too many return
statements within this method. Open
return p.getWestBoundSignalMast();
Avoid too many return
statements within this method. Open
return xing.getSensorC();
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return ls.getSignalHead(LayoutTurnout.Geometry.POINTB2);
Avoid too many return
statements within this method. Open
return ls.getSignalHead(LayoutTurnout.Geometry.POINTD2);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC2);
Avoid too many return
statements within this method. Open
return tLinked.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return tLinked.getSignalHead(LayoutTurnout.Geometry.POINTA3);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return ls.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return xing.getSignalHead(LevelXing.Geometry.POINTD);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return p.getWestBoundSensor();
Avoid too many return
statements within this method. Open
return lt.getSignalAMast();
Avoid too many return
statements within this method. Open
return lt.getSensorB();
Avoid too many return
statements within this method. Open
return xing.getSignalAMast();
Avoid too many return
statements within this method. Open
return tLinked.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return xing.getSignalHead(LevelXing.Geometry.POINTD);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return ls.getSignalHead(LayoutTurnout.Geometry.POINTA2);
Avoid too many return
statements within this method. Open
return ls.getSignalHead(LayoutTurnout.Geometry.POINTD1);
Avoid too many return
statements within this method. Open
return lt.getSignalBMast();
Avoid too many return
statements within this method. Open
return lt.getSignalAMast();
Avoid too many return
statements within this method. Open
return lt.getSignalCMast();
Avoid too many return
statements within this method. Open
return ls.getSensorB();
Avoid too many return
statements within this method. Open
return ls.getSensorD();
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return xing.getSensorA();
Avoid too many return
statements within this method. Open
return xing.getSignalCMast();
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC2);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
Avoid too many return
statements within this method. Open
return lt.getSignalCMast();
Avoid too many return
statements within this method. Open
return ls.getSensorA();
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
Avoid too many return
statements within this method. Open
return xing.getSignalBMast();
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return lt.getSignalBMast();
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return ls.getSignalBMast();
Similar blocks of code found in 4 locations. Consider refactoring. Open
} else {
//check if track segments at B or C are in facing block (block 1)
if (((TrackSegment) (lt.getConnectB())).getBlockName().equals(facingBlock.getUserName())) {
//track segment connected at B matches block 1, check C
if (!(((TrackSegment) lt.getConnectC()).getBlockName().equals(facingBlock.getDisplayName()))) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 366.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
} else {
//check if track segments at D or A are in facing block (block 1)
if (((TrackSegment) (lt.getConnectD())).getBlockName().equals(facingBlock.getUserName())) {
//track segment connected at D matches block 1, check A
if (!(((TrackSegment) lt.getConnectA()).getBlockName().equals(facingBlock.getUserName()))) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 366.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
} else {
//check if track segments at C or B are in facing block (block 1)
if (((TrackSegment) (lt.getConnectC())).getBlockName().equals(facingBlock.getUserName())) {
//track segment connected at C matches block 1, check B
if (!(((TrackSegment) lt.getConnectB()).getBlockName().equals(facingBlock.getUserName()))) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 366.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
} else {
//check if track segments at A or D are in facing block (block 1)
if (((TrackSegment) (lt.getConnectA())).getBlockName().equals(facingBlock.getUserName())) {
//track segment connected at A matches block 1, check D
if (!(((TrackSegment) lt.getConnectD()).getBlockName().equals(facingBlock.getUserName()))) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 366.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (((TrackSegment) (lt.getConnectC())).getBlockName().equals(protectedBlock.getUserName())) {
//track segment connected at C matches block 2, check B
if (!(((TrackSegment) lt.getConnectB()).getBlockName().equals(protectedBlock.getUserName()))) {
//track segment connected at B is not in block2, return continuing signal head at D
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 232.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (((TrackSegment) (lt.getConnectA())).getBlockName().equals(protectedBlock.getUserName())) {
//track segment connected at A matches block 2, check D
if (!(((TrackSegment) lt.getConnectD()).getBlockName().equals(protectedBlock.getUserName()))) {
//track segment connected at D is not in block2, return diverging signal head at C
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC2);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 232.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (l != null) {
Object connect = null;
if (bean instanceof SignalMast) {
if (l.getSignalAMast() == bean) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 228.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (ls != null) {
Object connect = null;
if (bean instanceof SignalMast) {
if (ls.getSignalAMast() == bean) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 228.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if (cType == HitPointType.TURNOUT_D) {
lt = (LayoutTurnout) connected;
if ((T.equals(SignalMast.class) && (lt.getSignalDMast() != null))
|| (T.equals(Sensor.class) && (lt.getSensorD() != null))) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 210.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if (cType == HitPointType.TURNOUT_B) {
lt = (LayoutTurnout) connected;
if ((T.equals(SignalMast.class) && (lt.getSignalBMast() != null))
|| (T.equals(Sensor.class) && (lt.getSensorB() != null))) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 210.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if (cType == HitPointType.TURNOUT_C) {
lt = (LayoutTurnout) connected;
if ((T.equals(SignalMast.class) && (lt.getSignalCMast() != null))
|| (T.equals(Sensor.class) && (lt.getSensorC() != null))) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 210.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for (TrackSegment t : panel.getTrackSegments()) {
if (t.getLayoutBlock() == fLayoutBlock) {
PositionablePoint p = null;
if (t.getType1() == HitPointType.POS_POINT) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 188.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for (TrackSegment t : panel.getTrackSegments()) {
if (t.getLayoutBlock() == fLayoutBlock) {
PositionablePoint p = null;
if (t.getType1() == HitPointType.POS_POINT) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 188.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (pp != null) {
// LayoutEditorTools tools = panel.getLETools(); //TODO: Dead-code strip this
if (east) {
if (LayoutEditorTools.isAtWestEndOfAnchor(panel, pp.getConnect1(), pp)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 118.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (pp != null) {
// LayoutEditorTools tools = panel.getLETools(); //TODO: Dead-code strip this
if (east) {
if (LayoutEditorTools.isAtWestEndOfAnchor(panel, pp.getConnect1(), pp)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 118.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
while ((i < c.size()) && (lc == null)) {
LayoutConnectivity tlc = c.get(i);
if ((tlc.getBlock1() == fLayoutBlock) && (tlc.getBlock2() == pLayoutBlock)) {
lc = tlc;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 118.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
while ((i < c.size()) && (lc == null)) {
LayoutConnectivity tlc = c.get(i);
if ((tlc.getBlock1() == fLayoutBlock) && (tlc.getBlock2() == pLayoutBlock)) {
lc = tlc;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 118.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public LayoutBlock getProtectedBlock(
@Nonnull String signalName, @Nonnull LayoutEditor panel) {
PositionablePoint pp = panel.getFinder().findPositionablePointByEastBoundSignal(signalName);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public LayoutBlock getFacingBlock(
@Nonnull String signalName, @Nonnull LayoutEditor panel) {
PositionablePoint pp = panel.getFinder().findPositionablePointByWestBoundSignal(signalName);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
case LayoutConnectivity.XOVER_BOUNDARY_BD: {
if (facingIsBlock1) {
if (lt.getSignalHead(LayoutTurnout.Geometry.POINTB2) == null) { //there is no signal head for diverging (crossed
//over)
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 104.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
case LayoutConnectivity.XOVER_BOUNDARY_AC: {
if (facingIsBlock1) {
if (lt.getSignalHead(LayoutTurnout.Geometry.POINTA2) == null) { //there is no signal head for diverging (crossed
//over)
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 104.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ((lt.getContinuingSense() == Turnout.CLOSED) && (lt.getSignalHead(LayoutTurnout.Geometry.POINTB2) == null)) {
//there is only one signal head here - return it
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
} else if ((lt.getContinuingSense() == Turnout.THROWN) && (lt.getSignalHead(LayoutTurnout.Geometry.POINTC2) == null)) {
//there is only one signal head here - return it
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ((lt.getContinuingSense() == Turnout.CLOSED) && (lt.getSignalHead(LayoutTurnout.Geometry.POINTC2) == null)) {
//there is only one signal head here - return it
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
} else if ((lt.getContinuingSense() == Turnout.THROWN) && (lt.getSignalHead(LayoutTurnout.Geometry.POINTB2) == null)) {
//there is only one signal head here - return it
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public LayoutBlock getProtectedBlock(
@Nonnull SignalHead signalHead, @CheckForNull LayoutEditor panel) {
LayoutBlock result = null; //assume failure (pessimist!)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 85.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public LayoutBlock getFacingBlock(
@Nonnull SignalHead signalHead, @CheckForNull LayoutEditor panel) {
LayoutBlock result = null; //assume failure (pessimist!)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 85.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (bean instanceof SignalMast) {
if (l.getSignalAMast() == bean) {
protectingBlocks.add(l.getLayoutBlockAC());
} else if (l.getSignalBMast() == bean) {
protectingBlocks.add(l.getLayoutBlockBD());
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 80.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
} else if (bean instanceof Sensor) {
if (l.getSensorA() == bean) {
protectingBlocks.add(l.getLayoutBlockAC());
} else if (l.getSensorB() == bean) {
protectingBlocks.add(l.getLayoutBlockBD());
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 80.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
case SLIP_B: {
if (ls.getTurnoutType() == LayoutSlip.TurnoutType.DOUBLE_SLIP) {
if (ls.getSlipState() == LayoutSlip.STATE_BC) {
return ls.getSignalHead(LayoutTurnout.Geometry.POINTB2);
} else {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 76.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
case SLIP_C: {
if (ls.getTurnoutType() == LayoutSlip.TurnoutType.DOUBLE_SLIP) {
if (ls.getSlipState() == LayoutSlip.STATE_BC) {
return ls.getSignalHead(LayoutTurnout.Geometry.POINTC2);
} else {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 76.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
} else if (state == Turnout.THROWN) {
if (tLinked.getContinuingSense() == Turnout.THROWN) {
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
} else if (lt.getSignalHead(LayoutTurnout.Geometry.POINTA3) == null) {
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 72.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (state == Turnout.CLOSED) {
if (tLinked.getContinuingSense() == Turnout.CLOSED) {
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
} else if (lt.getSignalHead(LayoutTurnout.Geometry.POINTA3) == null) {
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 72.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ((fLayoutBlock == null) || (pLayoutBlock == null)) {
if (fLayoutBlock == null) {
log.error("Block {} is not on a Layout Editor panel.", facingBlock.getDisplayName());
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 70.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ((fLayoutBlock == null) || (pLayoutBlock == null)) {
if (fLayoutBlock == null) {
log.error("Block {} is not on a Layout Editor panel.", facingBlock.getDisplayName());
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 70.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if ((((TrackSegment) lt.getConnectD()).getBlockName().equals(protectedBlock.getUserName()))) {
//track segment connected at D is in block 2, return continuing signal head
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
} else {
//neither track segment is in block 2 - should never get here unless layout turnout is
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 70.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if ((((TrackSegment) lt.getConnectB()).getBlockName().equals(protectedBlock.getUserName()))) {
//track segment connected at B is in block 2, return diverging signal head
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD2);
} else {
//neither track segment is in block 2 - should never get here unless layout turnout is
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 70.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if ((((TrackSegment) lt.getConnectD()).getBlockName().equals(protectedBlock.getUserName()))) { //track segment
//connected at D
//is in block 2,
//return
//diverging
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 70.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
} else if (lt.getLinkType() == LayoutTurnout.LinkType.NO_LINK) {
if (facingIsBlock1) {
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
} else {
if (lt.getSignalHead(LayoutTurnout.Geometry.POINTA2) == null) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 66.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
} else if (lt.getLinkType() == LayoutTurnout.LinkType.FIRST_3_WAY) {
if (facingIsBlock1) {
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
} else {
if (lt.getSignalHead(LayoutTurnout.Geometry.POINTA2) == null) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 66.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
} else if (lc.getXoverBoundaryType() == LayoutConnectivity.XOVER_BOUNDARY_AC) {
if (fLayoutBlock == lc.getXover().getLayoutBlock()) {
cType = HitPointType.TURNOUT_A;
} else {
cType = HitPointType.TURNOUT_C;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 48.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
if (lc.getXoverBoundaryType() == LayoutConnectivity.XOVER_BOUNDARY_AB) {
if (fLayoutBlock == lc.getXover().getLayoutBlock()) {
cType = HitPointType.TURNOUT_A;
} else {
cType = HitPointType.TURNOUT_B;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 48.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
} else if (lc.getXoverBoundaryType() == LayoutConnectivity.XOVER_BOUNDARY_BD) {
if (fLayoutBlock == lc.getXover().getLayoutBlockB()) {
cType = HitPointType.TURNOUT_B;
} else {
cType = HitPointType.TURNOUT_D;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 48.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
} else if (lc.getXoverBoundaryType() == LayoutConnectivity.XOVER_BOUNDARY_CD) {
if (fLayoutBlock == lc.getXover().getLayoutBlockC()) {
cType = HitPointType.TURNOUT_C;
} else {
cType = HitPointType.TURNOUT_D;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 48.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
case SLIP_D: {
if (ls.getSlipState() == LayoutSlip.STATE_AD) {
return ls.getSignalHead(LayoutTurnout.Geometry.POINTD2);
} else {
return ls.getSignalHead(LayoutTurnout.Geometry.POINTD1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
case SLIP_A: {
if (ls.getSlipState() == LayoutSlip.STATE_AD) {
return ls.getSignalHead(LayoutTurnout.Geometry.POINTA2);
} else {
return ls.getSignalHead(LayoutTurnout.Geometry.POINTA1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 8 locations. Consider refactoring. Open
if (cType == HitPointType.LEVEL_XING_A) {
//block boundary is at the A connection of a level crossing
if (T.equals(SignalMast.class)) {
return xing.getSignalAMast();
} else if (T.equals(Sensor.class)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 44.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 8 locations. Consider refactoring. Open
if (cType == HitPointType.LEVEL_XING_D) {
if (T.equals(SignalMast.class)) {
return xing.getSignalDMast();
} else if (T.equals(Sensor.class)) {
return xing.getSensorD();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 44.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 8 locations. Consider refactoring. Open
if (cType == HitPointType.SLIP_D) {
if (T.equals(SignalMast.class)) {
return ls.getSignalDMast();
} else if (T.equals(Sensor.class)) {
return ls.getSensorD();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 44.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 8 locations. Consider refactoring. Open
if (cType == HitPointType.LEVEL_XING_C) {
//block boundary is at the C connection of a level crossing
if (T.equals(SignalMast.class)) {
return xing.getSignalCMast();
} else if (T.equals(Sensor.class)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 44.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 8 locations. Consider refactoring. Open
if (cType == HitPointType.SLIP_C) {
if (T.equals(SignalMast.class)) {
return ls.getSignalCMast();
} else if (T.equals(Sensor.class)) {
return ls.getSensorC();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 44.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 8 locations. Consider refactoring. Open
if (cType == HitPointType.LEVEL_XING_B) {
//block boundary is at the B connection of a level crossing
if (T.equals(SignalMast.class)) {
return xing.getSignalBMast();
} else if (T.equals(Sensor.class)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 44.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 8 locations. Consider refactoring. Open
if (cType == HitPointType.SLIP_B) {
if (T.equals(SignalMast.class)) {
return ls.getSignalBMast();
} else if (T.equals(Sensor.class)) {
return ls.getSensorB();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 44.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 8 locations. Consider refactoring. Open
if (cType == HitPointType.SLIP_A) {
if (T.equals(SignalMast.class)) {
return ls.getSignalAMast();
} else if (T.equals(Sensor.class)) {
return ls.getSensorA();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 44.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
case LayoutConnectivity.XOVER_BOUNDARY_AB: {
if (facingIsBlock1) {
return lt.getSignalHead(LayoutTurnout.Geometry.POINTA1);
} else {
return lt.getSignalHead(LayoutTurnout.Geometry.POINTB1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 40.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
case LayoutConnectivity.XOVER_BOUNDARY_CD: {
if (facingIsBlock1) {
return lt.getSignalHead(LayoutTurnout.Geometry.POINTC1);
} else {
return lt.getSignalHead(LayoutTurnout.Geometry.POINTD1);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 40.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76