hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File expatbuilder.py has 785 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Facility to use the Expat parser to load a minidom instance
from a string or file.

This avoids all the overhead of SAX and pulldom to gain performance.
"""
Severity: Major
Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/dom/expatbuilder.py - About 1 day to fix

    Function FindPcd has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
    Open

        def FindPcd(self, Arch, ModuleName, Name, Guid, Type):
            NewType = ''
            DatumType = ''
            Value = ''
            Token = ''
    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 _compile has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
    Open

    def _compile(code, pattern, flags):
        # internal: compile a (sub)pattern
        emit = code.append
        _len = len
        LITERAL_CODES = _LITERAL_CODES
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sre_compile.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 _compile has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
    Open

    def _compile(code, pattern, flags):
        # internal: compile a (sub)pattern
        emit = code.append
        _len = len
        LITERAL_CODES = _LITERAL_CODES
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/sre_compile.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 GetFinalTargetSuffixMap has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetFinalTargetSuffixMap(self):
            if not self.InfModule or not self.CurrentArch:
                return []
            if not self.FinalTargetSuffixMap:
                FinalBuildTargetList = GenFdsGlobalVariable.GetModuleCodaTargetList(self.InfModule, self.CurrentArch)
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/FfsInfStatement.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 parse_template has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_template(source, pattern):
        # parse 're' replacement string into list of literals and
        # group references
        s = Tokenizer(source)
        sget = s.get
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sre_parse.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 parse_template has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_template(source, pattern):
        # parse 're' replacement string into list of literals and
        # group references
        s = Tokenizer(source)
        sget = s.get
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/sre_parse.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 GetIdentifierList has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetIdentifierList():
        IdList = []
        for comment in FileProfile.CommentList:
            IdComment = DataClass.IdentifierClass(-1, '', '', '', comment.Content, DataClass.MODEL_IDENTIFIER_COMMENT, -1, -1, comment.StartPos[0], comment.StartPos[1], comment.EndPos[0], comment.EndPos[1])
            IdList.append(IdComment)
    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 aifc.py has 767 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Stuff to parse AIFF-C and AIFF files.
    
    Unless explicitly stated otherwise, the description below is true
    both for AIFF-C files and AIFF files.
    
    Severity: Major
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/aifc.py - About 1 day to fix

      File aifc.py has 767 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Stuff to parse AIFF-C and AIFF files.
      
      Unless explicitly stated otherwise, the description below is true
      both for AIFF-C files and AIFF files.
      
      Severity: Major
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/aifc.py - About 1 day to fix

        Consider simplifying this complex logical expression.
        Open

                            if LA90 == 25 or LA90 == 29 or LA90 == 30 or LA90 == 31 or LA90 == 32 or LA90 == 33 or LA90 == 34 or LA90 == 35 or LA90 == 36 or LA90 == 37 or LA90 == 38 or LA90 == 39 or LA90 == 40 or LA90 == 41 or LA90 == 42 or LA90 == 45 or LA90 == 46 or LA90 == 47 or LA90 == 48 or LA90 == 49 or LA90 == 50 or LA90 == 51 or LA90 == 52 or LA90 == 53 or LA90 == 54 or LA90 == 55 or LA90 == 56 or LA90 == 57 or LA90 == 58 or LA90 == 59 or LA90 == 60 or LA90 == 61:
                                alt90 = 1
                            elif LA90 == 62:
                                LA90_45 = 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 LA95 == 62:
                                      LA95_46 = self.input.LA(3)
          
                                      if (self.synpred188()) :
                                          alt95 = 1
          Severity: Critical
          Found in BaseTools/Source/Python/Ecc/CParser.py - About 1 day to fix

            Consider simplifying this complex logical expression.
            Open

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

              Consider simplifying this complex logical expression.
              Open

                                  if LA90 == 25 or LA90 == 29 or LA90 == 30 or LA90 == 31 or LA90 == 32 or LA90 == 33 or LA90 == 34 or LA90 == 35 or LA90 == 36 or LA90 == 37 or LA90 == 38 or LA90 == 39 or LA90 == 40 or LA90 == 41 or LA90 == 42 or LA90 == 45 or LA90 == 46 or LA90 == 47 or LA90 == 48 or LA90 == 49 or LA90 == 50 or LA90 == 51 or LA90 == 52 or LA90 == 53 or LA90 == 54 or LA90 == 55 or LA90 == 56 or LA90 == 57 or LA90 == 58 or LA90 == 59 or LA90 == 60 or LA90 == 61:
                                      alt90 = 1
                                  elif LA90 == 62:
                                      LA90_45 = self.input.LA(3)
              
              Severity: Critical
              Found in BaseTools/Source/Python/Eot/CParser.py - About 1 day to fix

                File scantools.py has 763 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                """\
                
                Tools for scanning header files in search of function prototypes.
                
                Often, the function prototypes in header files contain enough information
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Tools/bgen/bgen/scantools.py - About 1 day to fix

                  Function CheckFunctionHeaderConsistentWithDoxygenComment has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHeader, FuncStartLine, CommentStr, CommentStartLine, ErrorMsgList, CommentId= -1, TableName=''):
                  
                      ParamList = GetParamList(FuncHeader)
                      CheckGeneralDoxygenCommentLayout(CommentStr, CommentStartLine, ErrorMsgList, CommentId, TableName)
                      DescriptionStr = CommentStr
                  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

                  FdfParser has 93 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class FdfParser(object):
                      ## The constructor
                      #
                      #   @param  self        The object pointer
                      #   @param  FileName    The file that to be parsed
                  Severity: Major
                  Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 1 day to fix

                    File Check.py has 754 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    ## @file
                    # This file is used to define checkpoints used by ECC tool
                    #
                    # Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
                    # This program and the accompanying materials
                    Severity: Major
                    Found in BaseTools/Source/Python/Ecc/Check.py - About 1 day to fix

                      File codecs.py has 754 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """ codecs -- Python Codec Registry, API and helpers.
                      
                      
                      Written by Marc-Andre Lemburg (mal@lemburg.com).
                      
                      Severity: Major
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/codecs.py - About 1 day to fix

                        File codecs.py has 754 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        """ codecs -- Python Codec Registry, API and helpers.
                        
                        
                        Written by Marc-Andre Lemburg (mal@lemburg.com).
                        
                        Severity: Major
                        Found in vector-uefi/fd/efi/StdLib/lib/python.27/codecs.py - About 1 day to fix
                          Severity
                          Category
                          Status
                          Source
                          Language