cea-sec/miasm

View on GitHub

Showing 1,373 of 3,020 total issues

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

    def del_mem_above_stack(self, stack_ptr):
        """
        Remove all stored memory values with following properties:
        * pointer based on initial stack value
        * pointer below current stack pointer
Severity: Minor
Found in miasm/ir/symbexec.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 intra_block_flow_symb has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def intra_block_flow_symb(lifter, _, flow_graph, irblock, in_nodes, out_nodes):
Severity: Minor
Found in example/expression/graph_dataflow.py - About 45 mins to fix

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

    def prepare_loader_arml(jitter, argv, envp, auxv, linux_env,
    Severity: Minor
    Found in miasm/os_dep/linux/environment.py - About 45 mins to fix

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

      def simp_test_signext_inf(expr_s, expr):
          """A.signExt() <s int => A <s int[:]"""
          if not (expr.is_op(TOK_INF_SIGNED) or expr.is_op(TOK_INF_EQUAL_SIGNED)):
              return expr
          arg, cst = expr.args
      Severity: Minor
      Found in miasm/expression/simplifications_common.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 visit_inner has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def visit_inner(self, expr, *args, **kwargs):
              self.get_r_leaves(expr)
              if expr.is_mem() and not self.mem_read:
                  # Don't visit memory sons
                  return None
      Severity: Minor
      Found in miasm/expression/expression.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

                          if is_signed:
                              out = -1
                          else:
                              out = 0
                      else:
      Severity: Major
      Found in miasm/expression/simplifications_common.py - About 45 mins to fix

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

        def csneg(ir, instr, arg1, arg2, arg3, arg4):
        Severity: Minor
        Found in miasm/arch/aarch64/sem.py - About 45 mins to fix

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

          def ubfm(ir, instr, arg1, arg2, arg3, arg4):
          Severity: Minor
          Found in miasm/arch/aarch64/sem.py - About 45 mins to fix

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

            def ccmp(ir, instr, arg1, arg2, arg3, arg4):
            Severity: Minor
            Found in miasm/arch/aarch64/sem.py - About 45 mins to fix

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

              def bfm(ir, instr, arg1, arg2, arg3, arg4):
              Severity: Minor
              Found in miasm/arch/aarch64/sem.py - About 45 mins to fix

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

                def fmadd(ir, instr, arg1, arg2, arg3, arg4):
                Severity: Minor
                Found in miasm/arch/aarch64/sem.py - About 45 mins to fix

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

                  def csinc(ir, instr, arg1, arg2, arg3, arg4):
                  Severity: Minor
                  Found in miasm/arch/aarch64/sem.py - About 45 mins to fix

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

                        def __getitem__(self, info):
                            if isinstance(info, slice):
                                start = info.start if info.start else 0
                                stop = info.stop if info.stop else self.value
                                if info.step is not None:
                    Severity: Minor
                    Found in miasm/arch/aarch64/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 fmsub has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def fmsub(ir, instr, arg1, arg2, arg3, arg4):
                    Severity: Minor
                    Found in miasm/arch/aarch64/sem.py - About 45 mins to fix

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

                      def sbfm(ir, instr, arg1, arg2, arg3, arg4):
                      Severity: Minor
                      Found in miasm/arch/aarch64/sem.py - About 45 mins to fix

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

                        def csinv(ir, instr, arg1, arg2, arg3, arg4):
                        Severity: Minor
                        Found in miasm/arch/aarch64/sem.py - About 45 mins to fix

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

                              def encode(self):
                                  if not isinstance(self.expr, m2_expr.ExprInt):
                                      return False
                                  if not test_set_sf(self.parent, self.expr.size):
                                      return False
                          Severity: Minor
                          Found in miasm/arch/aarch64/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 mlas has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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

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

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

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

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