hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function close has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    def close(self):
        """Close the file, and for mode "w" and "a" write the ending
        records."""
        if self.fp is None:
            return
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/zipfile.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 computeRollover has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    def computeRollover(self, currentTime):
        """
        Work out the rollover time based on the specified time.
        """
        result = currentTime + self.interval
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/logging/handlers.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 findsource has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

def findsource(object):
    """Return the entire source file and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of all the lines
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/inspect.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 _make_zipfile has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
    """Create a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/shutil.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

File LzmaBench.java has 349 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package SevenZip;

import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
Severity: Minor
Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.java - About 4 hrs to fix

    File DecParserUnitTest.py has 348 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    ## @file
    # This file contain unit test for DecParser
    #
    # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
    #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py - About 4 hrs to fix

      Checker has 34 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Checker:
      
          checkext = CHECKEXT
          verbose = VERBOSE
          maxpage = MAXPAGE

        RExec has 34 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class RExec(ihooks._Verbose):
            """Basic restricted execution framework.
        
            Code executed in this restricted environment will only have access to
            modules and functions that are deemed safe; you can subclass RExec to
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/rexec.py - About 4 hrs to fix

          Aifc_write has 34 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Aifc_write:
              # Variables used in this class:
              #
              # These variables are user settable through appropriate methods
              # of this class:
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/aifc.py - About 4 hrs to fix

            Fraction has 34 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Fraction(Rational):
                """This class implements rational numbers.
            
                In the two-argument form of the constructor, Fraction(8, 6) will
                produce a rational number equivalent to 4/3. Both arguments must
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/fractions.py - About 4 hrs to fix

              OsHelper has 34 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class OsHelper:
                  def __init__(self):
                      self.helper = None
                      self.loadHelpers()
                      #print "Operating System: %s %s %s %s" % (self.os_system, self.os_release, self.os_version, self.os_machine)
              Severity: Minor
              Found in vector-uefi/fd/tool/chipsec/helper/oshelper.py - About 4 hrs to fix

                RExec has 34 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class RExec(ihooks._Verbose):
                    """Basic restricted execution framework.
                
                    Code executed in this restricted environment will only have access to
                    modules and functions that are deemed safe; you can subclass RExec to
                Severity: Minor
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/rexec.py - About 4 hrs to fix

                  Aifc_write has 34 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Aifc_write:
                      # Variables used in this class:
                      #
                      # These variables are user settable through appropriate methods
                      # of this class:
                  Severity: Minor
                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/aifc.py - About 4 hrs to fix

                    Fraction has 34 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Fraction(Rational):
                        """This class implements rational numbers.
                    
                        In the two-argument form of the constructor, Fraction(8, 6) will
                        produce a rational number equivalent to 4/3. Both arguments must
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/fractions.py - About 4 hrs to fix

                      File ParserValidate.py has 347 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      ## @file ParserValidate.py
                      #
                      # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
                      #
                      # This program and the accompanying materials are licensed and made available 
                      Severity: Minor
                      Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py - About 4 hrs to fix

                        File ntpath.py has 346 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
                        """Common pathname manipulations, WindowsNT/95 version.
                        
                        Instead of importing this module directly, import os and refer to this
                        module as os.path.
                        Severity: Minor
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/ntpath.py - About 4 hrs to fix

                          File cmd.py has 346 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          """A generic class to build line-oriented command interpreters.
                          
                          Interpreters constructed with this class obey the following conventions:
                          
                          1. End of file on input is processed as the command 'EOF'.
                          Severity: Minor
                          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/cmd.py - About 4 hrs to fix

                            File xmlout.py has 346 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/xmlout.py - About 4 hrs to fix

                              File cmd.py has 346 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              """A generic class to build line-oriented command interpreters.
                              
                              Interpreters constructed with this class obey the following conventions:
                              
                              1. End of file on input is processed as the command 'EOF'.
                              Severity: Minor
                              Found in vector-uefi/fd/efi/StdLib/lib/python.27/cmd.py - About 4 hrs to fix

                                Function Instantiate has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        def Instantiate(self, PlaceHolderValues):
                                            RepeatTime = -1
                                            RepeatPlaceHolders = {}
                                            NonRepeatPlaceHolders = {}
                                
                                Severity: Minor
                                Found in BaseTools/Source/Python/Common/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

                                Severity
                                Category
                                Status
                                Source
                                Language