hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                    if name in ("__dict__", "__weakref__"):
                        continue
                    # mangled names
                    elif name.startswith('__') and not name.endswith('__'):
                        names.append('_%s%s' % (c.__name__, name))
Severity: Major
Found in vector-uefi/fd/efi/StdLib/lib/python.27/copy_reg.py - About 45 mins to fix

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

    def compile_dir(dir, maxlevels=10, ddir=None,
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/compileall.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if not compile_dir(arg, maxlevels, ddir,
                                                 force, rx, quiet):
                                  success = 0
                          else:
      Severity: Major
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/compileall.py - About 45 mins to fix

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

         def write_pci_reg( self, bus, device, function, address, value, size ):
        Severity: Minor
        Found in vector-uefi/fd/tool/chipsec/helper/efi/efihelper.py - About 45 mins to fix

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

              def VARS_list_EFI_variables ( self, infcls=2 ):
                  varlist = os.listdir('/sys/firmware/efi/vars')
                  variables = dict()
                  for v in varlist:
                      name = v[:-37]
          Severity: Minor
          Found in vector-uefi/fd/tool/chipsec/helper/linux/helper.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 _repr_iterable has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _repr_iterable(self, x, level, left, right, maxiter, trail=''):
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/repr.py - About 45 mins to fix

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

                def write_pci_reg( self, bus, device, function, address, value, size ):
            Severity: Minor
            Found in vector-uefi/fd/tool/chipsec/helper/win/win32helper.py - About 45 mins to fix

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

                  def VARS_get_efivar_from_sys( self, filename ):     
                      off = 0
                      buf = list()
                      hdr = 0
                      try:
              Severity: Minor
              Found in vector-uefi/fd/tool/chipsec/helper/linux/helper.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 getresponse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def getresponse(self, buffering=False):
                      "Get the response from the server."
              
                      # if a prior response has been completed, then forget about it.
                      if self.__response and self.__response.isclosed():
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/httplib.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 read has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def read(self, amt=None):
                      if self._line_consumed:
                          return self._file.read(amt)
                      assert self._line_left
                      if amt is None or amt > self._line_left:
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/httplib.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 VARS_set_EFI_variable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def VARS_set_EFI_variable(self,  name, guid, value ):
                      ret = True
                      if not name:
                          name = '*'
                      if not guid:
              Severity: Minor
              Found in vector-uefi/fd/tool/chipsec/helper/linux/helper.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 smi has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def smi(argv):
                  try:
                     interrupts = Interrupts( _cs )
                  except RuntimeError, msg:
                     print msg
              Severity: Minor
              Found in vector-uefi/fd/tool/chipsec/utilcmd/interrupts_cmd.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 write_pci_reg has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def write_pci_reg( self, bus, device, function, address, value, size ):
              Severity: Minor
              Found in vector-uefi/fd/tool/chipsec/helper/oshelper.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if ans is None:
                                            ans = self.__namespaces.get(aprefix)
                                        if ans is not None:
                Severity: Major
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/xmllib.py - About 45 mins to fix

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

                      def EFIVARS_list_EFI_variables ( self, infcls=2 ):
                          varlist = os.listdir('/sys/firmware/efi/efivars')
                          variables = dict()
                          for v in varlist:
                              name = v[:-37]
                  Severity: Minor
                  Found in vector-uefi/fd/tool/chipsec/helper/linux/helper.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 write_pci_reg has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def write_pci_reg( self, bus, device, function, offset, value, size = 4 ):
                  Severity: Minor
                  Found in vector-uefi/fd/tool/chipsec/helper/linux/helper.py - About 45 mins to fix

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

                    def _module_relative_path(module, path):
                        if not inspect.ismodule(module):
                            raise TypeError, 'Expected a module: %r' % module
                        if path.startswith('/'):
                            raise ValueError, 'Module-relative files may not have absolute paths'
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/doctest.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, host='', port=0, local_hostname=None,
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/smtplib.py - About 45 mins to fix

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

                          def docclass(self, object, name=None, mod=None, funcs={}, classes={},
                      Severity: Minor
                      Found in vector-uefi/fd/efi/StdLib/lib/python.27/pydoc.py - About 45 mins to fix

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

                            def save_reduce(self, func, args, state=None,
                        Severity: Minor
                        Found in vector-uefi/fd/efi/StdLib/lib/python.27/pickle.py - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language