hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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 vector-uefi/fd/efi/StdLib/lib/python.27/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

File shutil.py has 440 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Utility functions for copying and archiving files and directory trees.

XXX The functions here don't copy the resource fork or other metadata on Mac.

"""
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/shutil.py - About 6 hrs to fix

    File shutil.py has 440 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Utility functions for copying and archiving files and directory trees.
    
    XXX The functions here don't copy the resource fork or other metadata on Mac.
    
    """
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/shutil.py - About 6 hrs to fix

      File InfParser.py has 439 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      ## @file
      # This file contained the parser for INF file
      #
      # Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
      #
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Parser/InfParser.py - About 6 hrs to fix

        File rexec.py has 439 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """Restricted execution facilities.
        
        The class RExec exports methods r_exec(), r_eval(), r_execfile(), and
        r_import(), which correspond roughly to the built-in operations
        exec, eval(), execfile() and import, but executing the code in an
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/rexec.py - About 6 hrs to fix

          File tempfile.py has 439 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """Temporary files.
          
          This module provides generic, low- and high-level interfaces for
          creating temporary files and directories.  The interfaces listed
          as "safe" just below can be used without fear of race conditions.
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/tempfile.py - About 6 hrs to fix

            File rexec.py has 439 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """Restricted execution facilities.
            
            The class RExec exports methods r_exec(), r_eval(), r_execfile(), and
            r_import(), which correspond roughly to the built-in operations
            exec, eval(), execfile() and import, but executing the code in an
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/rexec.py - About 6 hrs to fix

              File tempfile.py has 439 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """Temporary files.
              
              This module provides generic, low- and high-level interfaces for
              creating temporary files and directories.  The interfaces listed
              as "safe" just below can be used without fear of race conditions.
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/tempfile.py - About 6 hrs to fix

                File Calls.py has 435 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                from pybench import Test
                
                class PythonFunctionCalls(Test):
                
                    version = 2.0
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Calls.py - About 6 hrs to fix

                  File Strings.py has 435 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  from pybench import Test
                  from string import join
                  
                  class ConcatStrings(Test):
                  
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Strings.py - About 6 hrs to fix

                    Function __GetComponentStatement has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __GetComponentStatement(self, VtfObj):
                            
                            if not self.__IsKeyword("COMP_NAME"):
                                return False
                            
                    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 _ExtractEventHobBootMod has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _ExtractEventHobBootMod(self, FileLinesList):
                            SpecialSectionStart = False
                            CheckLocation = False
                            GFindSpecialCommentRe = \
                            re.compile(r"""#(?:\s*)\[(.*?)\](?:.*)""", re.DOTALL)
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Parser/InfParser.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 GetModuleCodaTargetList has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def GetModuleCodaTargetList(Inf, Arch):
                            BuildRules = GenFdsGlobalVariable.GetBuildRules(Inf, Arch)
                            if not BuildRules:
                                return []
                    
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.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 __GetRegionDataType has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __GetRegionDataType(self, RegionObj):
                    
                            if not self.__IsKeyword( "DATA"):
                                raise Warning("expected Region Data type", self.FileName, self.CurrentLineNumber)
                    
                    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 cast_expression has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def cast_expression(self, ):
                    
                            cast_expression_StartIndex = self.input.index()
                            try:
                                try:
                    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 cast_expression has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def cast_expression(self, ):
                    
                            cast_expression_StartIndex = self.input.index()
                            try:
                                try:
                    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 makerepairinstructions has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def makerepairinstructions(self):
                            """Parse the repair file into repair instructions.
                    
                            The file format is simple:
                            1) use \ to split a long logical line in multiple physical lines
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/bgen/bgen/scantools.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 decode_header has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def decode_header(header):
                        """Decode a message header value without converting charset.
                    
                        Returns a list of (decoded_string, charset) pairs containing each of the
                        decoded parts of the header.  Charset is None for non-encoded parts of the
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/email/header.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 assertSequenceEqual has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None):
                            """An equality assertion for ordered sequences (like lists and tuples).
                    
                            For the purposes of this function, a valid ordered sequence type is one
                            which can be indexed, has a length, and has an equality operator.
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/unittest/case.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 _clone_node has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def _clone_node(node, deep, newOwnerDocument):
                        """
                        Clone a node and give it the new owner document.
                        Called by Node.cloneNode and Document.importNode
                        """
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/minidom.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

                    Severity
                    Category
                    Status
                    Source
                    Language