hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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 vector-uefi/fd/efi/StdLib/lib/python.27/compiler/symbols.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 vector-uefi/fd/efi/StdLib/lib/python.27/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 _format_action has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def _format_action(self, action):
            # determine the required width and the entry label
            help_position = min(self._action_max_length + 2,
                                self._max_help_position)
            help_width = self._width - help_position
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.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 (time.tzname[0] == time.tzname[1] and
                           time.daylight and found_zone not in ("utc", "gmt")):
                            break
                        else:
                            tz = value
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/_strptime.py - About 45 mins to fix

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

          def _format_action_invocation(self, action):
              if not action.option_strings:
                  metavar, = self._metavar_formatter(action, action.dest)(1)
                  return metavar
      
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.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 os.path.isfile(path):
                              zip.write(path, path)
                              if logger is not None:
                                  logger.info("adding '%s'", path)
                  zip.close()
      Severity: Major
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/shutil.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if isinstance(action.default, basestring):
                                    default = self._get_value(action, default)
                                setattr(namespace, action.dest, default)
        Severity: Major
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.py - About 45 mins to fix

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

              def __init__(self, ws):
                  self.raw  = ws
                  S, T = Whitespace.S, Whitespace.T
                  count = []
                  b = n = nt = 0
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/tabnanny.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 value is None:
                                      continue
                                  elif not isinstance(value, AST):
                                      new_values.extend(value)
                                      continue
          Severity: Major
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/ast.py - About 45 mins to fix

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

                def __init__(self, stream, encode, decode, Reader, Writer,
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/codecs.py - About 45 mins to fix

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

                  def _get_nargs_pattern(self, action):
                      # in all examples below, we have to allow for '--' args
                      # which are represented as '-' in the pattern
                      nargs = action.nargs
              
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.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 main has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def main():
                  global verbose, filename_only
                  try:
                      opts, args = getopt.getopt(sys.argv[1:], "qv")
                  except getopt.error, msg:
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/tabnanny.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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def run(self):
                      """Execute events until the queue is empty.
              
                      When there is a positive delay until the first event, the
                      delay function is called and the event is left in the queue;
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/sched.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 NamedTemporaryFile has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def NamedTemporaryFile(mode='w+b', bufsize=-1, suffix="",
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/tempfile.py - About 45 mins to fix

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

                    def to_integral_exact(self, rounding=None, context=None):
                        """Rounds to a nearby integer.
                
                        If no rounding mode is specified, take the rounding mode from
                        the context.  This method raises the Rounded and Inexact flags
                Severity: Minor
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/decimal.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 set has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def set(self, key, val, coded_val,
                Severity: Minor
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/Cookie.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if "$" in after:
                                          notdone[name] = value
                                      else:
                                          try: value = int(value)
                                          except ValueError:
                  Severity: Major
                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/sysconfig.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        for key in ('LDFLAGS', 'BASECFLAGS',
                                            # a number of derived variables. These need to be
                                            # patched up as well.
                                            'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
                    
                    Severity: Major
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/sysconfig.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if digits or digit != 0:
                                                  digits.append(digit)
                                          else:
                      Severity: Major
                      Found in vector-uefi/fd/efi/StdLib/lib/python.27/decimal.py - About 45 mins to fix

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

                            def __mod__(self, other, context=None):
                                """
                                self % other
                                """
                                other = _convert_other(other)
                        Severity: Minor
                        Found in vector-uefi/fd/efi/StdLib/lib/python.27/decimal.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