hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File cp864.py has 667 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with gencodec.py.

"""#"

import codecs
Severity: Major
Found in vector-uefi/fd/efi/StdLib/lib/python.27/encodings/cp864.py - About 1 day to fix

    Consider simplifying this complex logical expression.
    Open

                        if LA63 == 34 or LA63 == 35 or LA63 == 36 or LA63 == 37 or LA63 == 38 or LA63 == 39 or LA63 == 40 or LA63 == 41 or LA63 == 42 or LA63 == 45 or LA63 == 46 or LA63 == 48 or LA63 == 49 or LA63 == 50 or LA63 == 51 or LA63 == 52 or LA63 == 53 or LA63 == 54 or LA63 == 55 or LA63 == 56 or LA63 == 57 or LA63 == 58 or LA63 == 59 or LA63 == 60 or LA63 == 61:
                            alt63 = 1
                        elif LA63 == IDENTIFIER:
                            LA63_25 = self.input.LA(3)
    
    Severity: Critical
    Found in BaseTools/Source/Python/Ecc/CParser.py - About 1 day to fix

      Consider simplifying this complex logical expression.
      Open

                          if LA63 == 34 or LA63 == 35 or LA63 == 36 or LA63 == 37 or LA63 == 38 or LA63 == 39 or LA63 == 40 or LA63 == 41 or LA63 == 42 or LA63 == 45 or LA63 == 46 or LA63 == 48 or LA63 == 49 or LA63 == 50 or LA63 == 51 or LA63 == 52 or LA63 == 53 or LA63 == 54 or LA63 == 55 or LA63 == 56 or LA63 == 57 or LA63 == 58 or LA63 == 59 or LA63 == 60 or LA63 == 61:
                              alt63 = 1
                          elif LA63 == IDENTIFIER:
                              LA63_25 = self.input.LA(3)
      
      Severity: Critical
      Found in BaseTools/Source/Python/Eot/CParser.py - About 1 day to fix

        File cp869.py has 666 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py.
        
        """#"
        
        import codecs
        Severity: Major
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/encodings/cp869.py - About 1 day to fix

          File cp869.py has 666 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py.
          
          """#"
          
          import codecs
          Severity: Major
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/encodings/cp869.py - About 1 day to fix

            Function SetBinary has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
            Open

                def SetBinary(self, UiInf=None, Ver=None, CommonBinary=None, ArchList=None):
            
                    __SupArchList = []
                    for ArchItem in ArchList:
                        #
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.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 _strptime has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
            Open

            def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
                """Return a time struct based on the input string and the format string."""
                global _TimeRE_cache, _regex_cache
                with _cache_lock:
                    if _getlang() != _TimeRE_cache.locale_time.lang:
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/_strptime.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 _strptime has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
            Open

            def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
                """Return a time struct based on the input string and the format string."""
                global _TimeRE_cache, _regex_cache
                with _cache_lock:
                    if _getlang() != _TimeRE_cache.locale_time.lang:
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/_strptime.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 Exceptions.py has 658 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            from pybench import Test
            
            class TryRaiseExcept(Test):
            
                version = 2.0
            Severity: Major
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Exceptions.py - About 1 day to fix

              Function GenPlatformDatabase has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
              Open

                  def GenPlatformDatabase(self, PcdsSet={}):
                      for Dsc in self.DscDatabase.keys():
                          Platform = self.DscDatabase[Dsc].Platform
                          for Arch in self.SupArchList:
                              Pb = PlatformBuildClassObject()
              Severity: Minor
              Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.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 readline has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
              Open

                  def readline(self, size=-1):
                      buf = self._rbuf
                      buf.seek(0, 2)  # seek end
                      if buf.tell() > 0:
                          # check if we already have it in our buffer
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/socket.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 readline has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
              Open

                  def readline(self, size=-1):
                      buf = self._rbuf
                      buf.seek(0, 2)  # seek end
                      if buf.tell() > 0:
                          # check if we already have it in our buffer
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/socket.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 smtplib.py has 646 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              #! /usr/bin/env python
              
              '''SMTP/ESMTP client class.
              
              This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
              Severity: Major
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/smtplib.py - About 1 day to fix

                File smtplib.py has 646 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                #! /usr/bin/env python
                
                '''SMTP/ESMTP client class.
                
                This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
                Severity: Major
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/smtplib.py - About 1 day to fix

                  Function refactor_tree has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def refactor_tree(self, tree, name):
                          """Refactors a parse tree (modifying the tree in place).
                  
                          For compatible patterns the bottom matcher module is
                          used. Otherwise the tree is traversed node-to-node for
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/refactor.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 refactor_tree has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def refactor_tree(self, tree, name):
                          """Refactors a parse tree (modifying the tree in place).
                  
                          For compatible patterns the bottom matcher module is
                          used. Otherwise the tree is traversed node-to-node for
                  Severity: Minor
                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/refactor.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 Numbers.py has 637 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  from pybench import Test
                  
                  class CompareIntegers(Test):
                  
                      version = 2.0
                  Severity: Major
                  Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Numbers.py - About 1 day to fix

                    Function prepare_predicate has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def prepare_predicate(next, token):
                        # FIXME: replace with real parser!!! refs:
                        # http://effbot.org/zone/simple-iterator-parser.htm
                        # http://javascript.crockford.com/tdop/tdop.html
                        signature = []
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/etree/ElementPath.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 prepare_predicate has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def prepare_predicate(next, token):
                        # FIXME: replace with real parser!!! refs:
                        # http://effbot.org/zone/simple-iterator-parser.htm
                        # http://javascript.crockford.com/tdop/tdop.html
                        signature = []
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/etree/ElementPath.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 InfClassObject.py has 632 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    ## @file
                    # This file is used to define each component of INF file
                    #
                    # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
                    # This program and the accompanying materials
                    Severity: Major
                    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language