hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function getargs has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

def getargs(co):
    """Get information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where 'args' is
    a list of argument names (possibly containing nested lists), and
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/inspect.py - About 7 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 _format_usage has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def _format_usage(self, usage, actions, groups, prefix):
        if prefix is None:
            prefix = _('usage: ')

        # if usage is specified, use that
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/argparse.py - About 7 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 run has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self, leaves):
        """The main interface with the bottom matcher. The tree is
        traversed from the bottom using the constructed
        automaton. Nodes are only checked once as the tree is
        retraversed. When the automaton fails, we give it one more
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/btm_matcher.py - About 7 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 add_defaults has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def add_defaults(self):
        """Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/command/sdist.py - About 7 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 getargs has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

def getargs(co):
    """Get information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where 'args' is
    a list of argument names (possibly containing nested lists), and
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/inspect.py - About 7 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 _format_usage has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def _format_usage(self, usage, actions, groups, prefix):
        if prefix is None:
            prefix = _('usage: ')

        # if usage is specified, use that
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.py - About 7 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 Cookie.py has 474 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
#

####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/Cookie.py - About 7 hrs to fix

    File Cookie.py has 474 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    #
    
    ####
    # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/Cookie.py - About 7 hrs to fix

      File bdb.py has 473 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Debugger basics"""
      
      import fnmatch
      import sys
      import os
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/bdb.py - About 7 hrs to fix

        File bdb.py has 473 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """Debugger basics"""
        
        import fnmatch
        import sys
        import os
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/bdb.py - About 7 hrs to fix

          File String.py has 471 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ## @file
          # This file is used to define common string related functions used in parsing 
          # process
          #
          # Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Library/String.py - About 7 hrs to fix

            File ccbench.py has 469 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            # This file should be kept compatible with both Python 2.6 and Python >= 3.0.
            
            from __future__ import division
            from __future__ import print_function
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/ccbench/ccbench.py - About 7 hrs to fix

              Function CycleReferenceCheck has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
              Open

                  def CycleReferenceCheck(self):
                      
                      CycleRefExists = False
                      
                      try:
              Severity: Minor
              Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 7 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 GetComponents has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
              Open

              def GetComponents(Lines, Key, KeyValues, CommentCharacter):
                  if Lines.find(DataType.TAB_SECTION_END) > -1:
                      Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
                  (findBlock, findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, False, False, False, False)
                  ListItem = None
              Severity: Minor
              Found in BaseTools/Source/Python/Common/Parsing.py - About 7 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 ValidateMS2 has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
              Open

              def ValidateMS2(Module, TopXmlTreeLevel):
                  #
                  # Check Header
                  #
                  XmlTreeLevel = TopXmlTreeLevel + ['Header']
              Severity: Minor
              Found in BaseTools/Source/Python/UPT/Xml/XmlParser.py - About 7 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 InstallModuleContent has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
              Open

              def InstallModuleContent(FromPath, NewPath, ModulePath, Module, ContentZipFile,
                  WorkspaceDir, ModuleList, Package = None, ReadOnly = False):
                  
                  if NewPath.startswith("\\") or NewPath.startswith("/"):
                      NewPath = NewPath[1:]
              Severity: Minor
              Found in BaseTools/Source/Python/UPT/InstallPkg.py - About 7 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 GetComponents has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
              Open

              def GetComponents(Lines, KeyValues, CommentCharacter):
                  if Lines.find(DataType.TAB_SECTION_END) > -1:
                      Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
                  (FindBlock, FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
                   FindPcdsPatchableInModule, FindPcdsFixedAtBuild, FindPcdsDynamic, \
              Severity: Minor
              Found in BaseTools/Source/Python/UPT/Library/Parsing.py - About 7 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 struct_or_union_specifier has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
              Open

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

                  def Start(self):
                      NmakeLine = ''
                      Content = ''
                      try:
                          Content = open(str(self.MetaFile), 'r').readlines()
              Severity: Minor
              Found in BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py - About 7 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 struct_or_union_specifier has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
              Open

                  def struct_or_union_specifier(self, ):
              
                      retval = self.struct_or_union_specifier_return()
                      retval.start = self.input.LT(1)
                      struct_or_union_specifier_StartIndex = self.input.index()
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/CParser.py - About 7 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