hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File socket.py has 444 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Wrapper module for _socket, providing some additional facilities
# implemented in Python.

"""\
This module provides socket operations and some related functions.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/socket.py - About 6 hrs to fix

    File ihooks.py has 443 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Import hook support.
    
    Consistent use of this module will make it possible to change the
    different mechanisms involved in loading modules independently.
    
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/ihooks.py - About 6 hrs to fix

      File ihooks.py has 443 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Import hook support.
      
      Consistent use of this module will make it possible to change the
      different mechanisms involved in loading modules independently.
      
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/ihooks.py - About 6 hrs to fix

        Method Parse has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

                public boolean Parse(String[] args) throws Exception
                {
                    int pos = 0;
                    boolean switchMode = true;
                    for (int i = 0; i < args.length; i++)
        Severity: Minor
        Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaAlone.java - About 6 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 PreprocessIncludeFile has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

            def PreprocessIncludeFile(self):
                
                while self.__GetNextToken():
                    
                    if self.__Token == '!include':
        Severity: Minor
        Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 6 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 PreprocessIncludeFile has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

            def PreprocessIncludeFile(self):
        
                while self.__GetNextToken():
        
                    if self.__Token == '!include':
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 6 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 _CheckAllPcdsTokenValueConflict has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

            def _CheckAllPcdsTokenValueConflict(self):
                for Pa in self.AutoGenObjectList:
                    for Package in Pa.PackageList:
                        PcdList = Package.Pcds.values()
                        PcdList.sort(lambda x, y: cmp(x.TokenValue, y.TokenValue)) 
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 6 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 CreateLibraryPcdCode has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

        def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
            PcdTokenNumber = Info.PlatformInfo.PcdTokenNumber
            TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName
            TokenCName  = Pcd.TokenCName
            PcdTokenName = '_PCD_TOKEN_' + TokenCName
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/GenC.py - About 6 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 CheckFuncLayoutName has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

        def CheckFuncLayoutName(FullFileName):
            ErrorMsgList = []
            # Parameter variable format pattern.
            Pattern = re.compile(r'^[A-Z]+\S*[a-z]\S*$')
            ParamIgnoreList = ('VOID', '...')
        Severity: Minor
        Found in BaseTools/Source/Python/Ecc/c.py - About 6 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 selection_statement has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

            def selection_statement(self, ):
        
                selection_statement_StartIndex = self.input.index()
                e = None
        
        Severity: Minor
        Found in BaseTools/Source/Python/Ecc/CParser.py - About 6 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 selection_statement has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

            def selection_statement(self, ):
        
                selection_statement_StartIndex = self.input.index()
                e = None
        
        Severity: Minor
        Found in BaseTools/Source/Python/Eot/CParser.py - About 6 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 main has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

        def main(args):
            try:
                opts, args = getopt.getopt(args, "hbrdag",
                                           ["hash", "btree", "recno", "dbm", "anydbm",
                                            "gdbm"])
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/pickle2db.py - About 6 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 process has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

        def process(fp, outfp, env = {}):
            lineno = 0
            while 1:
                line = fp.readline()
                if not line: break
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/h2py.py - About 6 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 main has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

        def main(args=None):
            """Main program, used when run as a script.
        
            The optional argument specifies the command line to be parsed,
            defaulting to sys.argv[1:].
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/timeit.py - About 6 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 _guess_delimiter has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

            def _guess_delimiter(self, data, delimiters):
                """
                The delimiter /should/ occur the same number of times on
                each row. However, due to malformed data, it may not. We don't want
                an all or nothing approach, so we allow for small variations in this
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/csv.py - About 6 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 copy_scripts has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

            def copy_scripts (self):
                """Copy each script listed in 'self.scripts'; if it's marked as a
                Python script in the Unix way (first line matches 'first_line_re',
                ie. starts with "\#!" and contains "python"), then adjust the first
                line to refer to the current Python interpreter as we copy.

        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 process_template_line has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

            def process_template_line(self, line):
                # Parse the line: split it up, make sure the right number of words
                # is there, and return the relevant words.  'action' is always
                # defined: it's the first word of the line.  Which of the other
                # three are defined depends on the action; it'll be either
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/filelist.py - About 6 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 main has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

        def main(args=None):
            """Main program, used when run as a script.
        
            The optional argument specifies the command line to be parsed,
            defaulting to sys.argv[1:].
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/timeit.py - About 6 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 _guess_delimiter has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

            def _guess_delimiter(self, data, delimiters):
                """
                The delimiter /should/ occur the same number of times on
                each row. However, due to malformed data, it may not. We don't want
                an all or nothing approach, so we allow for small variations in this
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/csv.py - About 6 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 copy_scripts has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

            def copy_scripts (self):
                """Copy each script listed in 'self.scripts'; if it's marked as a
                Python script in the Unix way (first line matches 'first_line_re',
                ie. starts with "\#!" and contains "python"), then adjust the first
                line to refer to the current Python interpreter as we copy.

        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