cea-sec/miasm

View on GitHub

Showing 1,373 of 3,020 total issues

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

def vec_vertical_sem(op, elt_size, reg_size, dst, src, apply_on_output):
Severity: Minor
Found in miasm/arch/x86/sem.py - About 45 mins to fix

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

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

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

          def fromstring(self, text, loc_db, parser_result=None):
              if parser_result:
                  expr, start, stop = parser_result[self.parser]
              else:
                  try:
      Severity: Minor
      Found in miasm/arch/x86/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 pinsr has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def pinsr(_, instr, dst, src, imm, size):
      Severity: Minor
      Found in miasm/arch/x86/sem.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            for rex_b in range(2):
                                for rex_x in range(2):
                                    sib_rez[rex_x][rex_b][index][f_imm] = f_u32
                        elif sib_rez == sib_64_s08_ebp:
        Severity: Major
        Found in miasm/arch/x86/arch.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if int(disp) != sign_ext(int(value), admode, disp.size):
                                  continue
                          else:
          Severity: Major
          Found in miasm/arch/x86/arch.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for rex_b in range(2):
                                    for rex_x in range(2):
                                        sib_rez[rex_x][rex_b][index][b + 8 * rex_b] = 1
                                        sib_rez[rex_x][rex_b][index][f_imm] = f_u32
                            elif sib_rez == sib_u64:
            Severity: Major
            Found in miasm/arch/x86/arch.py - About 45 mins to fix

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

              def opmode_prefix(mode):
                  size, opmode, admode = mode
                  if size in [16, 32]:
                      if opmode:
                          return invmode[size]
              Severity: Minor
              Found in miasm/arch/x86/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

              Avoid deeply nested control flow statements.
              Open

                                  for rex_b in range(2):
                                      for rex_x in range(2):
                                          sib_rez[rex_x][rex_b][index][f_imm] = f_s08
                                          sib_rez[rex_x][rex_b][index][ebp + 8 * rex_b] = 1
              
              
              Severity: Major
              Found in miasm/arch/x86/arch.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    for rex_x in range(2):
                                        tmp = i + 8 * rex_x
                                        if i == 0b100 and rex_x == 0:
                                            continue
                                        if not tmp in sib_rez[rex_x][rex_b][index]:
                Severity: Major
                Found in miasm/arch/x86/arch.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      for rex_b in range(2):
                                          for rex_x in range(2):
                                              sib_rez[rex_x][rex_b][index][f_imm] = f_u32
                                              sib_rez[rex_x][rex_b][index][ebp + 8 * rex_b] = 1
                                  elif sib_rez == sib_u64:
                  Severity: Major
                  Found in miasm/arch/x86/arch.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        for rex_b in range(2):
                                            for rex_x in range(2):
                                                sib_rez[rex_x][rex_b][index][b + 8 * rex_b] = 1
                                    elif sib_rez == sib_64_s08_ebp:
                    Severity: Major
                    Found in miasm/arch/x86/arch.py - About 45 mins to fix

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

                      def _roundscalar(ir, inst, dst, src, imm8, double):
                      Severity: Minor
                      Found in miasm/arch/x86/sem.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if int(disp) != int(value):
                                                continue
                                    else:
                        Severity: Major
                        Found in miasm/arch/x86/arch.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              for rex_b in range(2):
                                                  for rex_x in range(2):
                                                      sib_rez[rex_x][rex_b][index][f_imm] = f_s08
                                                      sib_rez[rex_x][rex_b][index][b + 8 * rex_b] = 1
                          
                          
                          Severity: Major
                          Found in miasm/arch/x86/arch.py - About 45 mins to fix

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

                            def jmp(ir, instr, dst):
                                e = []
                                meip = mRIP[ir.IRDst.size]
                            
                                if isinstance(dst, m2_expr.ExprOp):
                            Severity: Minor
                            Found in miasm/arch/x86/sem.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 pextr has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def pextr(_, instr, dst, src, imm, size):
                            Severity: Minor
                            Found in miasm/arch/x86/sem.py - About 45 mins to fix

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

                              def punpck(_, instr, dst, src, size, off):
                              Severity: Minor
                              Found in miasm/arch/x86/sem.py - About 45 mins to fix

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

                                    def __init__(self, sex, wsize, *args, **kargs):
                                        if sex == 1:
                                            sex = '<'
                                        else:
                                            sex = '>'
                                Severity: Minor
                                Found in miasm/loader/cstruct.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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def __init__(self, loc_db, fname, options, custom_methods=None, **kwargs):
                                        """
                                        Initialize a sandbox
                                        @fname: str file name
                                        @options: namespace instance of specific options
                                Severity: Minor
                                Found in miasm/analysis/sandbox.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