hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function putrequest has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0):
        """Send a request to the server.

        `method' specifies an HTTP request method, e.g. 'GET'.
        `url' specifies the object being requested, e.g. '/index.html'.
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/httplib.py - About 5 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 __init__ has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, fp=None, headers=None, outerboundary="",
                 environ=os.environ, keep_blank_values=0, strict_parsing=0):
        """Constructor.  Read multipart/* until last part.

        Arguments, all optional:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/cgi.py - About 5 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 include has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

def include(elem, loader=None):
    if loader is None:
        loader = default_loader
    # look for xinclude elements
    i = 0

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 check_extensions_list has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def check_extensions_list(self, extensions):
        """Ensure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to

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 putrequest has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0):
        """Send a request to the server.

        `method' specifies an HTTP request method, e.g. 'GET'.
        `url' specifies the object being requested, e.g. '/index.html'.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/httplib.py - About 5 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 __init__ has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, fp=None, headers=None, outerboundary="",
                 environ=os.environ, keep_blank_values=0, strict_parsing=0):
        """Constructor.  Read multipart/* until last part.

        Arguments, all optional:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/cgi.py - About 5 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 include has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

def include(elem, loader=None):
    if loader is None:
        loader = default_loader
    # look for xinclude elements
    i = 0
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/etree/ElementInclude.py - About 5 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 check_extensions_list has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def check_extensions_list(self, extensions):
        """Ensure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to

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 BuildExDataBase has 126 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def BuildExDataBase(Dict):
    # init Db items
    InitValueUint64 = Dict['INIT_DB_VALUE_UINT64']
    DbInitValueUint64 = DbComItemList(8, RawDataList = InitValueUint64)
    VardefValueUint64 = Dict['VARDEF_DB_VALUE_UINT64']
Severity: Major
Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 5 hrs to fix

    File CodeFragmentCollector.py has 376 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    ## @file
    # preprocess source file
    #
    #  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
    #
    Severity: Minor
    Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py - About 5 hrs to fix

      Consider simplifying this complex logical expression.
      Open

                          if LA90 == IDENTIFIER:
                              LA90_233 = self.input.LA(3)
      
                              if (self.synpred182()) :
                                  alt90 = 1
      Severity: Critical
      Found in BaseTools/Source/Python/Ecc/CParser.py - About 5 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                                if LA95 == IDENTIFIER:
                                    LA95_235 = self.input.LA(3)
        
                                    if (self.synpred188()) :
                                        alt95 = 1
        Severity: Critical
        Found in BaseTools/Source/Python/Ecc/CParser.py - About 5 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                                  if LA95 == IDENTIFIER:
                                      LA95_235 = self.input.LA(3)
          
                                      if (self.synpred188()) :
                                          alt95 = 1
          Severity: Critical
          Found in BaseTools/Source/Python/Eot/CParser.py - About 5 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                                if LA90 == IDENTIFIER:
                                    LA90_233 = self.input.LA(3)
            
                                    if (self.synpred182()) :
                                        alt90 = 1
            Severity: Critical
            Found in BaseTools/Source/Python/Eot/CParser.py - About 5 hrs to fix

              OptionParser has 38 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class OptionParser (OptionContainer):
              
                  """
                  Class attributes:
                    standard_option_list : [Option]
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/optparse.py - About 5 hrs to fix

                FTP has 38 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class FTP:
                
                    '''An FTP client class.
                
                    To create a connection, call the class using these arguments:
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/ftplib.py - About 5 hrs to fix

                  File chipsec_main.py has 375 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_main.py - About 5 hrs to fix

                    OptionParser has 38 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class OptionParser (OptionContainer):
                    
                        """
                        Class attributes:
                          standard_option_list : [Option]
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/optparse.py - About 5 hrs to fix

                      FTP has 38 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class FTP:
                      
                          '''An FTP client class.
                      
                          To create a connection, call the class using these arguments:
                      Severity: Minor
                      Found in vector-uefi/fd/efi/StdLib/lib/python.27/ftplib.py - About 5 hrs to fix

                        File plistlib.py has 374 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        r"""plistlib.py -- a tool to generate and parse MacOSX .plist files.
                        
                        The PropertyList (.plist) file format is a simple XML pickle supporting
                        basic object types, like dictionaries, lists, numbers and strings.
                        Usually the top level object is a dictionary.
                        Severity: Minor
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/plistlib.py - About 5 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language