christoph2/pyA2L

View on GitHub

Showing 238 of 238 total issues

A2LListener has 193 functions (exceeds 80 allowed). Consider refactoring.
Open

class A2LListener(BaseListener):
    """"""

    def exitAlignmentByte(self, ctx):
        alignmentBorder = ctx.alignmentBorder.value
Severity: Major
Found in pya2l/a2l_listener.py - About 2 days to fix

    File inspect.py has 2956 lines of code (exceeds 2500 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    
    __copyright__ = """
        pySART - Simplified AUTOSAR-Toolkit for Python.
    Severity: Major
    Found in pya2l/api/inspect.py - About 1 day to fix

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

                      if definition.block_definition:
                          self.push_element(definition.block_definition)
                          block = self.block()
                          tag = block.pop("tag")
                          value = block.get("value")
      Severity: Major
      Found in pya2l/if_data_parser.py and 1 other location - About 1 day to fix
      pya2l/if_data_parser.py on lines 320..331

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

      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

                          if definition.taggedstruct_definition.__class__.__name__ == "TaggedStructDefinition":
                              self.push_element(definition.taggedstruct_definition)
                              tsm = self.tagged_struct_member()
                              tag = tsm.pop("tag")
                              value = tsm.get("value")
      Severity: Major
      Found in pya2l/if_data_parser.py and 1 other location - About 1 day to fix
      pya2l/if_data_parser.py on lines 304..315

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

      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 exitTypedefCharacteristic(self, ctx):
              name = ctx.name.value
              longIdentifier = ctx.longIdentifier.value
              type_ = ctx.type_.text
              deposit = ctx.deposit_.value
      Severity: Major
      Found in pya2l/a2l_listener.py and 1 other location - About 1 day to fix
      pya2l/a2l_listener.py on lines 1027..1046

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

      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 exitTypedefMeasurement(self, ctx):
              name = ctx.name.value
              longIdentifier = ctx.longIdentifier.value
              datatype = ctx.datatype.value
              conversion = ctx.conversion.value
      Severity: Major
      Found in pya2l/a2l_listener.py and 1 other location - About 1 day to fix
      pya2l/a2l_listener.py on lines 1006..1025

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

      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

      Cyclomatic complexity is too high in method __init__. (36)
      Open

          def __init__(self, session, name: str, module_name: str = None):
              self.compu_method = session.query(model.CompuMethod).filter(model.CompuMethod.name == name).first()
              if not self.compu_method:
                  return
              self.name = name
      Severity: Minor
      Found in pya2l/api/inspect.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Function __init__ has a Cognitive Complexity of 49 (exceeds 15 allowed). Consider refactoring.
      Open

          def __init__(self, session, name: str, module_name: str = None):
              self.compu_method = session.query(model.CompuMethod).filter(model.CompuMethod.name == name).first()
              if not self.compu_method:
                  return
              self.name = name
      Severity: Minor
      Found in pya2l/api/inspect.py - About 5 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

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

          def exitBitOperation(self, ctx):
              v_leftShift = delist(self.getList(ctx.v_leftShift), True)
              v_rightShift = delist(self.getList(ctx.v_rightShift), True)
              v_signExtend = delist(self.getList(ctx.v_signExtend), True)
              ctx.value = model.BitOperation(left_shift=v_leftShift, right_shift=v_rightShift, sign_extend=v_signExtend)
      Severity: Major
      Found in pya2l/a2l_listener.py and 1 other location - About 5 hrs to fix
      pya2l/a2l_listener.py on lines 180..189

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

      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 exitAnnotation(self, ctx):
              v_annotationLabel = delist(self.getList(ctx.v_annotationLabel), True)
              v_annotationOrigin = delist(self.getList(ctx.v_annotationOrigin), True)
              v_annotationText = delist(self.getList(ctx.v_annotationText), True)
              ctx.value = model.Annotation(
      Severity: Major
      Found in pya2l/a2l_listener.py and 1 other location - About 5 hrs to fix
      pya2l/a2l_listener.py on lines 1087..1092

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

      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 exitAxisRescaleX(self, ctx):
              position = ctx.position.value
              datatype = ctx.datatype.value
              maxNumberOfRescalePairs = ctx.maxNumberOfRescalePairs.value
              indexIncr = ctx.indexIncr.value
      Severity: Major
      Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
      pya2l/a2l_listener.py on lines 1073..1080
      pya2l/a2l_listener.py on lines 1564..1577
      pya2l/a2l_listener.py on lines 1579..1592
      pya2l/a2l_listener.py on lines 1594..1607
      pya2l/a2l_listener.py on lines 1609..1622

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

      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 exitStructureComponent(self, ctx):
              name = ctx.name.value
              deposit = ctx.deposit_.value
              offset = ctx.offset.value
              link = ctx.link.value
      Severity: Major
      Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
      pya2l/a2l_listener.py on lines 1549..1562
      pya2l/a2l_listener.py on lines 1564..1577
      pya2l/a2l_listener.py on lines 1579..1592
      pya2l/a2l_listener.py on lines 1594..1607
      pya2l/a2l_listener.py on lines 1609..1622

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

      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 exitAxisRescaleZ(self, ctx):
              position = ctx.position.value
              datatype = ctx.datatype.value
              maxNumberOfRescalePairs = ctx.maxNumberOfRescalePairs.value
              indexIncr = ctx.indexIncr.value
      Severity: Major
      Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
      pya2l/a2l_listener.py on lines 1073..1080
      pya2l/a2l_listener.py on lines 1549..1562
      pya2l/a2l_listener.py on lines 1564..1577
      pya2l/a2l_listener.py on lines 1594..1607
      pya2l/a2l_listener.py on lines 1609..1622

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

      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 exitAxisRescale5(self, ctx):
              position = ctx.position.value
              datatype = ctx.datatype.value
              maxNumberOfRescalePairs = ctx.maxNumberOfRescalePairs.value
              indexIncr = ctx.indexIncr.value
      Severity: Major
      Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
      pya2l/a2l_listener.py on lines 1073..1080
      pya2l/a2l_listener.py on lines 1549..1562
      pya2l/a2l_listener.py on lines 1564..1577
      pya2l/a2l_listener.py on lines 1579..1592
      pya2l/a2l_listener.py on lines 1594..1607

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

      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 exitAxisRescaleY(self, ctx):
              position = ctx.position.value
              datatype = ctx.datatype.value
              maxNumberOfRescalePairs = ctx.maxNumberOfRescalePairs.value
              indexIncr = ctx.indexIncr.value
      Severity: Major
      Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
      pya2l/a2l_listener.py on lines 1073..1080
      pya2l/a2l_listener.py on lines 1549..1562
      pya2l/a2l_listener.py on lines 1579..1592
      pya2l/a2l_listener.py on lines 1594..1607
      pya2l/a2l_listener.py on lines 1609..1622

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

      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 exitAxisRescale4(self, ctx):
              position = ctx.position.value
              datatype = ctx.datatype.value
              maxNumberOfRescalePairs = ctx.maxNumberOfRescalePairs.value
              indexIncr = ctx.indexIncr.value
      Severity: Major
      Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
      pya2l/a2l_listener.py on lines 1073..1080
      pya2l/a2l_listener.py on lines 1549..1562
      pya2l/a2l_listener.py on lines 1564..1577
      pya2l/a2l_listener.py on lines 1579..1592
      pya2l/a2l_listener.py on lines 1609..1622

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

      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

      Function _process_file has a Cognitive Complexity of 45 (exceeds 15 allowed). Consider refactoring.
      Open

          def _process_file(self, file_name, join_lines=True, encoding="latin-1"):
              result = []
              start_line_number = self.absolute_file_number + 1
              multiline = False
              pth_obj = Path(file_name)
      Severity: Minor
      Found in pya2l/preprocessor.py - About 5 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

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

                  for idx, tmem in enumerate(tree.members, 1):
                      sm = model.AMLTaggedStructMember(
                          block_definition=self.block_definition(tmem.block_definition),
                          taggedstruct_definition=self.taggedstruct_definition(tmem.taggedstruct_definition),
                          multiple=tmem.multiple,
      Severity: Major
      Found in pya2l/aml/db.py and 1 other location - About 4 hrs to fix
      pya2l/aml/db.py on lines 153..162

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

      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

                  for idx, mem in enumerate(tree.members, 1):
                      tum = model.AMLTaggedUnionMember(
                          member=self.member(mem.member),
                          block_definition=self.block_definition(mem.block_definition),
                          tag=mem.tag,
      Severity: Major
      Found in pya2l/aml/db.py and 1 other location - About 4 hrs to fix
      pya2l/aml/db.py on lines 133..142

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

      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 7 locations. Consider refactoring.
      Open

          def exitAxisPtsZ(self, ctx):
              position = ctx.position.value
              datatype = ctx.datatype.value
              indexIncr = ctx.indexIncr.value
              addressing = ctx.addressing.value
      Severity: Major
      Found in pya2l/a2l_listener.py and 6 other locations - About 4 hrs to fix
      pya2l/a2l_listener.py on lines 1048..1054
      pya2l/a2l_listener.py on lines 1484..1495
      pya2l/a2l_listener.py on lines 1497..1508
      pya2l/a2l_listener.py on lines 1523..1534
      pya2l/a2l_listener.py on lines 1536..1547
      pya2l/a2l_listener.py on lines 1679..1690

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

      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

      Severity
      Category
      Status
      Source
      Language