hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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

def _showwarning(message, category, filename, lineno, file=None, line=None):
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/__init__.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if dstNow != dstAtRollover:
                                if not dstNow:  # DST kicks in before next rollover, so we need to deduct an hour
                                    newRolloverAt = newRolloverAt - 3600
                                else:           # DST bows out before next rollover, so we need to add an hour
                                    newRolloverAt = newRolloverAt + 3600
    Severity: Major
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/handlers.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 AppPkg/Applications/Python/Python-2.7.2/Lib/codecs.py - About 45 mins to fix

        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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 __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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 AppPkg/Applications/Python/Python-2.7.2/Lib/ast.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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 isinstance(action.default, basestring):
                                      default = self._get_value(action, default)
                                  setattr(namespace, action.dest, default)
          Severity: Major
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/argparse.py - About 45 mins to fix

            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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 _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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 AppPkg/Applications/Python/Python-2.7.2/Lib/shutil.py - About 45 mins to fix

              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 AppPkg/Applications/Python/Python-2.7.2/Lib/_strptime.py - About 45 mins to fix

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

                    def set(self, key, val, coded_val,
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/Cookie.py - About 45 mins to fix

                  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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 _getuserbase has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _getuserbase():
                      env_base = os.environ.get("PYTHONUSERBASE", None)
                      def joinuser(*args):
                          return os.path.expanduser(os.path.join(*args))
                  
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sysconfig.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

                                      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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 AppPkg/Applications/Python/Python-2.7.2/Lib/decimal.py - About 45 mins to fix

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

                              def print_log(self):
                                  self._mesg('last %d IMAP4 interactions:' % len(self._cmd_log))
                                  i, n = self._cmd_log_idx, self._cmd_log_len
                                  while n:
                                      try:
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/imaplib.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 AppPkg/Applications/Python/Python-2.7.2/Lib/tempfile.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 AppPkg/Applications/Python/Python-2.7.2/Lib/sysconfig.py - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language