hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File decoder.py has 314 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Implementation of JSONDecoder
"""
import re
import sys
import struct
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/json/decoder.py - About 3 hrs to fix

    File handlers.py has 314 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Base classes for server/gateway implementations"""
    
    from types import StringType
    from util import FileWrapper, guess_scheme, is_hop_by_hop
    from headers import Headers
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/wsgiref/handlers.py - About 3 hrs to fix

      File decoder.py has 314 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Implementation of JSONDecoder
      """
      import re
      import sys
      import struct
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/json/decoder.py - About 3 hrs to fix

        File PcdXml.py has 313 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        ## @file
        # This file is used to parse a PCD file of .PKG file
        #
        # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
        #
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Xml/PcdXml.py - About 3 hrs to fix

          File ExpressionValidate.py has 313 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ## @file
          # This file is used to check PCD logical expression
          #
          # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
          #
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Library/ExpressionValidate.py - About 3 hrs to fix

            InfPcdItem has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class InfPcdItem():
                def __init__(self):
                    self.CName = ''
                    self.Token = ''
                    self.TokenSpaceGuidCName = ''
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 3 hrs to fix

              PackageObject has 29 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class PackageObject(IdentificationObject, CommonHeaderObject):
                  def __init__(self):
                      IdentificationObject.__init__(self)
                      CommonHeaderObject.__init__(self)
                      #
              Severity: Minor
              Found in BaseTools/Source/Python/UPT/Object/POM/PackageObject.py - About 3 hrs to fix

                BitVec has 29 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class BitVec:
                
                    def __init__(self, *params):
                        self._data = 0L
                        self._len = 0
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Demo/classes/bitvec.py - About 3 hrs to fix

                  ArgumentParser has 29 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class ArgumentParser(_AttributeHolder, _ActionsContainer):
                      """Object for parsing command line strings into Python objects.
                  
                      Keyword Arguments:
                          - prog -- The name of the program (default: sys.argv[0])
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/argparse.py - About 3 hrs to fix

                    GenericParser has 29 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class GenericParser:
                        #
                        #  An Earley parser, as per J. Earley, "An Efficient Context-Free
                        #  Parsing Algorithm", CACM 13(2), pp. 94-102.  Also J. C. Earley,
                        #  "An Efficient Context-Free Parsing Algorithm", Ph.D. thesis,
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Parser/spark.py - About 3 hrs to fix

                      ArgumentParser has 29 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class ArgumentParser(_AttributeHolder, _ActionsContainer):
                          """Object for parsing command line strings into Python objects.
                      
                          Keyword Arguments:
                              - prog -- The name of the program (default: sys.argv[0])
                      Severity: Minor
                      Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.py - About 3 hrs to fix

                        Function GenComponent has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def GenComponent(self, Item, ContainerFile, LineNo= -1):
                                (InfFilename, ExecFilename) = GetExec(Item[0])
                                LibraryClasses = Item[1]
                                BuildOptions = Item[2]
                                Pcds = Item[3]
                        Severity: Minor
                        Found in BaseTools/Source/Python/Common/DscClassObject.py - About 3 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 GenPcds has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def GenPcds(self, Type='', ContainerFile=''):
                                Pcds = {}
                                if Type == DataType.TAB_PCDS_PATCHABLE_IN_MODULE:
                                    Model = MODEL_PCD_PATCHABLE_IN_MODULE
                                elif Type == DataType.TAB_PCDS_FIXED_AT_BUILD:
                        Severity: Minor
                        Found in BaseTools/Source/Python/Common/DscClassObject.py - About 3 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 __GetFileOpts has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def __GetFileOpts(self, FfsFileObj):
                                
                                if self.__GetNextToken():
                                    Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
                                    if Pattern.match(self.__Token):
                        Severity: Minor
                        Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 3 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 CleanString has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def CleanString(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyleComment=False, BuildOption=False):
                            #
                            # remove whitespace
                            #
                            Line = Line.strip();
                        Severity: Minor
                        Found in BaseTools/Source/Python/Common/String.py - About 3 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 ConvertDictionaryToTextFile has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def ConvertDictionaryToTextFile(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
                            try:
                                F = open(FileName,'r')
                                Lines = []
                                Lines = F.readlines()
                        Severity: Minor
                        Found in BaseTools/Source/Python/Common/EdkIIWorkspace.py - About 3 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 FromXml has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def FromXml(self, Item, Key, IsStandAlongModule=False):
                                IsBinaryModule = XmlAttribute(Item, 'BinaryModule')
                                #
                                # Header
                                #
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py - About 3 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 ParseDecPcdGenericComment has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def ParseDecPcdGenericComment (GenericComment, ContainerFile):       
                            HelpStr = '' 
                            PcdErr = None
                                
                            for (CommentLine, LineNum) in GenericComment:
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/CommentParsing.py - About 3 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 InfAsBuiltLibraryParser has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def InfAsBuiltLibraryParser(self, SectionString, InfSectionObject, FileName):
                                LibraryList = []
                                LibInsFlag = False
                                for Line in SectionString:
                                    LineContent = Line[0]
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py - About 3 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 _SectionHeaderParser has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _SectionHeaderParser(self):
                                self._Scope = []
                                self._SectionName = ''
                                ArchList = set()
                                for Item in GetSplitValueList(self._CurrentLine[1:-1], TAB_COMMA_SPLIT):
                        Severity: Minor
                        Found in BaseTools/Source/Python/Workspace/MetaFileParser.py - About 3 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