christoph2/pydbc

View on GitHub

Showing 197 of 197 total issues

Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, frame_time, d1, d2, d3, d4, d5, d6, d7, d8):
Severity: Major
Found in pydbc/db/model.py - About 1 hr to fix

    Function exitLin_description_file has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def exitLin_description_file(self, ctx):
            self.value = dict(
                protocolVersion = ctx.pv.value,
                languageVersion = ctx.lv.value,
                fileRevision = ctx.fr.value if ctx.fr else None,
    Severity: Minor
    Found in pydbc/ldfListener.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 exitDiagnostic_definition has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def exitDiagnostic_definition(self, ctx):
            lhs = ctx.lhs.value
            rhs = ctx.rhs.value if ctx.rhs else None
            nads = [x.value for x in ctx.nads] if ctx.nads else []
            dc = ctx.dc.value if ctx.dc else None
    Severity: Minor
    Found in pydbc/ncfListener.py - About 55 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

    Function exitEnvironmentVariables has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def exitEnvironmentVariables(self, ctx):
            self.log_insertion("EnvVars")
            # TODO: Process after EVDATA!!!
            ctx.value = [x.value for x in ctx.evs]
            for var in ctx.value:
    Severity: Minor
    Found in pydbc/dbcListener.py - About 55 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

    Function exitSignal_encoding_type_def has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def exitSignal_encoding_type_def(self, ctx):
            self.log_insertion("SignalEncodings")
            items = [x.value for x in ctx.items]
            ctx.value = items
            tps = set()
    Severity: Minor
    Found in pydbc/ldfListener.py - About 55 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

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

        def __str__(self):
            return "{}(priority = {}, reserved = {}, datapage = {}, pdu_format = {}, pdu_specific = {}, source_address = {})".\
                format(self.__class__.__name__, self.priority, self.reserved, self.datapage, self.pdu_format,
                self.pdu_specific, self.source_address
    Severity: Minor
    Found in pydbc/types.py and 1 other location - About 55 mins to fix
    pydbc/ldfListener.py on lines 64..65

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

    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 __repr__(self):
            return "{}({} {} {} {} {} {})".format(self.__class__.__name__, self.name, self.objType, self.valueType, self.minimum, self.maximum, self.array)
    Severity: Minor
    Found in pydbc/ldfListener.py and 1 other location - About 55 mins to fix
    pydbc/types.py on lines 205..208

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

    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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, frame_time, nad, id, byte, mask , inv, new_nad):
    Severity: Major
    Found in pydbc/db/model.py - About 50 mins to fix

      Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, frame_time, node, frame_index, frame_pid1 = None, frame_pid2 = None, frame_pid3 = None, frame_pid4 = None):
      Severity: Major
      Found in pydbc/db/model.py - About 50 mins to fix

        Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, frame_time, node, d1, d2, d3, d4, d5):
        Severity: Major
        Found in pydbc/db/model.py - About 50 mins to fix

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

          def StdFloat(default = 0.0, primary_key = False, unique = False, nullable = False):
              return Column(types.Integer, default = default, nullable = nullable,
          Severity: Minor
          Found in pydbc/db/model.py and 1 other location - About 50 mins to fix
          pydbc/db/model.py on lines 78..79

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

          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 StdInteger(default = 0, primary_key = False, unique = False, nullable = False):
              return Column(types.Integer, default = default, nullable = nullable,    # PassiveDefault(str(default))
          Severity: Minor
          Found in pydbc/db/model.py and 1 other location - About 50 mins to fix
          pydbc/db/model.py on lines 82..83

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

          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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, name, objType, valueType, minimum = None, maximum = None, array = False):
          Severity: Minor
          Found in pydbc/ldfListener.py - About 45 mins to fix

            Function exitSignal_representation_def has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def exitSignal_representation_def(self, ctx):
                    self.log_insertion("SignalRepresentations")
                    items = [x.value for x in ctx.items]
                    ctx.value = items
                    for sr in items:
            Severity: Minor
            Found in pydbc/ldfListener.py - About 45 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

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

                def __repr__(self):
                    return 'LinScheduleTable_Command_DataDump(frame_time = {}, node = {}, d1 = {}, d2 = {}, d3 = {}, d4 = {}, d5 = {})'.format(
                        self.frame_time, self.node, self.d1, self.d2, self.d3, self.d4, self.d5
            Severity: Major
            Found in pydbc/db/model.py and 2 other locations - About 45 mins to fix
            pydbc/db/model.py on lines 1190..1192
            pydbc/db/model.py on lines 1298..1300

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

            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 exitSignalGroups has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def exitSignalGroups(self, ctx):
                    self.log_insertion("SignalGroups")
                    items = [x.value for x in ctx.items]
                    ctx.value = items
                    for group in ctx.value:
            Severity: Minor
            Found in pydbc/dbcListener.py - About 45 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

            Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, name, protocol_version = None, language_version = None, speed = None,
            Severity: Minor
            Found in pydbc/db/model.py - About 45 mins to fix

              Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, signal, message, offset, multiplexor_signal = None,
              Severity: Minor
              Found in pydbc/db/model.py - About 45 mins to fix

                Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, priority, reserved, datapage, pdu_format, pdu_specific, source_address):
                Severity: Minor
                Found in pydbc/types.py - About 45 mins to fix

                  Function exitFrame_def has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def exitFrame_def(self, ctx):
                          self.log_insertion("UnconditionalFrames")
                          ctx.value = [x.value for x in ctx.items]
                          for frame in ctx.value:
                              frid = frame['frameID']
                  Severity: Minor
                  Found in pydbc/ldfListener.py - About 45 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

                  Severity
                  Category
                  Status
                  Source
                  Language