hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function readfp has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def readfp(self, fp, strict=True):
        """
        Read a single mime.types-format file.

        If strict is true, information will be added to
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/mimetypes.py - About 1 hr 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 move has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def move(src, dst):
    """Recursively move a file or directory to another location. This is
    similar to the Unix "mv" command.

    If the destination is a directory or a symlink to a directory, the source
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/shutil.py - About 1 hr 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 _add_container_actions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _add_container_actions(self, container):
        # collect groups by titles
        title_group_map = {}
        for group in self._action_groups:
            if group.title in title_group_map:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.py - About 1 hr 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_archive has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
                 dry_run=0, owner=None, group=None, logger=None):
    """Create an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/shutil.py - About 1 hr 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 test has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def test(args = None):
    import sys

    if args is None:
        args = sys.argv[1:]
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/sgmllib.py - About 1 hr 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 _get_tagged_response has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_tagged_response(self, tag):

        while 1:
            result = self.tagged_commands[tag]
            if result is not None:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/imaplib.py - About 1 hr 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 _get_default_tempdir has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def _get_default_tempdir():
    """Calculate the default directory to use for temporary files.
    This routine should be called exactly once.

    We determine whether or not a candidate temp dir is usable by
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/tempfile.py - About 1 hr 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

Method ParseSwitch has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        boolean ParseSwitch(String s)
        {
            if (s.startsWith("d"))
            {
                DictionarySize = 1 << Integer.parseInt(s.substring(1));
Severity: Minor
Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaAlone.java - About 1 hr to fix

    Function ToXml has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def ToXml(self, Module):
            if self.Package:
                pass
            #
            # Create root node of module surface area
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py - About 1 hr to fix

      Function InitDatabase has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def InitDatabase(self, NewDatabase = True):
              EdkLogger.verbose("\nInitialize EOT database started ...")
              #
              # Drop all old existing tables
              #
      Severity: Minor
      Found in BaseTools/Source/Python/Eot/Database.py - About 1 hr to fix

        Function __init__ has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def __init__(self, CommandLineOption=True, IsInit=True, SourceFileList=None, \
                         IncludeDirList=None, DecFileList=None, GuidList=None, LogFile=None,
                         FvFileList="", MapFileList="", Report='Report.html', Dispatch=None):
                # Version and Copyright
                self.VersionNumber = ("0.02" + " " + gBUILD_VERSION)
        Severity: Minor
        Found in BaseTools/Source/Python/Eot/Eot.py - About 1 hr to fix

          Function __init__ has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def __init__(self, master):
                  self.master = master
          
                  self.promptdisplay = Label(self.master, anchor=W,
                          text="Enter a Perl-style regular expression:")
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/redemo.py - About 1 hr to fix

            Function _test has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def _test():
                l = [None, 1, 2L, 3.14, 'xyzzy', (1, 2L), [3.14, 'abc'],
                     {'abc': 'ABC'}, (), [], {}]
                l1 = copy(l)
                print l1==l
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/copy.py - About 1 hr to fix

              Function _test has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def _test():
                  l = [None, 1, 2L, 3.14, 'xyzzy', (1, 2L), [3.14, 'abc'],
                       {'abc': 'ABC'}, (), [], {}]
                  l1 = copy(l)
                  print l1==l
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/copy.py - About 1 hr to fix

                Function GenerateFirmwareImage has 11 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def GenerateFirmwareImage(Output, Input, Type="efi", SubType=None, Zero=False,
                Severity: Major
                Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 1 hr to fix

                  Function Insert has 11 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def Insert(self, CName, TokenSpaceGuidCName, Token, DatumType, Model, BelongsToFile, BelongsToFunction, StartLine, StartColumn, EndLine, EndColumn):
                  Severity: Major
                  Found in BaseTools/Source/Python/Table/TablePcd.py - About 1 hr to fix

                    Function GetStringFiles has 11 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathList, SkipList, BaseName, IsCompatibleMode = False, ShellMode = False, UniGenCFlag = True, UniGenBinBuffer = None, FilterInfo = [True, []]):  
                    Severity: Major
                    Found in BaseTools/Source/Python/AutoGen/StrGather.py - About 1 hr to fix

                      Function Insert has 11 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def Insert(self, Modifier, Type, Name, Value, Model, BelongsToFile, BelongsToFunction, StartLine, StartColumn, EndLine, EndColumn):
                      Severity: Major
                      Found in BaseTools/Source/Python/Table/TableIdentifier.py - About 1 hr to fix

                        Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(self, CommandLineOption=True, IsInit=True, SourceFileList=None, \
                        Severity: Major
                        Found in BaseTools/Source/Python/Eot/Eot.py - About 1 hr to fix

                          Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(self, db, name, x, y, w, h, attr, title, first, default, cancel):
                          Severity: Major
                          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/msi/msilib.py - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language