hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function iter_importers has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def iter_importers(fullname=""):
    """Yield PEP 302 importers for the given module name

    If fullname contains a '.', the importers will be for the package
    containing fullname, otherwise they will be importers for sys.meta_path,
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/pkgutil.py - About 1 hr 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 retrlines has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        def retrlines(self, cmd, callback = None):
            if callback is None: callback = print_line
            resp = self.sendcmd('TYPE A')
            conn = self.transfercmd(cmd)
            fp = conn.makefile('rb')
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/ftplib.py - About 1 hr 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 makeport has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def makeport(self):
        '''Create a new socket and send a PORT command for it.'''
        msg = "getaddrinfo returns an empty list"
        sock = None
        for res in socket.getaddrinfo(None, 0, self.af, socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/ftplib.py - About 1 hr 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 storlines has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def storlines(self, cmd, fp, callback=None):
        """Store a file in line mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/ftplib.py - About 1 hr 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 substitute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def substitute(self, *args, **kws):
        if len(args) > 1:
            raise TypeError('Too many positional arguments')
        if not args:
            mapping = kws
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/string.py - About 1 hr 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 get_importer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def get_importer(path_item):
    """Retrieve a PEP 302 importer for the given path item

    The returned importer is cached in sys.path_importer_cache
    if it was newly created by a path hook.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/pkgutil.py - About 1 hr 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 testNormalCase11 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def testNormalCase11(self):
        GuidList = []
                
        CName = 'Guid1'
        FFE = 'FFE1'
Severity: Minor
Found in BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py - About 1 hr to fix

    Function testNormalCase12 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def testNormalCase12(self):
            GuidList = []
                    
            CName = 'Guid1'
            FFE = 'FFE1'
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py - About 1 hr to fix

      Function CheckEnvVariable has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def CheckEnvVariable():
          # check WORKSPACE
          if "WORKSPACE" not in os.environ:
              EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
                              ExtraData="WORKSPACE")
      Severity: Minor
      Found in BaseTools/Source/Python/build/build.py - About 1 hr to fix

        Function docmodule has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def docmodule(self, object, name=None, mod=None):
                """Produce text documentation for a given module object."""
                name = object.__name__ # ignore the passed-in name
                synop, desc = splitdoc(getdoc(object))
                result = self.section('NAME', name + (synop and ' - ' + synop))
        Severity: Minor
        Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py - About 1 hr to fix

          Function test has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def test():
              import sys
              debugging = 0
              print_headers = 0
              cont = 0
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/texi2html.py - About 1 hr to fix

            Function test has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def test():
                """Test this module.
            
                A hodge podge of tests collected here, because they have too many
                external dependencies for the regular test suite.
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/httplib.py - About 1 hr to fix

              Function docmodule has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def docmodule(self, object, name=None, mod=None):
                      """Produce text documentation for a given module object."""
                      name = object.__name__ # ignore the passed-in name
                      synop, desc = splitdoc(getdoc(object))
                      result = self.section('NAME', name + (synop and ' - ' + synop))
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pydoc.py - About 1 hr to fix

                Function check_SMRR has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def check_SMRR(self):
                        self.logger.start_test( "CPU SMM Cache Poisoning / SMM Range Registers (SMRR)" )
                        if self.check_SMRR_supported():
                            self.logger.log_good( "OK. SMRR are supported in IA32_MTRRCAP_MSR" )
                        else:
                Severity: Minor
                Found in vector-uefi/fd/tool/chipsec/modules/common/smrr.py - About 1 hr to fix

                  Function test has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def test():
                      """Test this module.
                  
                      A hodge podge of tests collected here, because they have too many
                      external dependencies for the regular test suite.
                  Severity: Minor
                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/httplib.py - About 1 hr to fix

                    Function docmodule has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def docmodule(self, object, name=None, mod=None):
                            """Produce text documentation for a given module object."""
                            name = object.__name__ # ignore the passed-in name
                            synop, desc = splitdoc(getdoc(object))
                            result = self.section('NAME', name + (synop and ' - ' + synop))
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/pydoc.py - About 1 hr to fix

                      Method FillDistancesPrices has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              void FillDistancesPrices()
                              {
                                  for (UInt32 i = Base.kStartPosModelIndex; i < Base.kNumFullDistances; i++)
                                  { 
                                      UInt32 posSlot = GetPosSlot(i);
                      Severity: Minor
                      Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LZMA/LzmaEncoder.cs - About 1 hr to fix

                        Method GetPrice has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                        public uint GetPrice(bool matchMode, byte matchByte, byte symbol)
                                        {
                                            uint price = 0;
                                            uint context = 1;
                                            int i = 7;
                        Severity: Minor
                        Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LZMA/LzmaEncoder.cs - About 1 hr to fix

                          Function __init__ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def __init__(self, ModuleAutoGen):
                                  BuildFile.__init__(self, ModuleAutoGen)
                                  self.PlatformInfo = self._AutoGenObject.PlatformInfo
                          
                                  self.ResultFileList = []
                          Severity: Minor
                          Found in BaseTools/Source/Python/AutoGen/GenMake.py - About 1 hr to fix

                            Function finalize_package_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def finalize_package_data (self):
                                    self.ensure_string('group', "Development/Libraries")
                                    self.ensure_string('vendor',
                                                       "%s <%s>" % (self.distribution.get_contact(),
                                                                    self.distribution.get_contact_email()))
                              Severity
                              Category
                              Status
                              Source
                              Language