jython/YetAnotherAutoTrain3.py

Summary

Maintainability
F
4 mos
Test Coverage

File YetAnotherAutoTrain3.py has 1530 lines of code (exceeds 300 allowed). Consider refactoring.
Open

# YetAnotherAutoTrain.py -- Data driven automatic train
# Use a list of actions to automatically run a train.
# v1.3 -- Add line numbers to the compiler error messages.
# v1.4 -- Add a master controller that can be used to terminate all of the threads.
# v1.5 -- Add signal mast and signal head options.
Severity: Major
Found in jython/YetAnotherAutoTrain3.py - About 3 days to fix

    YetAnotherAutoTrain has 78 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class YetAnotherAutoTrain(jmri.jmrit.automat.AbstractAutomaton):
        threadCount = 0
    
        def init(self):
            self.throttle = None
    Severity: Major
    Found in jython/YetAnotherAutoTrain3.py - About 1 day to fix

      Consider simplifying this complex logical expression.
      Open

                  if words[0] == 'Assign':
                      self.compileAssign(line)
                  elif words[0] == 'CallSub':
                      self.compileCallSub(line)
                  elif words[0] == 'Dispatch':
      Severity: Critical
      Found in jython/YetAnotherAutoTrain3.py - About 1 day to fix

        Function handle has a Cognitive Complexity of 63 (exceeds 20 allowed). Consider refactoring.
        Open

            def handle(self):
                if logLevel > 0: print '{} - Start YAAT Program'.format(self.threadName)
                while True:
                    if self.progAddr >= len(self.actionTokens):
                        self.progAddr = 0
        Severity: Minor
        Found in jython/YetAnotherAutoTrain3.py - About 7 hrs to fix

        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

        Function compile has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring.
        Open

            def compile(self, actionList):
                self.compileMessages.append('---- {} Compiler Errors ----'.format(self.threadName))
                for line in actionList:
                    self.lineNumber += 1
                    words = line.split()
        Severity: Minor
        Found in jython/YetAnotherAutoTrain3.py - About 4 hrs to fix

        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

        Function doIfSpeed has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
        Open

            def doIfSpeed(self, action):
                act, mastName, operator, speedName = action
                mast = masts.getSignalMast(mastName)
                if mast is None:
                    self.displayMessage('{} - Signal mast {} not found'.format(self.threadName, mastName))
        Severity: Minor
        Found in jython/YetAnotherAutoTrain3.py - About 1 hr to fix

        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

        Function compileSetTurntable has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
        Open

            def compileSetTurntable(self, line):
                # Set turntable <turntable name> on panel <panel name> to ray <#>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                words = line.split()
                flds = 3
        Severity: Minor
        Found in jython/YetAnotherAutoTrain3.py - About 1 hr to fix

        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

        Function doSetTurntable has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
        Open

            def doSetTurntable(self, action):
                act, turntableName, panelName, rayIndex = action
                editorManager = jmri.InstanceManager.getDefault(jmri.jmrit.display.EditorManager)
                for layout in editorManager.getAll(jmri.jmrit.display.layoutEditor.LayoutEditor):
                    if layout.getTitle() == panelName:
        Severity: Minor
        Found in jython/YetAnotherAutoTrain3.py - About 25 mins to fix

        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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSetTurntable(self, line):
                # Set turntable <turntable name> on panel <panel name> to ray <#>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                words = line.split()
                flds = 3
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 4 days to fix
        jython/YetAnotherAutoTrain.py on lines 1397..1434

        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 425.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSignalSpeed(self, line):
                # Wait while signal mast <mast name> speed is less than <aspect name> speed
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Wait\s+while\s+signal\s+mast\s+(.+\S)\s+speed\s+is\s+less\s+than\s+(.+\S)\s+speed')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 1592..1624

        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 415.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileDispatch(self, line):
                # Dispatch using file <traininfo.xml>[, type <USER, value <dccAddress> | ROSTER, value <roster entry name> | OPERATIONS, value <train name>>]
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
        
                regex = '\s*Dispatch\s+using\s+file\s+(.+?\S)($|,\s+type\s+(USER|ROSTER|OPERATIONS),\s+value\s+(.+))'
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 992..1036

        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 410.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileIfSignalHead(self, line):
                # If signal head <head name> does [not] show <appearance> [or ...]
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*If\s+signal\s+head\s+(.+\S)\s+does\s+(not\s)?show\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 1113..1148

        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 407.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSignalHead(self, line):
                # Wait for signal head <head name> to [not] show <appearance name> [or ...]
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Wait\s+for\s+signal\s+head\s+(.+\S)\s+to\s+(not\s)?show\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 1523..1557

        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 400.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileAssign(self, line):
                # Assign <long | short> address <dccaddr> [[ as <train name>] in <blockname>]
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                words = line.split()
                flds = 2
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 947..980

        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 397.

        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

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSetFKey(self, line):
                # Set function key <n> <on | off>[, wait <n> seconds]
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                words = line.split()
                flds = 2
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 1282..1316

        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 396.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileIfSignalMast(self, line):
                # If signal mast <mast name> does [not] display <aspect> [or ...]
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*If\s+signal\s+mast\s+(.+\S)\s+does\s+(not\s+)?display\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 1150..1182

        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 373.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSignalMast(self, line):
                # Wait for signal mast <mast name> to [not] display <aspect name> [or ...]
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Wait\s+for\s+signal\s+mast\s+(.+\S)\s+to\s+(not\s)?display\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 1559..1590

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileIfSignalSpeed(self, line):
                # If speed for signal mast <mast name> is <eq | ne | lt | gt | le | ge> <speed name>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*If\s+speed\s+for\s+signal\s+mast\s+(.+\S)\s+is\s+(eq|ne|gt|lt|ge|le)\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 1184..1211

        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 358.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doIfSpeed(self, action):
                act, mastName, operator, speedName = action
                mast = masts.getSignalMast(mastName)
                if mast is None:
                    self.displayMessage('{} - Signal mast {} not found'.format(self.threadName, mastName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 546..578

        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 345.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSetTurnout(self, line):
                # Set turnout <turnout name> <closed | thrown>[, wait <n> seconds]
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                words = line.split()
                flds = 2
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 days to fix
        jython/YetAnotherAutoTrain.py on lines 1368..1395

        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 344.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileIfBlock(self, line):
                # If block <block name> is <occupied | unoccupied | reserved | free>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*If\s+block\s+(.+\S)\s+is\s+(occupied|unoccupied|reserved|free)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 2 days to fix
        jython/YetAnotherAutoTrain.py on lines 1077..1095

        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 252.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileWaitBlock(self, line):
                # Wait for block <block name> to become <occupied | unoccupied | free>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Wait\s+for\s+block\s+(.+\S)\s+to\s+become\s+(occupied|unoccupied|free)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 2 days to fix
        jython/YetAnotherAutoTrain.py on lines 1478..1496

        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 246.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSetBlock(self, line):
                # Set block <block name> <occupied | unoccupied | reserved | free>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Set\s+block\s+(.+\S)\s+(occupied|unoccupied|reserved|free)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 2 days to fix
        jython/YetAnotherAutoTrain.py on lines 1252..1269

        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 245.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doIfBlock(self, action):
                act, blockName, blockState = action
                layoutBlock = layoutblocks.getLayoutBlock(blockName)
                if layoutBlock is None:
                    self.displayMessage('{} - Layout block {} not found'.format(self.threadName, blockName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 2 days to fix
        jython/YetAnotherAutoTrain.py on lines 476..497

        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 242.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileRepeat(self, line):
                # Repeat if sensor <sensor name> is <active | inactive>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                if self.loopAddr == -1:
                    self.compileMessages.append('{} - Repeat error at line {}: A Loop point has not been defined'.format(self.threadName, self.lineNumber))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 2 days to fix
        jython/YetAnotherAutoTrain.py on lines 1234..1250

        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 237.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                if compileNeeded:
                    if logLevel > 1: print 'Compile train {}'.format(self.threadName)
        
                    self.compile(actionList)
        
        
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 2 days to fix
        jython/YetAnotherAutoTrain.py on lines 282..306

        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 227.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileIfSensor(self, line):
                # If sensor <sensor name> is <active | inactive>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*If\s+sensor\s+(.+\S)\s+is\s+(active|inactive)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1097..1111

        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 209.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSetSpeed(self, line):
                # Set speed to <0 to 1.0>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Set\s+speed\s+to\s+(\S+)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1348..1366

        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 208.

        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

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

            def compileSetSensor(self, line):
                # Set sensor <sensor name> <active | inactive>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Set\s+sensor\s+(.+\S)\s+(active|inactive)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 5 other locations - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1333..1346
        jython/YetAnotherAutoTrain.py on lines 1451..1464
        jython/YetAnotherAutoTrain.py on lines 1498..1511
        jython/YetAnotherAutoTrain3.py on lines 1445..1458
        jython/YetAnotherAutoTrain3.py on lines 1492..1505

        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 202.

        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

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

            def compileStop(self, line):
                # Stop if sensor <sensor name> is <active | inactive>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Stop\s+if\s+sensor\s+(.+\S)\s+is\s+(active|inactive)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 5 other locations - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1333..1346
        jython/YetAnotherAutoTrain.py on lines 1451..1464
        jython/YetAnotherAutoTrain.py on lines 1498..1511
        jython/YetAnotherAutoTrain3.py on lines 1327..1340
        jython/YetAnotherAutoTrain3.py on lines 1492..1505

        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 202.

        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

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

            def compileWaitSensor(self, line):
                # Wait for sensor <sensor name> to become <active | inactive>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Wait\s+for\s+sensor\s+(.+\S)\s+to\s+become\s+(active|inactive)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 5 other locations - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1333..1346
        jython/YetAnotherAutoTrain.py on lines 1451..1464
        jython/YetAnotherAutoTrain.py on lines 1498..1511
        jython/YetAnotherAutoTrain3.py on lines 1327..1340
        jython/YetAnotherAutoTrain3.py on lines 1445..1458

        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 202.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def compileReleaseSignalHead(self, line):
                # Release signal head <headName>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Release\s+signal\s+head\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 1 day to fix
        jython/YetAnotherAutoTrain3.py on lines 975..990
        jython/YetAnotherAutoTrain3.py on lines 992..1007
        jython/YetAnotherAutoTrain3.py on lines 1183..1199

        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 196.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileStart(self, line):
                # Start when sensor <sensor name> is <active | inactive>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Start\s+when\s+sensor\s+(.+\S)\s+is\s+(active|inactive)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1436..1449

        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 196.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def compileHoldSignalHead(self, line):
                # Hold signal head <headName>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Hold\s+signal\s+head\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 1 day to fix
        jython/YetAnotherAutoTrain3.py on lines 992..1007
        jython/YetAnotherAutoTrain3.py on lines 1166..1181
        jython/YetAnotherAutoTrain3.py on lines 1183..1199

        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 196.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def compileHoldSignalMast(self, line):
                # Hold signal mast <mastName>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Hold\s+signal\s+mast\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 1 day to fix
        jython/YetAnotherAutoTrain3.py on lines 975..990
        jython/YetAnotherAutoTrain3.py on lines 1166..1181
        jython/YetAnotherAutoTrain3.py on lines 1183..1199

        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 196.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def compileReleaseSignalMast(self, line):
                # Release signal mast <mastName>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Release\s+signal\s+mast\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 1 day to fix
        jython/YetAnotherAutoTrain3.py on lines 975..990
        jython/YetAnotherAutoTrain3.py on lines 992..1007
        jython/YetAnotherAutoTrain3.py on lines 1166..1181

        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 196.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doSetTurntable(self, action):
                act, turntableName, panelName, rayIndex = action
                editorManager = jmri.InstanceManager.getDefault(jmri.jmrit.display.EditorManager)
                for layout in editorManager.getAll(jmri.jmrit.display.layoutEditor.LayoutEditor):
                    if layout.getTitle() == panelName:
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 707..722

        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 190.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doAssign(self, action):
                if self.throttle != None:
                    return  # Throttle already assigned.  Normal for subsequent loops
                act, dccAddress, addrType, trainName, startBlock = action
                if addrType == 'long':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 435..453

        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 187.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doSetTurnout(self, action):
                act, turnoutName, turnoutState, turnoutDelay = action
                turnout = turnouts.getTurnout(turnoutName)
                if turnout is None:
                    self.displayMessage('{} - Turnout {} not found'.format(self.threadName, turnoutName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 685..705

        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 180.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        def compileRequired(fullPath):
            # Always true when the compile option is not active
            if not saveYAATcompiles: return (True, '')
        
            # Create the yaatp directory if necessary
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1654..1673

        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 177.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSetRoute(self,line):
                # Set route <route name>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Set\s+route\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1318..1331

        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 177.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doSetBlock(self, action):
                act, blockName, blockState = action
                layoutBlock = layoutblocks.getLayoutBlock(blockName)
                if layoutBlock is None:
                    self.displayMessage('{} - Layout block {} not found'.format(self.threadName, blockName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 597..616

        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 174.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doSetFKey(self, action):
                if self.throttle == None:
                    self.displayMessage('{} - Cannot set a function key until a throttle has been assigned'.format(self.threadName))
                    return
                act, keyNum, keyState, keyDuration = action
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 632..651

        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 158.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSub(self, line):
                # Sub <subname>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Sub\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1466..1476

        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 157.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileElse(self, line):
                # Else
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
        
                if len(self.ifStack) == 0:
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1038..1050

        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 155.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doWaitSpeed(self, action):
                act, mastName, aspectSpeed = action
                mast = masts.getSignalMast(mastName)
                if mast is None:
                    self.displayMessage('{} - Signal mast {} not found'.format(self.threadName, mastName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 818..834

        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 155.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doWaitBlock(self, action):
                act, blockName, blockState = action
                layoutBlock = layoutblocks.getLayoutBlock(blockName)
                if layoutBlock is None:
                    self.displayMessage('{} - Layout block {} not found'.format(self.threadName, blockName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 751..771

        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 155.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doIfSensor(self, action):
                act, sensorName, sensorState = action
                sensor = sensors.getSensor(sensorName)
                if sensor is None:
                    self.displayMessage('{} - Sensor {} not found'.format(self.threadName, sensorName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 499..512

        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 148.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileEndIf(self, line):
                # Endif
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
        
                if len(self.ifStack) == 0:
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1052..1064

        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 141.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def compileEndSub(self, line):
                # EndSub <subname>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*EndSub\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1066..1075
        jython/YetAnotherAutoTrain.py on lines 1223..1232
        jython/YetAnotherAutoTrain3.py on lines 1155..1164

        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 132.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def compilePrint(self, line):
                # Print message text
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Print\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1066..1075
        jython/YetAnotherAutoTrain.py on lines 1223..1232
        jython/YetAnotherAutoTrain3.py on lines 964..973

        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 132.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileSetDirection(self, line):
                # Set direction to <forward | reverse>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*Set\s+direction\s+to\s+(forward|reverse)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 day to fix
        jython/YetAnotherAutoTrain.py on lines 1271..1280

        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 132.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doStop(self, action):
                act, stopName, stopState = action
                sensor = sensors.getSensor(stopName)
                if stopState == 'active':
                    chkState = ACTIVE
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 7 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 734..749

        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 121.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def pushIfState(self, state):
                key = self.progAddr
                if not key in self.ifList:
                    self.displayMessage('{} - ifList entry not found for key {}'.format(self.threadName, key))
                    return
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 6 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 854..867

        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 117.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doSetSensor(self, action):
                act, sensorName, sensorState = action
                sensor = sensors.getSensor(sensorName)
                if sensor is None:
                    self.displayMessage('{} - Sensor {} not found'.format(self.threadName, sensorName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 6 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 663..676

        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 116.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def doIfMast(self, action):
                act, mastName, aspectList, notOption = action
                mast = masts.getSignalMast(mastName)
                if mast is None:
                    self.displayMessage('{} - Signal mast {} not found'.format(self.threadName, mastName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 6 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 514..528
        jython/YetAnotherAutoTrain.py on lines 530..544
        jython/YetAnotherAutoTrain3.py on lines 363..377

        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 115.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def doIfHead(self, action):
                act, headName, stateList, notOption = action
                head = signals.getSignalHead(headName)
                if head is None:
                    self.displayMessage('{} - Signal head {} not found'.format(self.threadName, headName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 6 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 514..528
        jython/YetAnotherAutoTrain.py on lines 530..544
        jython/YetAnotherAutoTrain3.py on lines 379..393

        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 115.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doWaitSensor(self, action):
                act, sensorName, sensorState = action
                sensor = sensors.getSensor(sensorName)
                if sensor is None:
                    self.displayMessage('{} - Sensor {} not found'.format(self.threadName, sensorName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 6 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 773..784

        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 114.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileCallSub(self, line):
                # CallSub <subname>
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                pattern = re.compile('\s*CallSub\s+(.+\S)')
                result = re.findall(pattern, line)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 6 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 982..990

        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 110.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def doWaitHead(self, action):
                act, headName, stateList, notOption = action
                head = signals.getSignalHead(headName)
                if head is None:
                    self.displayMessage('{} - Signal head {} not found'.format(self.threadName, headName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 6 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 786..800
        jython/YetAnotherAutoTrain.py on lines 802..816
        jython/YetAnotherAutoTrain3.py on lines 679..693

        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 108.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def doWaitMast(self, action):
                act, mastName, aspectList, notOption = action
                mast = masts.getSignalMast(mastName)
                if mast is None:
                    self.displayMessage('{} - Signal mast {} not found'.format(self.threadName, mastName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 6 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 786..800
        jython/YetAnotherAutoTrain.py on lines 802..816
        jython/YetAnotherAutoTrain3.py on lines 663..677

        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 108.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doSetDirection(self, action):
                if self.throttle == None:
                    self.displayMessage('{} - Cannot set a direction until a throttle has been assigned'.format(self.threadName))
                    return
                act, direction = action
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 6 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 618..630

        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 107.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def compileLoop(self, line):
                # Loop
                if logLevel > 2: print '  {} - {}'.format(self.threadName, line)
                if self.loopAddr != -1:
                    self.compileMessages.append('{} - Loop error at line {}: Duplicate Loop statement, only 1 allowed'.format(self.threadName, self.lineNumber))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 5 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 1213..1221

        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 101.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doRepeat(self, action):
                act, repeatName, repeatState = action
                sensor = sensors.getSensor(repeatName)
                if repeatState == 'active':
                    chkState = ACTIVE
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 4 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 585..595

        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 93.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doCallSub(self, action):
                act, subName = action
                if not subName in self.subList:
                    self.displayMessage('{} - Sub routine {} not found'.format(self.threadName, subName))
                    return
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 4 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 455..463

        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 88.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doStart(self, action):
                act, startName, startState = action
                sensor = sensors.getSensor(startName)
                if startState == 'active':
                    self.waitSensorActive(sensor)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 4 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 724..732

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doSetRoute(self, action):
                act, routeName = action
                route = routes.getRoute(routeName)
                if route is None:
                    self.displayMessage('{} - Route {} not found'.format(self.threadName, routeName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 653..661

        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 78.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doDispatch(self, action):
                act, dispFile, dispType, dispValue = action
                dispFrame = jmri.InstanceManager.getDefault(jmri.jmrit.dispatcher.DispatcherFrame)
                x = dispFrame.loadTrainFromTrainInfo(dispFile, dispType, dispValue)
                if x != 0:
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 3 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 465..470

        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 77.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def setKey(self, keyNum, keyOn):
                if logLevel > 2: print "{} - Function key = {}, On = {}".format(self.threadName, keyNum, keyOn)
                command = 'self.throttle.setF' + str(keyNum)
                if keyOn:
                    command += '(True)'
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 2 hrs to fix
        jython/YetAnotherAutoTrain.py on lines 836..843

        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 68.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def doHoldSignalHead(self, action):
                act, headName = action
                head = signals.getSignalHead(headName)
                if head is None:
                    self.displayMessage('{} - Signal head {} not found'.format(self.threadName, headName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 2 hrs to fix
        jython/YetAnotherAutoTrain3.py on lines 317..323
        jython/YetAnotherAutoTrain3.py on lines 433..439
        jython/YetAnotherAutoTrain3.py on lines 441..447

        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 64.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def doHoldSignalMast(self, action):
                act, mastName = action
                mast = masts.getSignalMast(mastName)
                if mast is None:
                    self.displayMessage('{} - Signal mast {} not found'.format(self.threadName, mastName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 2 hrs to fix
        jython/YetAnotherAutoTrain3.py on lines 309..315
        jython/YetAnotherAutoTrain3.py on lines 433..439
        jython/YetAnotherAutoTrain3.py on lines 441..447

        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 64.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def doReleaseSignalHead(self, action):
                act, headName = action
                head = signals.getSignalHead(headName)
                if head is None:
                    self.displayMessage('{} - Signal head {} not found'.format(self.threadName, headName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 2 hrs to fix
        jython/YetAnotherAutoTrain3.py on lines 309..315
        jython/YetAnotherAutoTrain3.py on lines 317..323
        jython/YetAnotherAutoTrain3.py on lines 441..447

        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 64.

        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

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            def doReleaseSignalMast(self, action):
                act, mastName = action
                mast = masts.getSignalMast(mastName)
                if mast is None:
                    self.displayMessage('{} - Signal mast {} not found'.format(self.threadName, mastName))
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 3 other locations - About 2 hrs to fix
        jython/YetAnotherAutoTrain3.py on lines 309..315
        jython/YetAnotherAutoTrain3.py on lines 317..323
        jython/YetAnotherAutoTrain3.py on lines 433..439

        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 64.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def doSetSpeed(self, action):
                if self.throttle == None:
                    self.displayMessage('{} - Cannot set the speed until a throttle has been assigned'.format(self.threadName))
                    return
                act, newSpeed = action
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 hr to fix
        jython/YetAnotherAutoTrain.py on lines 678..683

        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 56.

        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

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    elif actionKey == 'WaitMast':
                        self.doWaitMast(action)
                    elif actionKey == 'WaitSpeed':
                        self.doWaitSpeed(action)
                    elif actionKey == 'WaitTime':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 hr to fix
        jython/DispatcherSystem/CreateTransits.py on lines 1316..1322

        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 55.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                if logLevel > 2:
                    for ifKey in self.ifList.keys():
                        elseAddr, endAddr = self.ifList[ifKey]
                        print "if = {}, else = {}, endif = {}".format(ifKey, elseAddr, endAddr)
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 1 hr to fix
        jython/YetAnotherAutoTrain.py on lines 308..311

        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 49.

        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

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            def createIf(self):
                key = len(self.actionTokens)
                self.ifList[key] = (0, 0)
                self.ifStack.append(key)
        Severity: Minor
        Found in jython/YetAnotherAutoTrain3.py and 1 other location - About 50 mins to fix
        jython/YetAnotherAutoTrain.py on lines 849..852

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'Hold' and words[1] == 'signal' and words[2] == 'head':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 836..836
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'If' and words[1] == 'signal' and words[2] == 'mast':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 836..836
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'If' and words[1] == 'speed' and words[4] == 'mast':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 836..836
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'Wait' and words[1] == 'for' and words[2] == 'block':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 836..836
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'Wait' and words[1] == 'for' and words[3] == 'head':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 836..836
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'Wait' and words[1] == 'while' and words[2] == 'signal':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 836..836

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'Wait' and words[1] == 'for' and words[3] == 'mast':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'Release' and words[1] == 'signal' and words[2] == 'mast':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 836..836
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'Hold' and words[1] == 'signal' and words[2] == 'mast':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 836..836
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'Wait' and words[1] == 'for' and words[2] == 'sensor':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 836..836
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'If' and words[1] == 'signal' and words[2] == 'head':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 800..800
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 836..836
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        Similar blocks of code found in 20 locations. Consider refactoring.
        Open

                    elif words[0] == 'Release' and words[1] == 'signal' and words[2] == 'head':
        Severity: Major
        Found in jython/YetAnotherAutoTrain3.py and 19 other locations - About 45 mins to fix
        jython/YetAnotherAutoTrain.py on lines 895..895
        jython/YetAnotherAutoTrain.py on lines 897..897
        jython/YetAnotherAutoTrain.py on lines 899..899
        jython/YetAnotherAutoTrain.py on lines 929..929
        jython/YetAnotherAutoTrain.py on lines 931..931
        jython/YetAnotherAutoTrain.py on lines 933..933
        jython/YetAnotherAutoTrain.py on lines 935..935
        jython/YetAnotherAutoTrain.py on lines 937..937
        jython/YetAnotherAutoTrain3.py on lines 780..780
        jython/YetAnotherAutoTrain3.py on lines 782..782
        jython/YetAnotherAutoTrain3.py on lines 788..788
        jython/YetAnotherAutoTrain3.py on lines 790..790
        jython/YetAnotherAutoTrain3.py on lines 792..792
        jython/YetAnotherAutoTrain3.py on lines 802..802
        jython/YetAnotherAutoTrain3.py on lines 830..830
        jython/YetAnotherAutoTrain3.py on lines 832..832
        jython/YetAnotherAutoTrain3.py on lines 834..834
        jython/YetAnotherAutoTrain3.py on lines 836..836
        jython/YetAnotherAutoTrain3.py on lines 838..838

        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 43.

        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

        Further Reading

        There are no issues that match your filters.

        Category
        Status