mbroadst/rethunk

View on GitHub
lib/error.js

Summary

Maintainability
F
2 wks
Test Coverage

File error.js has 823 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";
var helper = require('./helper.js'),
    protodef = require('./protodef.js'),
    protoErrorType = protodef.Response.ErrorType,
    termTypes = protodef.Term.TermType,
Severity: Major
Found in lib/error.js - About 1 day to fix

    Function DATUM has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

      DATUM: function(term, index, father, frames, options, optarg) {
        optarg = optarg || false;
    
        var underline = Array.isArray(frames) && (frames.length === 0);
        var currentFrame, backtrace;
    Severity: Minor
    Found in lib/error.js - About 6 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 TABLE has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

      TABLE: function(term, index, father, frames, options) {
        var result = { str: '', car: '' };
        var backtrace, underline, currentFrame;
        if ((term.length === 1) || (term[1].length === 0) || (term[1][0][0] !== termTypes.DB)) {
          underline = Array.isArray(frames) && (frames.length === 0);
    Severity: Minor
    Found in lib/error.js - About 2 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 DATUM has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      DATUM: function(term, index, father, frames, options, optarg) {
        optarg = optarg || false;
    
        var underline = Array.isArray(frames) && (frames.length === 0);
        var currentFrame, backtrace;
    Severity: Major
    Found in lib/error.js - About 2 hrs to fix

      Function FUNCALL has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

        FUNCALL: function(term, index, father, frames, options) {
          // The syntax is args[1].do(args[0])
          var result = { str: '', car: '' };
          var backtrace, underline, currentFrame;
          underline = Array.isArray(frames) && (frames.length === 0);
      Severity: Minor
      Found in lib/error.js - About 2 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 FUNC has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

        FUNC: function(term, index, father, frames, options) {
          var result = { str: '', car: '' };
          var backtrace, underline, currentFrame;
      
          underline = Array.isArray(frames) && (frames.length === 0);
      Severity: Minor
      Found in lib/error.js - About 2 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 MAKE_ARRAY has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

        MAKE_ARRAY: function(term, index, father, frames, options) {
          var result = { str: '', car: '' };
          var backtrace, underline, currentFrame;
      
          underline = Array.isArray(frames) && (frames.length === 0);
      Severity: Minor
      Found in lib/error.js - About 1 hr 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 ReqlCompileError has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      error.ReqlCompileError = function(message, query, frames) {
        error.ReqlBaseError.call(this, message);
        this.name = 'ReqlCompileError';
      
        if (!!query && !!frames) {
      Severity: Minor
      Found in lib/error.js - About 1 hr 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 ReqlRuntimeError has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      error.ReqlRuntimeError = function(message, query, frames) {
        error.ReqlBaseError.call(this, message);
        this.name = 'ReqlRuntimeError';
      
        if (!!query && !!frames) {
      Severity: Minor
      Found in lib/error.js - About 1 hr 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 generateNormalBacktrace has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      function generateNormalBacktrace(term, index, father, frames, options) {
        var result = { str: '', car: '' };
        var backtrace, currentFrame, underline;
        underline = Array.isArray(frames) && (frames.length === 0);
        currentFrame = Array.isArray(frames) ? frames.shift() : null;
      Severity: Minor
      Found in lib/error.js - About 1 hr 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 generateNormalBacktrace has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function generateNormalBacktrace(term, index, father, frames, options) {
        var result = { str: '', car: '' };
        var backtrace, currentFrame, underline;
        underline = Array.isArray(frames) && (frames.length === 0);
        currentFrame = Array.isArray(frames) ? frames.shift() : null;
      Severity: Minor
      Found in lib/error.js - About 1 hr to fix

        Function generateWithoutPrefixBacktrace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function generateWithoutPrefixBacktrace(term, index, father, frames, options) {
          var result = { str: '', car: '' };
          var backtrace, currentFrame, underline;
        
          underline = Array.isArray(frames) && (frames.length === 0);
        Severity: Minor
        Found in lib/error.js - About 1 hr 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 FUNCALL has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          FUNCALL: function(term, index, father, frames, options) {
            // The syntax is args[1].do(args[0])
            var result = { str: '', car: '' };
            var backtrace, underline, currentFrame;
            underline = Array.isArray(frames) && (frames.length === 0);
        Severity: Minor
        Found in lib/error.js - About 1 hr to fix

          Function FUNC has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            FUNC: function(term, index, father, frames, options) {
              var result = { str: '', car: '' };
              var backtrace, underline, currentFrame;
          
              underline = Array.isArray(frames) && (frames.length === 0);
          Severity: Minor
          Found in lib/error.js - About 1 hr to fix

            Function ReqlDriverError has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            error.ReqlDriverError = function(message, query, secondMessage) {
              error.ReqlBaseError.call(this, message);
              this.name = 'ReqlDriverError';
            
              if ((Array.isArray(query) && (query.length > 0)) || (!Array.isArray(query) && !!query)) {
            Severity: Minor
            Found in lib/error.js - About 1 hr 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 TABLE has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              TABLE: function(term, index, father, frames, options) {
                var result = { str: '', car: '' };
                var backtrace, underline, currentFrame;
                if ((term.length === 1) || (term[1].length === 0) || (term[1][0][0] !== termTypes.DB)) {
                  underline = Array.isArray(frames) && (frames.length === 0);
            Severity: Minor
            Found in lib/error.js - About 1 hr to fix

              Function MAKE_ARRAY has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                MAKE_ARRAY: function(term, index, father, frames, options) {
                  var result = { str: '', car: '' };
                  var backtrace, underline, currentFrame;
              
                  underline = Array.isArray(frames) && (frames.length === 0);
              Severity: Minor
              Found in lib/error.js - About 1 hr to fix

                Function generateWithoutPrefixBacktrace has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function generateWithoutPrefixBacktrace(term, index, father, frames, options) {
                  var result = { str: '', car: '' };
                  var backtrace, currentFrame, underline;
                
                  underline = Array.isArray(frames) && (frames.length === 0);
                Severity: Minor
                Found in lib/error.js - About 1 hr to fix

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

                    DATUM: function(term, index, father, frames, options, optarg) {
                  Severity: Minor
                  Found in lib/error.js - About 45 mins to fix

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

                    function makeOptargs(term, index, father, frames, options, currentFrame) {
                    Severity: Minor
                    Found in lib/error.js - About 45 mins to fix

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

                      error.ReqlServerError = function(message, query) {
                        error.ReqlBaseError.call(this, message);
                        this.name = 'ReqlServerError';
                      
                        if ((Array.isArray(query) && (query.length > 0)) || (!Array.isArray(query) && !!query)) {
                      Severity: Minor
                      Found in lib/error.js - 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 TABLE has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        TABLE: function(term, index, father, frames, options) {
                      Severity: Minor
                      Found in lib/error.js - About 35 mins to fix

                        Function generateNormalBacktrace has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function generateNormalBacktrace(term, index, father, frames, options) {
                        Severity: Minor
                        Found in lib/error.js - About 35 mins to fix

                          Function GET_FIELD has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            GET_FIELD: function(term, index, father, frames, options) {
                          Severity: Minor
                          Found in lib/error.js - About 35 mins to fix

                            Function IMPLICIT_VAR has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              IMPLICIT_VAR: function(term, index, father, frames, options) {
                            Severity: Minor
                            Found in lib/error.js - About 35 mins to fix

                              Function MAP has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                MAP: function(term, index, father, frames, options) {
                              Severity: Minor
                              Found in lib/error.js - About 35 mins to fix

                                Function WAIT has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  WAIT: function(term, index, father, frames, options) {
                                Severity: Minor
                                Found in lib/error.js - About 35 mins to fix

                                  Function generateWithoutPrefixBacktrace has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  function generateWithoutPrefixBacktrace(term, index, father, frames, options) {
                                  Severity: Minor
                                  Found in lib/error.js - About 35 mins to fix

                                    Function FUNC has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                      FUNC: function(term, index, father, frames, options) {
                                    Severity: Minor
                                    Found in lib/error.js - About 35 mins to fix

                                      Function generateBacktrace has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      function generateBacktrace(term, index, father, frames, options) {
                                      Severity: Minor
                                      Found in lib/error.js - About 35 mins to fix

                                        Function VAR has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                          VAR: function(term, index, father, frames, options) {
                                        Severity: Minor
                                        Found in lib/error.js - About 35 mins to fix

                                          Function MAKE_ARRAY has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                            MAKE_ARRAY: function(term, index, father, frames, options) {
                                          Severity: Minor
                                          Found in lib/error.js - About 35 mins to fix

                                            Function FUNCALL has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                              FUNCALL: function(term, index, father, frames, options) {
                                            Severity: Minor
                                            Found in lib/error.js - About 35 mins to fix

                                              Function generateBacktrace has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              function generateBacktrace(term, index, father, frames, options) {
                                                var result = { str: '', car: '' };
                                                var backtrace, underline;
                                              
                                                // frames = null -> do not underline
                                              Severity: Minor
                                              Found in lib/error.js - About 35 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 makeOptargs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              function makeOptargs(term, index, father, frames, options, currentFrame) {
                                                var result = { str: '', car: '' };
                                                var backtrace, underline;
                                              
                                                if (helper.isPlainObject(term[2])) {
                                              Severity: Minor
                                              Found in lib/error.js - About 25 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 GET_FIELD has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                GET_FIELD: function(term, index, father, frames, options) {
                                                  var result = { str: '', car: '' };
                                                  var backtrace, underline, currentFrame;
                                                  underline = Array.isArray(frames) && (frames.length === 0);
                                                  currentFrame = Array.isArray(frames) ? frames.shift() : null;
                                              Severity: Minor
                                              Found in lib/error.js - About 25 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

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

                                              error.ReqlRuntimeError = function(message, query, frames) {
                                                error.ReqlBaseError.call(this, message);
                                                this.name = 'ReqlRuntimeError';
                                              
                                                if (!!query && !!frames) {
                                              Severity: Major
                                              Found in lib/error.js and 1 other location - About 2 days to fix
                                              lib/error.js on lines 182..210

                                              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 424.

                                              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

                                              error.ReqlCompileError = function(message, query, frames) {
                                                error.ReqlBaseError.call(this, message);
                                                this.name = 'ReqlCompileError';
                                              
                                                if (!!query && !!frames) {
                                              Severity: Major
                                              Found in lib/error.js and 1 other location - About 2 days to fix
                                              lib/error.js on lines 75..103

                                              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 424.

                                              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 ((Array.isArray(query) && (query.length > 0)) || (!Array.isArray(query) && !!query)) {
                                                  if ((this.message.length > 0) && (this.message[this.message.length - 1] === '.')) {
                                                    this.message = this.message.slice(0, this.message.length - 1);
                                                  }
                                              
                                              
                                              Severity: Major
                                              Found in lib/error.js and 1 other location - About 1 day to fix
                                              lib/error.js on lines 57..67

                                              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 228.

                                              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 ((Array.isArray(query) && (query.length > 0)) || (!Array.isArray(query) && !!query)) {
                                                  if ((this.message.length > 0) && (this.message[this.message.length - 1] === '.')) {
                                                    this.message = this.message.slice(0, this.message.length - 1);
                                                  }
                                              
                                              
                                              Severity: Major
                                              Found in lib/error.js and 1 other location - About 1 day to fix
                                              lib/error.js on lines 34..44

                                              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 228.

                                              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

                                                MAP: function(term, index, father, frames, options) {
                                                  var result = { str: '', car: '' };
                                                  var backtrace;
                                              
                                                  if (term.length > 1 && term[1].length > 2) {
                                              Severity: Major
                                              Found in lib/error.js and 1 other location - About 6 hrs to fix
                                              lib/error.js on lines 789..803

                                              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 166.

                                              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

                                                WAIT: function(term, index, father, frames, options) {
                                                  var result = { str: '', car: '' };
                                                  var backtrace;
                                              
                                                  if (term.length === 1 || term[1].length === 0) {
                                              Severity: Major
                                              Found in lib/error.js and 1 other location - About 6 hrs to fix
                                              lib/error.js on lines 805..819

                                              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 166.

                                              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

                                                  for (var i = 0; i < term[1].length; i++) {
                                                    if (i !== 0) {
                                                      carify(result, ', ', underline);
                                                    }
                                              
                                              
                                              Severity: Major
                                              Found in lib/error.js and 1 other location - About 5 hrs to fix
                                              lib/error.js on lines 907..920

                                              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 150.

                                              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

                                                for (var i = 1; i < term[1].length; i++) {
                                                  if (i !== 1) {
                                                    carify(result, ', ' , underline);
                                                  }
                                              
                                              
                                              Severity: Major
                                              Found in lib/error.js and 1 other location - About 5 hrs to fix
                                              lib/error.js on lines 637..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 150.

                                              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 7 locations. Consider refactoring.
                                              Open

                                                  if ((currentFrame !== null) && (currentFrame === 0)) {
                                                    backtrace = generateBacktrace(term[1][0], 0, term, frames, options);
                                                  } else {
                                                    backtrace = generateBacktrace(term[1][0], 0, term, null, options);
                                                  }
                                              Severity: Major
                                              Found in lib/error.js and 6 other locations - About 1 hr to fix
                                              lib/error.js on lines 613..617
                                              lib/error.js on lines 670..674
                                              lib/error.js on lines 694..698
                                              lib/error.js on lines 733..737
                                              lib/error.js on lines 762..766
                                              lib/error.js on lines 883..887

                                              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 69.

                                              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 7 locations. Consider refactoring.
                                              Open

                                                  if ((currentFrame !== null) && (currentFrame === 1)) {
                                                    backtrace = generateBacktrace(term[1][1], 1, term, frames, options);
                                                  } else {
                                                    backtrace = generateBacktrace(term[1][1], 1, term, null, options);
                                                  }
                                              Severity: Major
                                              Found in lib/error.js and 6 other locations - About 1 hr to fix
                                              lib/error.js on lines 602..606
                                              lib/error.js on lines 670..674
                                              lib/error.js on lines 694..698
                                              lib/error.js on lines 733..737
                                              lib/error.js on lines 762..766
                                              lib/error.js on lines 883..887

                                              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 69.

                                              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 7 locations. Consider refactoring.
                                              Open

                                                if ((currentFrame !== null) && (currentFrame === 0)) {
                                                  backtrace = generateBacktrace(term[1][0], 0, term, frames, options);
                                                } else {
                                                  backtrace = generateBacktrace(term[1][0], 0, term, null, options);
                                                }
                                              Severity: Major
                                              Found in lib/error.js and 6 other locations - About 1 hr to fix
                                              lib/error.js on lines 602..606
                                              lib/error.js on lines 613..617
                                              lib/error.js on lines 670..674
                                              lib/error.js on lines 694..698
                                              lib/error.js on lines 733..737
                                              lib/error.js on lines 762..766

                                              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 69.

                                              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 7 locations. Consider refactoring.
                                              Open

                                                    if ((currentFrame !== null) && (currentFrame === 1)) {
                                                      backtrace = generateBacktrace(term[1][1], 1, term, frames, options);
                                                    } else {
                                                      backtrace = generateBacktrace(term[1][1], 1, term, null, options);
                                                    }
                                              Severity: Major
                                              Found in lib/error.js and 6 other locations - About 1 hr to fix
                                              lib/error.js on lines 602..606
                                              lib/error.js on lines 613..617
                                              lib/error.js on lines 670..674
                                              lib/error.js on lines 733..737
                                              lib/error.js on lines 762..766
                                              lib/error.js on lines 883..887

                                              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 69.

                                              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 7 locations. Consider refactoring.
                                              Open

                                                  if ((currentFrame !== null) && (currentFrame === 0)) {
                                                    backtrace = generateBacktrace(term[1][0], 0, term, frames, options);
                                                  } else {
                                                    backtrace = generateBacktrace(term[1][0], 0, term, null, options);
                                                  }
                                              Severity: Major
                                              Found in lib/error.js and 6 other locations - About 1 hr to fix
                                              lib/error.js on lines 602..606
                                              lib/error.js on lines 613..617
                                              lib/error.js on lines 670..674
                                              lib/error.js on lines 694..698
                                              lib/error.js on lines 733..737
                                              lib/error.js on lines 883..887

                                              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 69.

                                              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 7 locations. Consider refactoring.
                                              Open

                                                    if ((currentFrame !== null) && (currentFrame === 1)) {
                                                      backtrace = generateBacktrace(term[1][1], 1, term, frames, options);
                                                    } else {
                                                      backtrace = generateBacktrace(term[1][1], 1, term, null, options);
                                                    }
                                              Severity: Major
                                              Found in lib/error.js and 6 other locations - About 1 hr to fix
                                              lib/error.js on lines 602..606
                                              lib/error.js on lines 613..617
                                              lib/error.js on lines 694..698
                                              lib/error.js on lines 733..737
                                              lib/error.js on lines 762..766
                                              lib/error.js on lines 883..887

                                              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 69.

                                              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 7 locations. Consider refactoring.
                                              Open

                                                    if ((currentFrame !== null) && (currentFrame === 1)) {
                                                      backtrace = generateBacktrace(term[1][1], 0, term, frames, options);
                                                    } else {
                                                      backtrace = generateBacktrace(term[1][1], 0, term, null, options);
                                                    }
                                              Severity: Major
                                              Found in lib/error.js and 6 other locations - About 1 hr to fix
                                              lib/error.js on lines 602..606
                                              lib/error.js on lines 613..617
                                              lib/error.js on lines 670..674
                                              lib/error.js on lines 694..698
                                              lib/error.js on lines 762..766
                                              lib/error.js on lines 883..887

                                              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 69.

                                              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 ((currentFrame !== null) && (currentFrame === z)) {
                                                        backtrace = generateBacktrace(term[z], z, term, frames, options);
                                                      } else {
                                                        backtrace = generateBacktrace(term[z], z, term, null, options);
                                                      }
                                              Severity: Major
                                              Found in lib/error.js and 1 other location - About 1 hr to fix
                                              lib/error.js on lines 518..522

                                              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 61.

                                              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 ((currentFrame !== null) && (currentFrame === key)) {
                                                          backtrace = generateBacktrace(term[key], countKeys, term, frames, options);
                                                        } else {
                                                          backtrace = generateBacktrace(term[key], countKeys, term, null, options);
                                                        }
                                              Severity: Major
                                              Found in lib/error.js and 1 other location - About 1 hr to fix
                                              lib/error.js on lines 538..542

                                              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 61.

                                              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 6 locations. Consider refactoring.
                                              Open

                                              error.ReqlResourceLimitError = function(message, query, frames) {
                                                error.ReqlRuntimeError.call(this, message, query, frames);
                                                this.name = 'ReqlResourceLimitError';
                                              };
                                              Severity: Major
                                              Found in lib/error.js and 5 other locations - About 45 mins to fix
                                              lib/error.js on lines 128..131
                                              lib/error.js on lines 146..149
                                              lib/error.js on lines 155..158
                                              lib/error.js on lines 164..167
                                              lib/error.js on lines 173..176

                                              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 50.

                                              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 6 locations. Consider refactoring.
                                              Open

                                              error.ReqlInternalError = function(message, query, frames) {
                                                error.ReqlRuntimeError.call(this, message, query, frames);
                                                this.name = 'ReqlInternalError';
                                              };
                                              Severity: Major
                                              Found in lib/error.js and 5 other locations - About 45 mins to fix
                                              lib/error.js on lines 137..140
                                              lib/error.js on lines 146..149
                                              lib/error.js on lines 155..158
                                              lib/error.js on lines 164..167
                                              lib/error.js on lines 173..176

                                              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 50.

                                              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 6 locations. Consider refactoring.
                                              Open

                                              error.ReqlUserError = function(message, query, frames) {
                                                error.ReqlRuntimeError.call(this, message, query, frames);
                                                this.name = 'ReqlUserError';
                                              };
                                              Severity: Major
                                              Found in lib/error.js and 5 other locations - About 45 mins to fix
                                              lib/error.js on lines 128..131
                                              lib/error.js on lines 137..140
                                              lib/error.js on lines 146..149
                                              lib/error.js on lines 155..158
                                              lib/error.js on lines 164..167

                                              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 50.

                                              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 6 locations. Consider refactoring.
                                              Open

                                              error.ReqlOpFailedError = function(message, query, frames) {
                                                error.ReqlRuntimeError.call(this, message, query, frames);
                                                this.name = 'ReqlOpFailedError';
                                              };
                                              Severity: Major
                                              Found in lib/error.js and 5 other locations - About 45 mins to fix
                                              lib/error.js on lines 128..131
                                              lib/error.js on lines 137..140
                                              lib/error.js on lines 146..149
                                              lib/error.js on lines 164..167
                                              lib/error.js on lines 173..176

                                              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 50.

                                              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 6 locations. Consider refactoring.
                                              Open

                                              error.ReqlQueryLogicError = function(message, query, frames) {
                                                error.ReqlRuntimeError.call(this, message, query, frames);
                                                this.name = 'ReqlQueryLogicError';
                                              };
                                              Severity: Major
                                              Found in lib/error.js and 5 other locations - About 45 mins to fix
                                              lib/error.js on lines 128..131
                                              lib/error.js on lines 137..140
                                              lib/error.js on lines 155..158
                                              lib/error.js on lines 164..167
                                              lib/error.js on lines 173..176

                                              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 50.

                                              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 6 locations. Consider refactoring.
                                              Open

                                              error.ReqlOpIndeterminateError = function(message, query, frames) {
                                                error.ReqlRuntimeError.call(this, message, query, frames);
                                                this.name = 'ReqlOpIndeterminateError';
                                              };
                                              Severity: Major
                                              Found in lib/error.js and 5 other locations - About 45 mins to fix
                                              lib/error.js on lines 128..131
                                              lib/error.js on lines 137..140
                                              lib/error.js on lines 146..149
                                              lib/error.js on lines 155..158
                                              lib/error.js on lines 173..176

                                              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 50.

                                              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

                                              There are no issues that match your filters.

                                              Category
                                              Status