hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function process_rawq has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

    def process_rawq(self):
        """Transfer from raw queue to cooked queue.

        Set self.eof when connection is closed.  Don't block unless in
        the midst of an IAC sequence.
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/telnetlib.py - About 7 hrs 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 _parse_makefile has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

def _parse_makefile(filename, vars=None):
    """Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sysconfig.py - About 7 hrs 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 docmodule has a Cognitive Complexity of 50 (exceeds 5 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 7 hrs 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 _really_load has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

    def _really_load(self, f, filename, ignore_discard, ignore_expires):
        magic = f.readline()
        if not re.search(self.magic_re, magic):
            msg = ("%r does not look like a Set-Cookie3 (LWP) format "
                   "file" % filename)
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/_LWPCookieJar.py - About 7 hrs 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 process_rawq has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

    def process_rawq(self):
        """Transfer from raw queue to cooked queue.

        Set self.eof when connection is closed.  Don't block unless in
        the midst of an IAC sequence.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/telnetlib.py - About 7 hrs 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 _parse_makefile has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

def _parse_makefile(filename, vars=None):
    """Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/sysconfig.py - About 7 hrs 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

File msvccompiler.py has 489 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""distutils.msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
"""
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/msvccompiler.py - About 7 hrs to fix

    File SocketServer.py has 489 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Generic socket server classes.
    
    This module tries to capture the various aspects of defining a server:
    
    For socket-based servers:
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/SocketServer.py - About 7 hrs to fix

      File win32helper.py has 489 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/local/bin/python
      #CHIPSEC: Platform Security Assessment Framework
      #Copyright (c) 2010-2014, Intel Corporation
      # 
      #This program is free software; you can redistribute it and/or
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/helper/win/win32helper.py - About 7 hrs to fix

        File msvccompiler.py has 489 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """distutils.msvccompiler
        
        Contains MSVCCompiler, an implementation of the abstract CCompiler class
        for the Microsoft Visual Studio.
        """
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/msvccompiler.py - About 7 hrs to fix

          File SocketServer.py has 489 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """Generic socket server classes.
          
          This module tries to capture the various aspects of defining a server:
          
          For socket-based servers:
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/SocketServer.py - About 7 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                            if LA4 == 29 or LA4 == 30 or LA4 == 31 or LA4 == 32 or LA4 == 33 or LA4 == 34 or LA4 == 35 or LA4 == 36 or LA4 == 37 or LA4 == 38 or LA4 == 39 or LA4 == 40 or LA4 == 41 or LA4 == 42 or LA4 == 45 or LA4 == 46 or LA4 == 48 or LA4 == 49 or LA4 == 50 or LA4 == 51 or LA4 == 52 or LA4 == 53 or LA4 == 54 or LA4 == 55 or LA4 == 56 or LA4 == 57 or LA4 == 61:
                                alt4 = 1
                            elif LA4 == IDENTIFIER:
                                LA4 = self.input.LA(2)
                                if LA4 == 66:
            Severity: Critical
            Found in BaseTools/Source/Python/Ecc/CParser.py - About 7 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                                  if LA7 == 29 or LA7 == 30 or LA7 == 31 or LA7 == 32 or LA7 == 33 or LA7 == 34 or LA7 == 35 or LA7 == 36 or LA7 == 37 or LA7 == 38 or LA7 == 39 or LA7 == 40 or LA7 == 41 or LA7 == 42 or LA7 == 45 or LA7 == 46 or LA7 == 48 or LA7 == 49 or LA7 == 50 or LA7 == 51 or LA7 == 52 or LA7 == 53 or LA7 == 54 or LA7 == 55 or LA7 == 56 or LA7 == 57 or LA7 == 61:
                                      alt7 = 1
                                  elif LA7 == IDENTIFIER:
                                      LA7_13 = self.input.LA(2)
              
              Severity: Critical
              Found in BaseTools/Source/Python/Ecc/CParser.py - About 7 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                        if LA102 == 29 or LA102 == 30 or LA102 == 31 or LA102 == 32 or LA102 == 33 or LA102 == 34 or LA102 == 35 or LA102 == 36 or LA102 == 37 or LA102 == 38 or LA102 == 39 or LA102 == 40 or LA102 == 41 or LA102 == 42 or LA102 == 45 or LA102 == 46 or LA102 == 48 or LA102 == 49 or LA102 == 50 or LA102 == 51 or LA102 == 52 or LA102 == 53 or LA102 == 54 or LA102 == 55 or LA102 == 56 or LA102 == 57 or LA102 == 61:
                            alt102 = 1
                        elif LA102 == IDENTIFIER:
                            LA102 = self.input.LA(2)
                            if LA102 == 62:
                Severity: Critical
                Found in BaseTools/Source/Python/Ecc/CParser.py - About 7 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if LA102 == 29 or LA102 == 30 or LA102 == 31 or LA102 == 32 or LA102 == 33 or LA102 == 34 or LA102 == 35 or LA102 == 36 or LA102 == 37 or LA102 == 38 or LA102 == 39 or LA102 == 40 or LA102 == 41 or LA102 == 42 or LA102 == 45 or LA102 == 46 or LA102 == 48 or LA102 == 49 or LA102 == 50 or LA102 == 51 or LA102 == 52 or LA102 == 53 or LA102 == 54 or LA102 == 55 or LA102 == 56 or LA102 == 57 or LA102 == 61:
                              alt102 = 1
                          elif LA102 == IDENTIFIER:
                              LA102 = self.input.LA(2)
                              if LA102 == 62:
                  Severity: Critical
                  Found in BaseTools/Source/Python/Eot/CParser.py - About 7 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                                    if LA4 == 29 or LA4 == 30 or LA4 == 31 or LA4 == 32 or LA4 == 33 or LA4 == 34 or LA4 == 35 or LA4 == 36 or LA4 == 37 or LA4 == 38 or LA4 == 39 or LA4 == 40 or LA4 == 41 or LA4 == 42 or LA4 == 45 or LA4 == 46 or LA4 == 48 or LA4 == 49 or LA4 == 50 or LA4 == 51 or LA4 == 52 or LA4 == 53 or LA4 == 54 or LA4 == 55 or LA4 == 56 or LA4 == 57 or LA4 == 61:
                                        alt4 = 1
                                    elif LA4 == IDENTIFIER:
                                        LA4 = self.input.LA(2)
                                        if LA4 == 66:
                    Severity: Critical
                    Found in BaseTools/Source/Python/Eot/CParser.py - About 7 hrs to fix

                      Consider simplifying this complex logical expression.
                      Open

                                          if LA7 == 29 or LA7 == 30 or LA7 == 31 or LA7 == 32 or LA7 == 33 or LA7 == 34 or LA7 == 35 or LA7 == 36 or LA7 == 37 or LA7 == 38 or LA7 == 39 or LA7 == 40 or LA7 == 41 or LA7 == 42 or LA7 == 45 or LA7 == 46 or LA7 == 48 or LA7 == 49 or LA7 == 50 or LA7 == 51 or LA7 == 52 or LA7 == 53 or LA7 == 54 or LA7 == 55 or LA7 == 56 or LA7 == 57 or LA7 == 61:
                                              alt7 = 1
                                          elif LA7 == IDENTIFIER:
                                              LA7_13 = self.input.LA(2)
                      
                      Severity: Critical
                      Found in BaseTools/Source/Python/Eot/CParser.py - About 7 hrs to fix

                        Function _GetSingleValue has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _GetSingleValue(self, FirstKey, RestKeys):
                                Value = None
                                #print "%s-%s" % (FirstKey, self._Level_) ,
                                if self._Level_ > 1:
                                    if FirstKey == self._Wildcard:
                        Severity: Minor
                        Found in BaseTools/Source/Python/Common/Misc.py - About 7 hrs 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 __GetComponentStatement has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def __GetComponentStatement(self, VtfObj):
                        
                                if not self.__IsKeyword("COMP_NAME"):
                                    return False
                        
                        Severity: Minor
                        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 7 hrs 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 parserest has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def parserest(self, fp, initial_lineno):
                                lineno = initial_lineno
                                self.done = 0
                                self.skip = 0
                                self.stack = []
                        Severity: Minor
                        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/texi2html.py - About 7 hrs 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