hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Logger has 36 functions (exceeds 20 allowed). Consider refactoring.
Open

class Logger:
    """Class for logging to console, text file or XML."""

    def __init__( self ):
        """The Constructor."""
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/logger.py - About 4 hrs to fix

    TarInfo has 36 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/tarfile.py - About 4 hrs to fix

      File helper.py has 358 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/local/bin/python
      #CHIPSEC: Platform Security Assessment Framework
      #Copyright (c) 2010-2014, Intel Corporation
      # 
      #This program is free software; you can redistribute it and/or
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/helper/linux/helper.py - About 4 hrs to fix

        Function __CheckRuleSectionFileType has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def __CheckRuleSectionFileType(self, SectionType, FileType):
                if SectionType == "COMPAT16":
                    if FileType not in ("COMPAT16", "SEC_COMPAT16"):
                        raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
                elif SectionType == "PE32":
        Severity: Minor
        Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 4 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 __GetTokenList has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        def __GetTokenList(Str):
            InQuote = False
            Token = ''
            TokenOP = ''
            PreChar = ''
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Library/String.py - About 4 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 ProcessEdkComment has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        def ProcessEdkComment(LineList):
            FindEdkBlockComment = False
            Count = 0
            StartPos = -1
            EndPos = -1
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Library/Misc.py - About 4 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 _CheckSectionHeaders has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def _CheckSectionHeaders(self, Line, LineNo):
                if len(self.SectionHeaderContent) == 0:
                    Logger.Error("InfParser", 
                                 FORMAT_INVALID,
                                 ST.ERR_INF_PARSER_DEFINE_SECTION_HEADER_INVALID,
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Parser/InfParser.py - About 4 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 GetFileList has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def GetFileList(FfsInf, FileType, FileExtension, Dict = {}):
                if FileType in Section.SectFileType.keys() :
                    IsSect = True
                else :
                    IsSect = False
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/Section.py - About 4 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 __CheckRuleSectionFileType has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def __CheckRuleSectionFileType(self, SectionType, FileType):
                if SectionType == "COMPAT16":
                    if FileType not in ("COMPAT16", "SEC_COMPAT16"):
                        raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
                elif SectionType == "PE32":
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 4 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 PreProcess has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def PreProcess(self, File):
                if not os.path.exists(File.Path) or not os.path.isfile(File.Path):
                    EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND, ExtraData=File.Path)
        
                try:
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/UniClassObject.py - About 4 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 argument_expression_list has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def argument_expression_list(self, ):
        
                retval = self.argument_expression_list_return()
                retval.start = self.input.LT(1)
                argument_expression_list_StartIndex = self.input.index()
        Severity: Minor
        Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 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 argument_expression_list has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def argument_expression_list(self, ):
        
                retval = self.argument_expression_list_return()
                retval.start = self.input.LT(1)
                argument_expression_list_StartIndex = self.input.index()
        Severity: Minor
        Found in BaseTools/Source/Python/Eot/CParser.py - About 4 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 cli has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        def cli():
            """Command-line interface (looks at sys.argv to decide what to do)."""
            import getopt
            class BadUsage: pass
        
        Severity: Minor
        Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py - About 4 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 parse has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def parse(self):
        
                """ Parse the command line and fill in self.values and self.files.
        
                    After having parsed the options, the remaining command line
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/CommandLine.py - About 4 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 _parseForGCC has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        def _parseForGCC(lines, efifilepath):
            """ Parse map file generated by GCC linker """
            status = 0
            imageBase = -1
            sections = []
        Severity: Minor
        Found in BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py - About 4 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 makeconfig has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        def makeconfig(infp, outfp, modules, with_ifdef=0):
            m1 = re.compile('-- ADDMODULE MARKER 1 --')
            m2 = re.compile('-- ADDMODULE MARKER 2 --')
            while 1:
                line = infp.readline()
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/freeze/makeconfig.py - About 4 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 readheaders has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def readheaders(self):
                """Read header lines.
        
                Read header lines up to the entirely blank line that terminates them.
                The (normally blank) line that ends the headers is skipped, but not
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/httplib.py - About 4 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 cli has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        def cli():
            """Command-line interface (looks at sys.argv to decide what to do)."""
            import getopt
            class BadUsage: pass
        
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pydoc.py - About 4 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 parse has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def parse(self, lines):
                """parse the input lines from a robots.txt file.
                   We allow that a user-agent: line is not preceded by
                   one or more blank lines."""
                # states:
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/robotparser.py - About 4 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 disassemble_string has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        def disassemble_string(code, lasti=-1, varnames=None, names=None,
                               constants=None):
            labels = findlabels(code)
            n = len(code)
            i = 0
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/dis.py - About 4 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