hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if exp >= 0:
                            numerator *= 10**exp
                        else:
                            denominator *= 10**-exp
                if m.group('sign') == '-':
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/fractions.py - About 45 mins to fix

    Function check_name has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_name(self, name):
            """Return scope of name.
    
            The scope of a name could be LOCAL, GLOBAL, FREE, or CELL.
            """
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compiler/symbols.py - About 45 mins 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 import_module has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def import_module(name, package=None):
        """Import a module.
    
        The 'package' argument is required when performing a relative import. It
        specifies the package to use as the anchor point from which to resolve the
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/importlib/__init__.py - About 45 mins 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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, uri, transport=None, encoding=None, verbose=0,
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xmlrpclib.py - About 45 mins to fix

      Function com_argument has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def com_argument(self, nodelist, kw, star_node):
              if len(nodelist) == 3 and nodelist[2][0] == symbol.comp_for:
                  test = self.com_node(nodelist[1])
                  return 0, self.com_generator_expression(test, nodelist[2])
              if len(nodelist) == 2:
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compiler/transformer.py - About 45 mins 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

      Avoid deeply nested control flow statements.
      Open

                      if len(l) > 1:
                          print "skipping", s.get_name()
                      else:
                          if not list_eq(get_names(s.get_namespace()),
                                         l[0].get_names()):
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compiler/symbols.py - About 45 mins to fix

        Function take_action has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def take_action(self, action, dest, opt, value, values, parser):
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/optparse.py - About 45 mins to fix

          Function translation has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def translation(domain, localedir=None, languages=None,
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/gettext.py - About 45 mins to fix

            Function __dump has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def __dump(self, value, write):
                    try:
                        f = self.dispatch[type(value)]
                    except KeyError:
                        # check if this object can be marshalled as a structure
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xmlrpclib.py - About 45 mins 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_option_group has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def add_option_group(self, *args, **kwargs):
                    # XXX lots of overlap with OptionContainer.add_option()
                    if type(args[0]) is types.StringType:
                        group = OptionGroup(self, *args, **kwargs)
                    elif len(args) == 1 and not kwargs:
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/optparse.py - About 45 mins 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

            Avoid deeply nested control flow statements.
            Open

                                if end < 0: break
                                comment = string.lstrip(string.expandtabs(lines[end]))
            Severity: Major
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/inspect.py - About 45 mins to fix

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

                  def __init__(self, filename, mode='a', maxBytes=0, backupCount=0, encoding=None, delay=0):
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/handlers.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if opname in ('UNPACK_TUPLE', 'UNPACK_SEQUENCE'):
                                        remain.append(value)
                                        count.append(value)
                                    elif opname == 'STORE_FAST':
                                        stack.append(names[value])
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/inspect.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if not self.DIGIT_PATTERN.match(idx):
                                              d = d[idx]
                                          else:
                                              try:
                                                  n = int(idx) # try as number first (most likely)
                  Severity: Major
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/config.py - About 45 mins to fix

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

                        def __init__(self, name, bases, doc, code, decorators = None, lineno=None):
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compiler/ast.py - About 45 mins to fix

                      Function getFilesToDelete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def getFilesToDelete(self):
                              """
                              Determine the files to delete when rolling over.
                      
                              More specific than the earlier method, which just used glob.glob().
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/handlers.py - About 45 mins 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 dump has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def dump(self, io=None):
                              if io:
                                  save = sys.stdout
                                  sys.stdout = io
                              pc = 0
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compiler/pyassem.py - About 45 mins 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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(self, mailhost, fromaddr, toaddrs, subject,
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/handlers.py - About 45 mins to fix

                        Function getMessage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def getMessage(self):
                                """
                                Return the message for this LogRecord.
                        
                                Return the message for this LogRecord after merging any user-supplied
                        Severity: Minor
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/__init__.py - About 45 mins 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 common_logger_config has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def common_logger_config(self, logger, config, incremental=False):
                                """
                                Perform configuration which is common to root and non-root loggers.
                                """
                                level = config.get('level', None)
                        Severity: Minor
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/config.py - About 45 mins 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