GuilhermeStracini/TCC-SENAC

View on GitHub
Src/scripts/xpath.js

Summary

Maintainability
F
2 wks
Test Coverage

File xpath.js has 1777 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// xpath.js - version 0.7 - Spry Pre-Release 1.6.1
//
// Code from xmltoken.js.
//
// Copyright 2006 Google Inc.
Severity: Major
Found in Src/scripts/xpath.js - About 4 days to fix

    Function compare has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

    BinaryExpr.prototype.compare = function(ctx, cmp) {
      var v1 = this.expr1.evaluate(ctx);
      var v2 = this.expr2.evaluate(ctx);
    
      var ret;
    Severity: Minor
    Found in Src/scripts/xpath.js - About 7 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 evaluate has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

    StepExpr.prototype.evaluate = function(ctx) {
      var input = ctx.node;
      var nodelist = [];
    
      // NOTE(mesch): When this was a switch() statement, it didn't work
    Severity: Minor
    Found in Src/scripts/xpath.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 xpathReduce has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

    function xpathReduce(stack, ahead) {
      var cand = null;
    
      if (stack.length > 0) {
        var top = stack[stack.length-1];
    Severity: Minor
    Found in Src/scripts/xpath.js - About 4 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

    xpathfunctions has 30 functions (exceeds 20 allowed). Consider refactoring.
    Open

    FunctionCallExpr.prototype.xpathfunctions = {
      'last': function(ctx) {
        assert(this.args.length == 0);
        // NOTE(mesch): XPath position starts at 1.
        return new NumberValue(ctx.contextSize());
    Severity: Minor
    Found in Src/scripts/xpath.js - About 3 hrs to fix

      Function xpathParse has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

      function xpathParse(expr) {
        xpathLog('parse ' + expr);
        xpathParseInit();
      
        var cached = xpathCacheLookup(expr);
      Severity: Minor
      Found in Src/scripts/xpath.js - About 3 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 xpathParse has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function xpathParse(expr) {
        xpathLog('parse ' + expr);
        xpathParseInit();
      
        var cached = xpathCacheLookup(expr);
      Severity: Major
      Found in Src/scripts/xpath.js - About 3 hrs to fix

        Function xpathMatchStack has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

        function xpathMatchStack(stack, pattern) {
        
          // NOTE(mesch): The stack matches for variable cardinality are
          // greedy but don't do backtracking. This would be an issue only
          // with rules of the form A* A, i.e. with an element with variable
        Severity: Minor
        Found in Src/scripts/xpath.js - About 3 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 compare has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        BinaryExpr.prototype.compare = function(ctx, cmp) {
          var v1 = this.expr1.evaluate(ctx);
          var v2 = this.expr2.evaluate(ctx);
        
          var ret;
        Severity: Major
        Found in Src/scripts/xpath.js - About 2 hrs to fix

          Function evaluate has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          StepExpr.prototype.evaluate = function(ctx) {
            var input = ctx.node;
            var nodelist = [];
          
            // NOTE(mesch): When this was a switch() statement, it didn't work
          Severity: Major
          Found in Src/scripts/xpath.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                if (rule &&
                    (rule == TOK_DIV ||
                     rule == TOK_MOD ||
                     rule == TOK_AND ||
                     rule == TOK_OR) &&
            Severity: Critical
            Found in Src/scripts/xpath.js - About 2 hrs to fix

              Function xpathMatchStack has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function xpathMatchStack(stack, pattern) {
              
                // NOTE(mesch): The stack matches for variable cardinality are
                // greedy but don't do backtracking. This would be an issue only
                // with rules of the form A* A, i.e. with an element with variable
              Severity: Major
              Found in Src/scripts/xpath.js - About 2 hrs to fix

                Function xpathParseInit has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function xpathParseInit() {
                  if (xpathRules.length) {
                    return;
                  }
                
                
                Severity: Major
                Found in Src/scripts/xpath.js - About 2 hrs to fix

                  Function evaluate has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  BinaryExpr.prototype.evaluate = function(ctx) {
                    var ret;
                    switch (this.op.value) {
                      case 'or':
                        ret = new BooleanValue(this.expr1.evaluate(ctx).booleanValue() ||
                  Severity: Major
                  Found in Src/scripts/xpath.js - About 2 hrs to fix

                    Function xpathReduce has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function xpathReduce(stack, ahead) {
                      var cand = null;
                    
                      if (stack.length > 0) {
                        var top = stack[stack.length-1];
                    Severity: Minor
                    Found in Src/scripts/xpath.js - About 1 hr to fix

                      Function xpathParseInit has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function xpathParseInit() {
                        if (xpathRules.length) {
                          return;
                        }
                      
                      
                      Severity: Minor
                      Found in Src/scripts/xpath.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 xpathGrammarPrecedence has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function xpathGrammarPrecedence(frame) {
                        var ret = 0;
                      
                        if (frame.rule) { /* normal reduce */
                          if (frame.rule.length >= 3 && frame.rule[2] >= 0) {
                      Severity: Minor
                      Found in Src/scripts/xpath.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 xpathSort has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function xpathSort(input, sort) {
                        if (sort.length == 0) {
                          return;
                        }
                      
                      
                      Severity: Minor
                      Found in Src/scripts/xpath.js - About 1 hr to fix

                        Function id has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          'id': function(ctx) {
                            assert(this.args.length == 1);
                            var e = this.args[0].evaluate(ctx);
                            var ret = [];
                            var ids;
                        Severity: Minor
                        Found in Src/scripts/xpath.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 xpathSort has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function xpathSort(input, sort) {
                          if (sort.length == 0) {
                            return;
                          }
                        
                        
                        Severity: Minor
                        Found in Src/scripts/xpath.js - About 55 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Avoid deeply nested control flow statements.
                        Open

                            for (var n = input.nextSibling; n; n = n.nextSibling) {
                              nodelist.push(n);
                            }
                        Severity: Major
                        Found in Src/scripts/xpath.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                if (stack[s].tag == pattern[p]) {
                                  while (s - ds >= 0 && stack[s - ds].tag == pattern[p]) {
                                    qmatch.push(stack[s - ds]);
                                    ds += 1;
                                    match.matchlength += 1;
                          Severity: Major
                          Found in Src/scripts/xpath.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                  for (var nn = n.nextSibling; nn; nn = nn.nextSibling) {
                                    nodelist.push(nn);
                                    xpathCollectDescendants(nodelist, nn);
                                  }
                            Severity: Major
                            Found in Src/scripts/xpath.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                      if (cmp(s, nn)) {
                                        ret = true;
                                        break;
                                      }
                              Severity: Major
                              Found in Src/scripts/xpath.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                    } else if (stack[s].tag == pattern[p]) {
                                      match.push(stack[s]);
                                      ds += 1;
                                      match.matchlength += 1;
                                
                                
                                Severity: Major
                                Found in Src/scripts/xpath.js - About 45 mins to fix

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

                                  UnionExpr.prototype.evaluate = function(ctx) {
                                    var nodes1 = this.expr1.evaluate(ctx).nodeSetValue();
                                    var nodes2 = this.expr2.evaluate(ctx).nodeSetValue();
                                    var I1 = nodes1.length;
                                    for (var i2 = 0; i2 < nodes2.length; ++i2) {
                                  Severity: Minor
                                  Found in Src/scripts/xpath.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

                                  Avoid deeply nested control flow statements.
                                  Open

                                      } else if (v1.type == 'string') {
                                        var s = v1.stringValue();
                                        var n = v2.nodeSetValue();
                                  
                                        ret = false;
                                  Severity: Major
                                  Found in Src/scripts/xpath.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                      } else if (this.axis == xpathAxis.NAMESPACE) {
                                        alert('not implemented: axis namespace');
                                    
                                      } else if (this.axis == xpathAxis.PARENT) {
                                        if (input.parentNode) {
                                    Severity: Major
                                    Found in Src/scripts/xpath.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                            for (var i = 0;  i < n.length; ++i) {
                                              var nn = xmlValue(n[i]) - 0;
                                              if (cmp(nn, s)) {
                                                ret = true;
                                                break;
                                      Severity: Major
                                      Found in Src/scripts/xpath.js - About 45 mins to fix

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

                                        function xPathStep(nodes, steps, step, input, ctx) {
                                        Severity: Minor
                                        Found in Src/scripts/xpath.js - About 35 mins to fix

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

                                          function makeFunctionCallExpr2(name, pareno, arg1, args, parenc) {
                                          Severity: Minor
                                          Found in Src/scripts/xpath.js - About 35 mins to fix

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

                                              'lang': function(ctx) {
                                                assert(this.args.length == 1);
                                                var lang = this.args[0].evaluate(ctx).stringValue();
                                                var xmllang;
                                                var n = ctx.node;
                                            Severity: Minor
                                            Found in Src/scripts/xpath.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 evaluate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            FilterExpr.prototype.evaluate = function(ctx) {
                                              var nodes = this.expr.evaluate(ctx).nodeSetValue();
                                              for (var i = 0; i < this.predicate.length; ++i) {
                                                var nodes0 = nodes;
                                                nodes = [];
                                            Severity: Minor
                                            Found in Src/scripts/xpath.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 xmlValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            function xmlValue(node) {
                                              if (!node) {
                                                return '';
                                              }
                                            
                                            
                                            Severity: Minor
                                            Found in Src/scripts/xpath.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 xpathSortByKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            function xpathSortByKey(v1, v2) {
                                              // NOTE: Sort key vectors of different length never occur in
                                              // xsltSort.
                                            
                                              for (var i = 0; i < v1.key.length; ++i) {
                                            Severity: Minor
                                            Found in Src/scripts/xpath.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

                                              for (var i = 0; i < this.predicate.length; ++i) {
                                                var nodelist0 = nodelist;
                                                nodelist = [];
                                                for (var ii = 0; ii < nodelist0.length; ++ii) {
                                                  var n = nodelist0[ii];
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
                                            Src/scripts/xpath.js on lines 1465..1474

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

                                            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 < this.predicate.length; ++i) {
                                                var nodes0 = nodes;
                                                nodes = [];
                                                for (var j = 0; j < nodes0.length; ++j) {
                                                  var n = nodes0[j];
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
                                            Src/scripts/xpath.js on lines 1000..1009

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

                                            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 (v1.type == 'number') {
                                                  var s = v1.numberValue();
                                                  var n = v2.nodeSetValue();
                                            
                                                  ret = false;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
                                            Src/scripts/xpath.js on lines 1597..1638

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

                                            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

                                                } else if (v2.type == 'number') {
                                                  var n = v1.nodeSetValue();
                                                  var s = v2.numberValue();
                                            
                                                  ret = false;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
                                            Src/scripts/xpath.js on lines 1584..1638

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

                                            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

                                                } else if (v1.type == 'string') {
                                                  var s = v1.stringValue();
                                                  var n = v2.nodeSetValue();
                                            
                                                  ret = false;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
                                            Src/scripts/xpath.js on lines 1623..1638

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

                                            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

                                                } else if (v2.type == 'string') {
                                                  var n = v1.nodeSetValue();
                                                  var s = v2.stringValue();
                                            
                                                  ret = false;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
                                            Src/scripts/xpath.js on lines 1610..1638

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

                                            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 (this.args.length > 0) {
                                                  s = this.args[0].evaluate(ctx).stringValue();
                                                } else {
                                                  s = new NodeSetValue([ ctx.node ]).stringValue();
                                                }
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 2 hrs to fix
                                            Src/scripts/xpath.js on lines 1269..1273

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

                                            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 (this.args.length > 0) {
                                                  s = this.args[0].evaluate(ctx).stringValue();
                                                } else {
                                                  s = new NodeSetValue([ ctx.node ]).stringValue();
                                                }
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 2 hrs to fix
                                            Src/scripts/xpath.js on lines 1259..1263

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

                                            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

                                              } else if (this.axis == xpathAxis.PRECEDING) {
                                                for (var n = input; n; n = n.parentNode) {
                                                  for (var nn = n.previousSibling; nn; nn = nn.previousSibling) {
                                                    nodelist.push(nn);
                                                    xpathCollectDescendantsReverse(nodelist, nn);
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 2 hrs to fix
                                            Src/scripts/xpath.js on lines 948..987

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

                                            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

                                              } else if (this.axis == xpathAxis.FOLLOWING) {
                                                for (var n = input; n; n = n.parentNode) {
                                                  for (var nn = n.nextSibling; nn; nn = nn.nextSibling) {
                                                    nodelist.push(nn);
                                                    xpathCollectDescendants(nodelist, nn);
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 2 hrs to fix
                                            Src/scripts/xpath.js on lines 969..987

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

                                            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

                                                  while (s - ds >= 0 && stack[s - ds].tag == pattern[p]) {
                                                    qmatch.push(stack[s - ds]);
                                                    ds += 1;
                                                    match.matchlength += 1;
                                                  }
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 2 hrs to fix
                                            Src/scripts/xpath.js on lines 556..560

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

                                            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

                                                    while (s - ds >= 0 && stack[s - ds].tag == pattern[p]) {
                                                      qmatch.push(stack[s - ds]);
                                                      ds += 1;
                                                      match.matchlength += 1;
                                                    }
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 2 hrs to fix
                                            Src/scripts/xpath.js on lines 537..541

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

                                            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

                                              'ceiling': function(ctx) {
                                                assert(this.args.length == 1);
                                                var num = this.args[0].evaluate(ctx).numberValue();
                                                return new NumberValue(Math.ceil(num));
                                              },
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 2 other locations - About 2 hrs to fix
                                            Src/scripts/xpath.js on lines 1352..1356
                                            Src/scripts/xpath.js on lines 1364..1368

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

                                            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

                                              'round': function(ctx) {
                                                assert(this.args.length == 1);
                                                var num = this.args[0].evaluate(ctx).numberValue();
                                                return new NumberValue(Math.round(num));
                                              },
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 2 other locations - About 2 hrs to fix
                                            Src/scripts/xpath.js on lines 1352..1356
                                            Src/scripts/xpath.js on lines 1358..1362

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

                                            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

                                              'floor': function(ctx) {
                                                assert(this.args.length == 1);
                                                var num = this.args[0].evaluate(ctx).numberValue();
                                                return new NumberValue(Math.floor(num));
                                              },
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 2 other locations - About 2 hrs to fix
                                            Src/scripts/xpath.js on lines 1358..1362
                                            Src/scripts/xpath.js on lines 1364..1368

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

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

                                                case '+':
                                                  ret = new NumberValue(this.expr1.evaluate(ctx).numberValue() +
                                                                        this.expr2.evaluate(ctx).numberValue());
                                                  break;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 4 other locations - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 1511..1514
                                            Src/scripts/xpath.js on lines 1516..1519
                                            Src/scripts/xpath.js on lines 1521..1524
                                            Src/scripts/xpath.js on lines 1526..1529

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

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

                                                case 'mod':
                                                  ret = new NumberValue(this.expr1.evaluate(ctx).numberValue() %
                                                                        this.expr2.evaluate(ctx).numberValue());
                                                  break;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 4 other locations - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 1506..1509
                                            Src/scripts/xpath.js on lines 1511..1514
                                            Src/scripts/xpath.js on lines 1516..1519
                                            Src/scripts/xpath.js on lines 1526..1529

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

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

                                                case 'div':
                                                  ret = new NumberValue(this.expr1.evaluate(ctx).numberValue() /
                                                                        this.expr2.evaluate(ctx).numberValue());
                                                  break;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 4 other locations - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 1506..1509
                                            Src/scripts/xpath.js on lines 1511..1514
                                            Src/scripts/xpath.js on lines 1516..1519
                                            Src/scripts/xpath.js on lines 1521..1524

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

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

                                                case '*':
                                                  ret = new NumberValue(this.expr1.evaluate(ctx).numberValue() *
                                                                        this.expr2.evaluate(ctx).numberValue());
                                                  break;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 4 other locations - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 1506..1509
                                            Src/scripts/xpath.js on lines 1511..1514
                                            Src/scripts/xpath.js on lines 1521..1524
                                            Src/scripts/xpath.js on lines 1526..1529

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

                                            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

                                                case 'or':
                                                  ret = new BooleanValue(this.expr1.evaluate(ctx).booleanValue() ||
                                                                         this.expr2.evaluate(ctx).booleanValue());
                                                  break;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 1501..1504

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

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

                                                case '-':
                                                  ret = new NumberValue(this.expr1.evaluate(ctx).numberValue() -
                                                                        this.expr2.evaluate(ctx).numberValue());
                                                  break;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 4 other locations - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 1506..1509
                                            Src/scripts/xpath.js on lines 1516..1519
                                            Src/scripts/xpath.js on lines 1521..1524
                                            Src/scripts/xpath.js on lines 1526..1529

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

                                            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

                                                case 'and':
                                                  ret = new BooleanValue(this.expr1.evaluate(ctx).booleanValue() &&
                                                                         this.expr2.evaluate(ctx).booleanValue());
                                                  break;
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 1496..1499

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

                                            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

                                              '\u0041-\u005a\u0061-\u007a\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff' +
                                              '\u0100-\u0131\u0134-\u013e\u0141-\u0148\u014a-\u017e\u0180-\u01c3' +
                                              '\u01cd-\u01f0\u01f4-\u01f5\u01fa-\u0217\u0250-\u02a8\u02bb-\u02c1\u0386' +
                                              '\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03ce\u03d0-\u03d6\u03da\u03dc' +
                                              '\u03de\u03e0\u03e2-\u03f3\u0401-\u040c\u040e-\u044f\u0451-\u045c' +
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 87..101

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

                                            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

                                              '\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05a1\u05a3-\u05b9' +
                                              '\u05bb-\u05bd\u05bf\u05c1-\u05c2\u05c4\u064b-\u0652\u0670\u06d6-\u06dc' +
                                              '\u06dd-\u06df\u06e0-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0901-\u0903\u093c' +
                                              '\u093e-\u094c\u094d\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09bc\u09be' +
                                              '\u09bf\u09c0-\u09c4\u09c7-\u09c8\u09cb-\u09cd\u09d7\u09e2-\u09e3\u0a02' +
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 48..62

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

                                            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

                                            function xpathCollectDescendants(nodelist, node) {
                                              for (var n = node.firstChild; n; n = n.nextSibling) {
                                                nodelist.push(n);
                                                arguments.callee(nodelist, n);
                                              }
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 2366..2371

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

                                            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

                                            function xpathCollectDescendantsReverse(nodelist, node) {
                                              for (var n = node.lastChild; n; n = n.previousSibling) {
                                                nodelist.push(n);
                                                arguments.callee(nodelist, n);
                                              }
                                            Severity: Major
                                            Found in Src/scripts/xpath.js and 1 other location - About 1 hr to fix
                                            Src/scripts/xpath.js on lines 2359..2364

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

                                            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