hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function _power_exact has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
Open

    def _power_exact(self, other, p):
        """Attempt to compute self**other exactly.

        Given Decimals self and other and an integer p, attempt to
        compute an exact result for the power self**other, with p
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/decimal.py - About 1 day 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 _power_exact has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
Open

    def _power_exact(self, other, p):
        """Attempt to compute self**other exactly.

        Given Decimals self and other and an integer p, attempt to
        compute an exact result for the power self**other, with p
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/decimal.py - About 1 day 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 DataType.py has 747 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to define class for data type structure
#
# Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
#
Severity: Major
Found in BaseTools/Source/Python/UPT/Library/DataType.py - About 1 day to fix

    Function _CollectModuleMapBuffer has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
    Open

        def _CollectModuleMapBuffer (self, MapBuffer, ModuleList):
            sys.stdout.write ("Generate Load Module At Fix Address Map")
            sys.stdout.flush()
            PatchEfiImageList = []
            PeiModuleList  = {}
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.py - About 1 day 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 run_cgi has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
    Open

        def run_cgi(self):
            """Execute a CGI script."""
            path = self.path
            dir, rest = self.cgi_info
    
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/CGIHTTPServer.py - About 1 day 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 run_cgi has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
    Open

        def run_cgi(self):
            """Execute a CGI script."""
            path = self.path
            dir, rest = self.cgi_info
    
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/CGIHTTPServer.py - About 1 day 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 faqwiz.py has 741 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Generic FAQ Wizard.
    
    This is a CGI program that maintains a user-editable FAQ.  It uses RCS
    to keep track of changes to individual FAQ entries.  It is fully
    configurable; everything you might want to change when using this
    Severity: Major
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/faqwiz/faqwiz.py - About 1 day to fix

      Function __GetRuleFileStatements has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetRuleFileStatements(self):
              
              if not self.__IsKeyword("FILE"):
                  raise Warning("expected FILE At Line ", self.FileName, self.CurrentLineNumber)
              
      Severity: Minor
      Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 1 day 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 __GetRuleFileStatements has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetRuleFileStatements(self):
      
              if not self.__IsKeyword("FILE"):
                  raise Warning("expected FILE", self.FileName, self.CurrentLineNumber)
      
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 1 day 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 CheckDeclTypedefFormat has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
      Open

      def CheckDeclTypedefFormat(FullFileName, ModelId):
          ErrorMsgList = []
      
          FileID = GetTableID(FullFileName, ErrorMsgList)
          if FileID < 0:
      Severity: Minor
      Found in BaseTools/Source/Python/Ecc/c.py - About 1 day 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 pybench.py has 728 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/local/bin/python -O
      
      """ A Python Benchmark Suite
      
      """
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/pybench.py - About 1 day to fix

        Function ParseInfFile has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
        Open

            def ParseInfFile(self, Filename):
                
                Filename = NormPath(Filename)
                (Path, Name) = os.path.split(Filename)
                self.FullPath = Filename
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Parser/InfParser.py - About 1 day 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 goahead has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
        Open

            def goahead(self, end):
                rawdata = self.rawdata
                i = 0
                n = len(rawdata)
                while i < n:
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sgmllib.py - About 1 day 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 goahead has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
        Open

            def goahead(self, end):
                rawdata = self.rawdata
                i = 0
                n = len(rawdata)
                while i < n:
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/sgmllib.py - About 1 day 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

        Consider simplifying this complex logical expression.
        Open

                                if LA65 == 63:
                                    alt65 = 2
                                elif LA65 == 29 or LA65 == 30 or LA65 == 31 or LA65 == 32 or LA65 == 33 or LA65 == 34 or LA65 == 35 or LA65 == 36 or LA65 == 37 or LA65 == 38 or LA65 == 39 or LA65 == 40 or LA65 == 41 or LA65 == 42 or LA65 == 45 or LA65 == 46 or LA65 == 48 or LA65 == 49 or LA65 == 50 or LA65 == 51 or LA65 == 52 or LA65 == 53 or LA65 == 54 or LA65 == 55 or LA65 == 56 or LA65 == 57 or LA65 == 58 or LA65 == 59 or LA65 == 60 or LA65 == 61:
                                    alt65 = 4
                                elif LA65 == IDENTIFIER:
        Severity: Critical
        Found in BaseTools/Source/Python/Ecc/CParser.py - About 1 day to fix

          Consider simplifying this complex logical expression.
          Open

                                  if LA65 == 63:
                                      alt65 = 2
                                  elif LA65 == 29 or LA65 == 30 or LA65 == 31 or LA65 == 32 or LA65 == 33 or LA65 == 34 or LA65 == 35 or LA65 == 36 or LA65 == 37 or LA65 == 38 or LA65 == 39 or LA65 == 40 or LA65 == 41 or LA65 == 42 or LA65 == 45 or LA65 == 46 or LA65 == 48 or LA65 == 49 or LA65 == 50 or LA65 == 51 or LA65 == 52 or LA65 == 53 or LA65 == 54 or LA65 == 55 or LA65 == 56 or LA65 == 57 or LA65 == 58 or LA65 == 59 or LA65 == 60 or LA65 == 61:
                                      alt65 = 4
                                  elif LA65 == IDENTIFIER:
          Severity: Critical
          Found in BaseTools/Source/Python/Eot/CParser.py - About 1 day to fix

            File config.py has 719 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
            #
            # Permission to use, copy, modify, and distribute this software and its
            # documentation for any purpose and without fee is hereby granted,
            # provided that the above copyright notice appear in all copies and that
            Severity: Major
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/config.py - About 1 day to fix

              File config.py has 719 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
              #
              # Permission to use, copy, modify, and distribute this software and its
              # documentation for any purpose and without fee is hereby granted,
              # provided that the above copyright notice appear in all copies and that
              Severity: Major
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/logging/config.py - About 1 day to fix

                HTMLParser has 87 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class HTMLParser(sgmllib.SGMLParser):
                    """This is the basic HTML parser class.
                
                    It supports all entity names required by the XHTML 1.0 Recommendation.
                    It also defines handlers for all HTML 2.0 and many HTML 3.0 and 3.2
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/htmllib.py - About 1 day to fix

                  HTMLParser has 87 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class HTMLParser(sgmllib.SGMLParser):
                      """This is the basic HTML parser class.
                  
                      It supports all entity names required by the XHTML 1.0 Recommendation.
                      It also defines handlers for all HTML 2.0 and many HTML 3.0 and 3.2
                  Severity: Major
                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/htmllib.py - About 1 day to fix
                    Severity
                    Category
                    Status
                    Source
                    Language