hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Consider simplifying this complex logical expression.
Open

    if (cls is None and encoding is None and object_hook is None and
            parse_int is None and parse_float is None and
            parse_constant is None and object_pairs_hook is None and not kw):
        return _default_decoder.decode(s)
    if cls is None:
Severity: Critical
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/json/__init__.py - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if ((not rfc2965_hdrs and not ns_hdrs) or
                (not ns_hdrs and not rfc2965) or
                (not rfc2965_hdrs and not netscape) or
                (not netscape and not rfc2965)):
                return []  # no relevant cookie headers: quick exit
    Severity: Critical
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/cookielib.py - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

              if ((issubclass(typ, list) and r is list.__repr__) or
                  (issubclass(typ, tuple) and r is tuple.__repr__) or
                  (issubclass(typ, set) and r is set.__repr__) or
                  (issubclass(typ, frozenset) and r is frozenset.__repr__)
                 ):
      Severity: Critical
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/pprint.py - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

            if (cls is None and encoding is None and object_hook is None and
                    parse_int is None and parse_float is None and
                    parse_constant is None and object_pairs_hook is None and not kw):
                return _default_decoder.decode(s)
            if cls is None:
        Severity: Critical
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/json/__init__.py - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                  if ((not rfc2965_hdrs and not ns_hdrs) or
                      (not ns_hdrs and not rfc2965) or
                      (not rfc2965_hdrs and not netscape) or
                      (not netscape and not rfc2965)):
                      return []  # no relevant cookie headers: quick exit
          Severity: Critical
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/cookielib.py - About 1 hr to fix

            Function PrintFragments has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def PrintFragments(self):
                    
                    print '################# ' + self.FileName + '#####################'
                    
                    print '/****************************************/'
            Severity: Minor
            Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py - About 1 hr to fix

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

                  def docmodule(self, object, name=None, mod=None, *ignored):
                      """Produce HTML documentation for a module object."""
                      name = object.__name__ # ignore the passed-in name
                      try:
                          all = object.__all__
              Severity: Minor
              Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py - About 1 hr to fix

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

                    def docmodule(self, object, name=None, mod=None, *ignored):
                        """Produce HTML documentation for a module object."""
                        name = object.__name__ # ignore the passed-in name
                        try:
                            all = object.__all__
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pydoc.py - About 1 hr to fix

                  Function open has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def open(file, mode="r", buffering=-1,
                           encoding=None, errors=None,
                           newline=None, closefd=True):
                  
                      r"""Open file and return a stream.  Raise IOError upon failure.
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/_pyio.py - About 1 hr to fix

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

                        def docmodule(self, object, name=None, mod=None, *ignored):
                            """Produce HTML documentation for a module object."""
                            name = object.__name__ # ignore the passed-in name
                            try:
                                all = object.__all__
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/pydoc.py - About 1 hr to fix

                      Function open has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      def open(file, mode="r", buffering=-1,
                               encoding=None, errors=None,
                               newline=None, closefd=True):
                      
                          r"""Open file and return a stream.  Raise IOError upon failure.
                      Severity: Minor
                      Found in vector-uefi/fd/efi/StdLib/lib/python.27/_pyio.py - About 1 hr to fix

                        Function __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(self, PcdCName, SkuId,PcdOffset, PcdSize, PcdValue, Lineno=None, FileName=None, PcdUnpackValue=None, 
                        Severity: Major
                        Found in BaseTools/Source/Python/BPDG/GenVpd.py - About 1 hr to fix

                          Function ParseConditionalStatement has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def ParseConditionalStatement(self):
                                  #
                                  # Disabled all !if/!elif/!ifdef statements without DEFINE
                                  #
                                  SqlCommand = """select A.StartLine, A.EndLine from %s as A
                          Severity: Minor
                          Found in BaseTools/Source/Python/Common/DscClassObject.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 __UndoToken has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def __UndoToken(self):
                                  self.__UndoOneChar()
                                  while self.__CurrentChar().isspace():
                                      if not self.__UndoOneChar():
                                          self.__GetOneChar()
                          Severity: Minor
                          Found in BaseTools/Source/Python/Common/FdfParserLite.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

                          Method ReadBlock has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public void ReadBlock() throws IOException
                              {
                                  if (_streamEndWasReached)
                                      return;
                                  while (true)
                          Severity: Minor
                          Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZ/InWindow.java - 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 GetTextFileInfo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def GetTextFileInfo(FileName, TagTuple):
                              ValueTuple = [""] * len(TagTuple)
                              try:
                                  for Line in open(FileName):
                                      Line = Line.split("#", 1)[0]
                          Severity: Minor
                          Found in BaseTools/Source/Python/Common/MigrationUtilities.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 __getitem__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def __getitem__(self, key):
                                  KeyType = type(key)
                                  RestKeys = None
                                  if KeyType == self._ListType or KeyType == self._TupleType:
                                      FirstKey = key[0]
                          Severity: Minor
                          Found in BaseTools/Source/Python/Common/Misc.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 __GetFd has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def __GetFd(self):
                          
                                  if not self.__GetNextToken():
                                      return False
                                  
                          Severity: Minor
                          Found in BaseTools/Source/Python/Common/FdfParserLite.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(self, File='', Root='', AlterRoot='', Type='', IsBinary=False,
                          Severity: Major
                          Found in BaseTools/Source/Python/Common/Misc.py - About 1 hr to fix

                            Function __GetGuidAttrib has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def __GetGuidAttrib(self):
                                    
                                    AttribDict = {}
                                    AttribDict["PROCESSING_REQUIRED"] = False
                                    AttribDict["AUTH_STATUS_VALID"] = False
                            Severity: Minor
                            Found in BaseTools/Source/Python/Common/FdfParserLite.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

                            Severity
                            Category
                            Status
                            Source
                            Language