cea-sec/miasm

View on GitHub

Showing 1,373 of 3,020 total issues

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

def umlal(ir, instr, a, b, c, d):
Severity: Minor
Found in miasm/arch/arm/sem.py - About 45 mins to fix

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

        def encode(self):
            e = self.expr
            if e in self.reg_info.expr:
                self.parent.a_d.value = 0
                self.value = self.reg_info.expr.index(e)
    Severity: Minor
    Found in miasm/arch/msp430/arch.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 value has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def value(self, mode):
            """Adjust the assembled instruction based on the endianness
    
               Note: code inspired by miasm/arch/mips32/arch.py
            """
    Severity: Minor
    Found in miasm/arch/mep/arch.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 smull has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def smull(ir, instr, a, b, c, d):
    Severity: Minor
    Found in miasm/arch/arm/sem.py - About 45 mins to fix

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

      def smlabt(ir, instr, a, b, c, d):
      Severity: Minor
      Found in miasm/arch/arm/sem.py - About 45 mins to fix

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

            def decode(self, v):
                if hasattr(self.parent, 'size'):
                    size = [16, 8][self.parent.size.value]
                else:
                    size = 16
        Severity: Minor
        Found in miasm/arch/msp430/arch.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 mla has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def mla(ir, instr, a, b, c, d):
        Severity: Minor
        Found in miasm/arch/arm/sem.py - About 45 mins to fix

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

          def mls(ir, instr, a, b, c, d):
          Severity: Minor
          Found in miasm/arch/arm/sem.py - About 45 mins to fix

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

            def smlal(ir, instr, a, b, c, d):
            Severity: Minor
            Found in miasm/arch/arm/sem.py - About 45 mins to fix

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

              def ubfx(ir, instr, a, b, c, d):
              Severity: Minor
              Found in miasm/arch/arm/sem.py - About 45 mins to fix

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

                def smlatb(ir, instr, a, b, c, d):
                Severity: Minor
                Found in miasm/arch/arm/sem.py - About 45 mins to fix

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

                  def umull(ir, instr, a, b, c, d):
                  Severity: Minor
                  Found in miasm/arch/arm/sem.py - About 45 mins to fix

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

                    def gen_cmov(ir, instr, cond, dst, src, mov_if):
                    Severity: Minor
                    Found in miasm/arch/x86/sem.py - About 45 mins to fix

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

                          def decode(self, v):
                              v = v & self.lmask
                              out = []
                              for i in range(0x10):
                                  if 1 << i & v:
                      Severity: Minor
                      Found in miasm/arch/arm/arch.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 decode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def decode(self, v):
                              val = v & self.lmask
                              val = self.decodeval(val)
                              if val is False:
                                  return False
                      Severity: Minor
                      Found in miasm/arch/arm/arch.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 _rotate_tpl has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def _rotate_tpl(ir, instr, dst, src, op, left=False):
                      Severity: Minor
                      Found in miasm/arch/x86/sem.py - About 45 mins to fix

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

                            def decode(self, v):
                                v = v & self.lmask
                                out = []
                                for i in range(13):
                                    if 1 << i & v:
                        Severity: Minor
                        Found in miasm/arch/arm/arch.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 ins has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def ins(ir, instr, a, b, c, d):
                        Severity: Minor
                        Found in miasm/arch/mips32/sem.py - About 45 mins to fix

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

                              def arg2str(expr, index=None, loc_db=None):
                                  if expr.is_id() or expr.is_int():
                                      return str(expr)
                                  elif expr.is_loc():
                                      if loc_db is not None:
                          Severity: Minor
                          Found in miasm/arch/mips32/arch.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 gen_fcmov has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def gen_fcmov(ir, instr, cond, arg1, arg2, mov_if):
                          Severity: Minor
                          Found in miasm/arch/x86/sem.py - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language