rethinkdb/rethinkdb-python

View on GitHub

Showing 188 of 188 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    try:
        if not options.quiet:
            # Print a warning about the capabilities of dump, so no one is confused (hopefully)
            print(
                """\
Severity: Minor
Found in rethinkdb/_dump.py and 1 other location - About 45 mins to fix
rethinkdb/_export.py on lines 663..669

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 35.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        if "epoch_time" not in obj:
            raise ReqlDriverError(
                (
                    "pseudo-type TIME object %s does not "
                    + 'have expected field "epoch_time".'
Severity: Major
Found in rethinkdb/ast.py and 2 other locations - About 45 mins to fix
rethinkdb/ast.py on lines 816..822
rethinkdb/ast.py on lines 828..834

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 35.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

        if not os.path.exists(options.directory):
            parser.error("-d/--directory does not exist: %s" % options.directory)
Severity: Major
Found in rethinkdb/_import.py and 7 other locations - About 45 mins to fix
rethinkdb/_dump.py on lines 160..163
rethinkdb/_import.py on lines 940..941
rethinkdb/_import.py on lines 967..968
rethinkdb/_import.py on lines 978..979
rethinkdb/_import.py on lines 980..981
rethinkdb/_restore.py on lines 172..173
rethinkdb/_restore.py on lines 178..181

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 35.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Avoid deeply nested control flow statements.
Open

                    if _dnsname_match(value, hostname):
                        return
                    dnsnames.append(value)
Severity: Major
Found in rethinkdb/backports/ssl_match_hostname/__init__.py - About 45 mins to fix

    Similar blocks of code found in 8 locations. Consider refactoring.
    Open

            if not os.path.isdir(options.directory):
                parser.error("Directory to import does not exist: %s" % options.directory)
    Severity: Major
    Found in rethinkdb/_import.py and 7 other locations - About 45 mins to fix
    rethinkdb/_dump.py on lines 160..163
    rethinkdb/_import.py on lines 938..939
    rethinkdb/_import.py on lines 940..941
    rethinkdb/_import.py on lines 978..979
    rethinkdb/_import.py on lines 980..981
    rethinkdb/_restore.py on lines 172..173
    rethinkdb/_restore.py on lines 178..181

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 35.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Avoid deeply nested control flow statements.
    Open

                            if str == unicode:
                                info.append(json.dumps(row[field]))
                            else:
                                info.append(json.dumps(row[field]).encode("utf-8"))
                    out_writer.writerow(info)
    Severity: Major
    Found in rethinkdb/_export.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if ext not in [".json", ".csv", ".info"]:
                              files_ignored.append(os.path.join(root, filename))
                          elif ext == ".info":
                              pass  # Info files are included based on the data files
                          elif not os.path.exists(os.path.join(root, table + ".info")):
      Severity: Major
      Found in rethinkdb/_import.py - About 45 mins to fix

        Similar blocks of code found in 8 locations. Consider refactoring.
        Open

                if not os.path.isdir(options.temp_dir):
                    parser.error(
                        "Temporary directory doesn't exist or is not a directory: %s"
                        % options.temp_dir
        Severity: Major
        Found in rethinkdb/_dump.py and 7 other locations - About 45 mins to fix
        rethinkdb/_import.py on lines 938..939
        rethinkdb/_import.py on lines 940..941
        rethinkdb/_import.py on lines 967..968
        rethinkdb/_import.py on lines 978..979
        rethinkdb/_import.py on lines 980..981
        rethinkdb/_restore.py on lines 172..173
        rethinkdb/_restore.py on lines 178..181

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 35.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 8 locations. Consider refactoring.
        Open

                if not os.path.isdir(options.directory):
                    parser.error("-d/--directory is not a directory: %s" % options.directory)
        Severity: Major
        Found in rethinkdb/_import.py and 7 other locations - About 45 mins to fix
        rethinkdb/_dump.py on lines 160..163
        rethinkdb/_import.py on lines 938..939
        rethinkdb/_import.py on lines 967..968
        rethinkdb/_import.py on lines 978..979
        rethinkdb/_import.py on lines 980..981
        rethinkdb/_restore.py on lines 172..173
        rethinkdb/_restore.py on lines 178..181

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 35.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 8 locations. Consider refactoring.
        Open

                if not os.path.isdir(options.temp_dir):
                    parser.error(
                        "Temporary directory doesn't exist or is not a directory: %s"
                        % options.temp_dir
        Severity: Major
        Found in rethinkdb/_restore.py and 7 other locations - About 45 mins to fix
        rethinkdb/_dump.py on lines 160..163
        rethinkdb/_import.py on lines 938..939
        rethinkdb/_import.py on lines 940..941
        rethinkdb/_import.py on lines 967..968
        rethinkdb/_import.py on lines 978..979
        rethinkdb/_import.py on lines 980..981
        rethinkdb/_restore.py on lines 172..173

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 35.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 8 locations. Consider refactoring.
        Open

                if not os.path.isfile(options.file):
                    parser.error("-f/--file is not a file: %s" % options.file)
        Severity: Major
        Found in rethinkdb/_import.py and 7 other locations - About 45 mins to fix
        rethinkdb/_dump.py on lines 160..163
        rethinkdb/_import.py on lines 938..939
        rethinkdb/_import.py on lines 940..941
        rethinkdb/_import.py on lines 967..968
        rethinkdb/_import.py on lines 978..979
        rethinkdb/_restore.py on lines 172..173
        rethinkdb/_restore.py on lines 178..181

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 35.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Avoid deeply nested control flow statements.
        Open

                                if item not in fields:
                                    del row[item]
                        if first:
        Severity: Major
        Found in rethinkdb/_export.py - About 45 mins to fix

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  if val_str.endswith("'...']"):
                      val_str = val_str[: -len("'...']")] + "...]"
          Severity: Minor
          Found in rethinkdb/net.py and 1 other location - About 45 mins to fix
          rethinkdb/net.py on lines 254..255

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 35.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 8 locations. Consider refactoring.
          Open

                  if not os.path.isfile(options.in_file):
                      parser.error("Archive file does not exist: %s" % options.in_file)
          Severity: Major
          Found in rethinkdb/_restore.py and 7 other locations - About 45 mins to fix
          rethinkdb/_dump.py on lines 160..163
          rethinkdb/_import.py on lines 938..939
          rethinkdb/_import.py on lines 940..941
          rethinkdb/_import.py on lines 967..968
          rethinkdb/_import.py on lines 978..979
          rethinkdb/_import.py on lines 980..981
          rethinkdb/_restore.py on lines 178..181

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 35.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 8 locations. Consider refactoring.
          Open

                  if not os.path.exists(options.file):
                      parser.error("-f/--file does not exist: %s" % options.file)
          Severity: Major
          Found in rethinkdb/_import.py and 7 other locations - About 45 mins to fix
          rethinkdb/_dump.py on lines 160..163
          rethinkdb/_import.py on lines 938..939
          rethinkdb/_import.py on lines 940..941
          rethinkdb/_import.py on lines 967..968
          rethinkdb/_import.py on lines 980..981
          rethinkdb/_restore.py on lines 172..173
          rethinkdb/_restore.py on lines 178..181

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 35.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      if "custom_header" in kwargs["source_options"]:
                          self.custom_header = kwargs["source_options"]["custom_header"]
          Severity: Minor
          Found in rethinkdb/_import.py and 1 other location - About 45 mins to fix
          rethinkdb/_import.py on lines 648..649

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 35.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              @gen.coroutine
              def _continue(self, cursor):
                  res = yield ConnectionBase._continue(self, cursor)
                  raise gen.Return(res)
          Severity: Minor
          Found in rethinkdb/tornado_net/net_tornado.py and 1 other location - About 40 mins to fix
          rethinkdb/tornado_net/net_tornado.py on lines 324..327

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 34.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  if host is not None and port is not None:
                      msg = "Could not connect to {}:{}, {}".format(host, port, msg)
          Severity: Minor
          Found in rethinkdb/errors.py and 1 other location - About 40 mins to fix
          rethinkdb/errors.py on lines 194..195

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 34.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              @inlineCallbacks
              def _continue(self, cursor):
                  res = yield super(Connection, self)._continue(cursor)
                  returnValue(res)
          Severity: Minor
          Found in rethinkdb/twisted_net/net_twisted.py and 1 other location - About 40 mins to fix
          rethinkdb/twisted_net/net_twisted.py on lines 452..455

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 34.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      if not os.path.isfile(value):
                          raise optparse.OptionValueError(
                              "%s value was not an existing file: %s" % (opt_str, value)
          Severity: Minor
          Found in rethinkdb/utils_common.py and 1 other location - About 40 mins to fix
          rethinkdb/utils_common.py on lines 247..249

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 34.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language