cea-sec/miasm

View on GitHub

Showing 1,373 of 3,020 total issues

Avoid too many return statements within this function.
Open

        return tree
Severity: Major
Found in miasm/core/cpu.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return tree
    Severity: Major
    Found in miasm/core/cpu.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return new_keys
      Severity: Major
      Found in miasm/core/cpu.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return new_keys
        Severity: Major
        Found in miasm/core/cpu.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return set()
          Severity: Major
          Found in miasm/core/objc.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return set([curobj])
            Severity: Major
            Found in miasm/core/objc.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return set()
              Severity: Major
              Found in miasm/core/objc.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return tree
                Severity: Major
                Found in miasm/core/cpu.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return new_keys
                  Severity: Major
                  Found in miasm/core/cpu.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return ExprOp("->", expr.args[0].args[0], expr.args[1])
                    Severity: Major
                    Found in miasm/core/objc.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return False
                      Severity: Major
                      Found in miasm/core/graph.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return True
                        Severity: Major
                        Found in miasm/core/graph.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return True
                          Severity: Major
                          Found in miasm/core/graph.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return False
                            Severity: Major
                            Found in miasm/core/graph.py - About 30 mins to fix

                              Function my_GetVolumeInformation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def my_GetVolumeInformation(jitter, funcname, get_str, set_str):
                                  ret_ad, args = jitter.func_args_stdcall(["lprootpathname",
                                                                           "lpvolumenamebuffer",
                                                                           "nvolumenamesize",
                                                                           "lpvolumeserialnumber",
                              Severity: Minor
                              Found in miasm/os_dep/win_api_x86_32.py - About 25 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 kernel32_SetFilePointer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def kernel32_SetFilePointer(jitter):
                                  ret_ad, args = jitter.func_args_stdcall(["hwnd", "dinstance",
                                                                           "p_dinstance_high",
                                                                           "movemethod"])
                              
                              
                              Severity: Minor
                              Found in miasm/os_dep/win_api_x86_32.py - About 25 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 sys_arml_ioctl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def sys_arml_ioctl(jitter, linux_env):
                                  # Parse arguments
                                  fd, cmd, arg = jitter.syscall_args_systemv(3)
                                  log.debug("sys_ioctl(%x, %x, %x)", fd, cmd, arg)
                              
                              
                              Severity: Minor
                              Found in miasm/os_dep/linux/syscall.py - About 25 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 edge_attr has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def edge_attr(self, src, dst):
                                      if src not in self._blocks or dst not in self._blocks:
                                          return {}
                                      src_irdst = self._blocks[src].dst
                                      edge_color = "blue"
                              Severity: Minor
                              Found in miasm/ir/ir.py - About 25 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 _expr_loc_to_symb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def _expr_loc_to_symb(expr, loc_db):
                                  if not expr.is_loc():
                                      return expr
                                  if loc_db is None:
                                      name = str(expr)
                              Severity: Minor
                              Found in miasm/ir/ir.py - About 25 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 prepare_loader_x86_64 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def prepare_loader_x86_64(jitter, argv, envp, auxv, linux_env,
                                                        hlt_address=0x13371acc):
                                  """Fill the environment with enough information to run a linux loader
                              
                                  @jitter: Jitter instance
                              Severity: Minor
                              Found in miasm/os_dep/linux/environment.py - About 25 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