ContentMine/thresher

View on GitHub
lib/xpath.js

Summary

Maintainability
F
3 mos
Test Coverage

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

/*
 * xpath.js
 *
 * An XPath 1.0 library for JavaScript.
 *
Severity: Major
Found in lib/xpath.js - About 1 wk to fix

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

    PathExpr.prototype.evaluate = function(c) {
        var nodes;
        var xpc = new XPathContext();
        xpc.variableResolver = c.variableResolver;
        xpc.functionResolver = c.functionResolver;
    Severity: Minor
    Found in lib/xpath.js - About 1 wk 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 isLetter has a Cognitive Complexity of 303 (exceeds 5 allowed). Consider refactoring.
    Open

    Utilities.isLetter = function(c) {
        return c >= 0x0041 && c <= 0x005A ||
            c >= 0x0061 && c <= 0x007A ||
            c >= 0x00C0 && c <= 0x00D6 ||
            c >= 0x00D8 && c <= 0x00F6 ||
    Severity: Minor
    Found in lib/xpath.js - About 6 days 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 tokenize has a Cognitive Complexity of 177 (exceeds 5 allowed). Consider refactoring.
    Open

    XPathParser.prototype.tokenize = function(s1) {
        var types = [];
        var values = [];
        var s = s1 + '\0';
    
    Severity: Minor
    Found in lib/xpath.js - About 3 days 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 isNCNameChar has a Cognitive Complexity of 166 (exceeds 5 allowed). Consider refactoring.
    Open

    Utilities.isNCNameChar = function(c) {
        return c >= 0x0030 && c <= 0x0039 
            || c >= 0x0660 && c <= 0x0669 
            || c >= 0x06F0 && c <= 0x06F9 
            || c >= 0x0966 && c <= 0x096F 
    Severity: Minor
    Found in lib/xpath.js - About 3 days 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 tokenize has 333 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    XPathParser.prototype.tokenize = function(s1) {
        var types = [];
        var values = [];
        var s = s1 + '\0';
    
    Severity: Major
    Found in lib/xpath.js - About 1 day to fix

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

      PathExpr.prototype.evaluate = function(c) {
          var nodes;
          var xpc = new XPathContext();
          xpc.variableResolver = c.variableResolver;
          xpc.functionResolver = c.functionResolver;
      Severity: Major
      Found in lib/xpath.js - About 1 day to fix

        Function init has 207 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        XPathParser.prototype.init = function() {
            this.reduceActions = [];
        
            this.reduceActions[3] = function(rhs) {
                return new OrOperation(rhs[0], rhs[2]);
        Severity: Major
        Found in lib/xpath.js - About 1 day to fix

          Function isLetter has 205 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Utilities.isLetter = function(c) {
              return c >= 0x0041 && c <= 0x005A ||
                  c >= 0x0061 && c <= 0x007A ||
                  c >= 0x00C0 && c <= 0x00D6 ||
                  c >= 0x00D8 && c <= 0x00F6 ||
          Severity: Major
          Found in lib/xpath.js - About 1 day to fix

            Consider simplifying this complex logical expression.
            Open

                            if (last != XPathParser.AT
                                    && last != XPathParser.DOUBLECOLON
                                    && last != XPathParser.LEFTPARENTHESIS
                                    && last != XPathParser.LEFTBRACKET
                                    && last != XPathParser.AND
            Severity: Critical
            Found in lib/xpath.js - About 5 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                              if (last != XPathParser.AT
                                      && last != XPathParser.DOUBLECOLON
                                      && last != XPathParser.LEFTPARENTHESIS
                                      && last != XPathParser.LEFTBRACKET
                                      && last != XPathParser.AND
              Severity: Critical
              Found in lib/xpath.js - About 5 hrs to fix

                Function isNCNameChar has 125 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Utilities.isNCNameChar = function(c) {
                    return c >= 0x0030 && c <= 0x0039 
                        || c >= 0x0660 && c <= 0x0669 
                        || c >= 0x06F0 && c <= 0x06F9 
                        || c >= 0x0966 && c <= 0x096F 
                Severity: Major
                Found in lib/xpath.js - About 5 hrs to fix

                  Function matches has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                  Open

                  NodeTest.prototype.matches = function(n, xpc) {
                      switch (this.type) {
                          case NodeTest.NAMETESTANY:
                              if (n.nodeType == 2 /*Node.ATTRIBUTE_NODE*/
                                      || n.nodeType == 1 /*Node.ELEMENT_NODE*/
                  Severity: Minor
                  Found in lib/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 coalesceText has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Utilities.coalesceText = function(n) {
                      for (var m = n.firstChild; m != null; m = m.nextSibling) {
                          if (m.nodeType == 3 /*Node.TEXT_NODE*/ || m.nodeType == 4 /*Node.CDATA_SECTION_NODE*/) {
                              var s = m.nodeValue;
                              var first = m;
                  Severity: Minor
                  Found in lib/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 parse has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  XPathParser.prototype.parse = function(s) {
                      var types;
                      var values;
                      var res = this.tokenize(s);
                      if (res == undefined) {
                  Severity: Major
                  Found in lib/xpath.js - About 2 hrs to fix

                    Function balance has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    AVLTree.prototype.balance = function() {
                        var ldepth = this.left  == null ? 0 : this.left.depth;
                        var rdepth = this.right == null ? 0 : this.right.depth;
                    
                        if (ldepth > rdepth + 1) {
                    Severity: Minor
                    Found in lib/xpath.js - About 2 hrs to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Function order has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    AVLTree.prototype.order = function(n1, n2) {
                        if (n1 === n2) {
                            return 0;
                        }
                        var d1 = 0;
                    Severity: Minor
                    Found in lib/xpath.js - About 2 hrs to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Function add has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    AVLTree.prototype.add = function(n)  {
                        if (n === this.node) {
                            return false;
                        }
                        
                    Severity: Minor
                    Found in lib/xpath.js - About 2 hrs to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Function XPathResult has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function XPathResult(v, t) {
                        if (t == XPathResult.ANY_TYPE) {
                            if (v.constructor === XString) {
                                t = XPathResult.STRING_TYPE;
                            } else if (v.constructor === XNumber) {
                    Severity: Minor
                    Found in lib/xpath.js - About 1 hr to fix

                      Function toString has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Step.prototype.toString = function() {
                          var s;
                          switch (this.axis) {
                              case Step.ANCESTOR:
                                  s = "ancestor";
                      Severity: Minor
                      Found in lib/xpath.js - About 1 hr to fix

                        Function matches has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        NodeTest.prototype.matches = function(n, xpc) {
                            switch (this.type) {
                                case NodeTest.NAMETESTANY:
                                    if (n.nodeType == 2 /*Node.ATTRIBUTE_NODE*/
                                            || n.nodeType == 1 /*Node.ELEMENT_NODE*/
                        Severity: Minor
                        Found in lib/xpath.js - About 1 hr to fix

                          Function order has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          AVLTree.prototype.order = function(n1, n2) {
                              if (n1 === n2) {
                                  return 0;
                              }
                              var d1 = 0;
                          Severity: Minor
                          Found in lib/xpath.js - About 1 hr to fix

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

                            PathExpr.prototype.toString = function() {
                                if (this.filter != undefined) {
                                    var s = this.filter.toString();
                                    if (Utilities.instance_of(this.filter, XString)) {
                                        s = "'" + s + "'";
                            Severity: Minor
                            Found in lib/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 normalizeSpace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                            Open

                            Functions.normalizeSpace = function() {
                                var c = arguments[0];
                                var s;
                                if (arguments.length == 1) {
                                    s = XNodeSet.prototype.stringForNode(c.contextNode);
                            Severity: Minor
                            Found in lib/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 XPathResult has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function XPathResult(v, t) {
                                if (t == XPathResult.ANY_TYPE) {
                                    if (v.constructor === XString) {
                                        t = XPathResult.STRING_TYPE;
                                    } else if (v.constructor === XNumber) {
                            Severity: Minor
                            Found in lib/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 getNamespace has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                            NamespaceResolver.prototype.getNamespace = function(prefix, n) {
                                if (prefix == "xml") {
                                    return XPath.XML_NAMESPACE_URI;
                                } else if (prefix == "xmlns") {
                                    return XPath.XMLNS_NAMESPACE_URI;
                            Severity: Minor
                            Found in lib/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 translate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                            Functions.translate = function() {
                                var c = arguments[0];
                                if (arguments.length != 4) {
                                    throw new Error("Function translate expects (string, string, string)");
                                }
                            Severity: Minor
                            Found in lib/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 parse has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                            XPathParser.prototype.parse = function(s) {
                                var types;
                                var values;
                                var res = this.tokenize(s);
                                if (res == undefined) {
                            Severity: Minor
                            Found in lib/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 normalizeSpace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Functions.normalizeSpace = function() {
                                var c = arguments[0];
                                var s;
                                if (arguments.length == 1) {
                                    s = XNodeSet.prototype.stringForNode(c.contextNode);
                            Severity: Minor
                            Found in lib/xpath.js - About 1 hr to fix

                              Function add has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              AVLTree.prototype.add = function(n)  {
                                  if (n === this.node) {
                                      return false;
                                  }
                                  
                              Severity: Minor
                              Found in lib/xpath.js - About 1 hr to fix

                                Function id has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                Functions.id = function() {
                                    var c = arguments[0];
                                    var id;
                                    if (arguments.length != 2) {
                                        throw new Error("Function id expects (object)");
                                Severity: Minor
                                Found in lib/xpath.js - About 1 hr to fix

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

                                  PathExpr.prototype.getOwnerElement = function(n) {
                                      // DOM 2 has ownerElement
                                      if (n.ownerElement) {
                                          return n.ownerElement;
                                      }
                                  Severity: Minor
                                  Found in lib/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 id has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  Functions.id = function() {
                                      var c = arguments[0];
                                      var id;
                                      if (arguments.length != 2) {
                                          throw new Error("Function id expects (object)");
                                  Severity: Minor
                                  Found in lib/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 coalesceText has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Utilities.coalesceText = function(n) {
                                      for (var m = n.firstChild; m != null; m = m.nextSibling) {
                                          if (m.nodeType == 3 /*Node.TEXT_NODE*/ || m.nodeType == 4 /*Node.CDATA_SECTION_NODE*/) {
                                              var s = m.nodeValue;
                                              var first = m;
                                  Severity: Minor
                                  Found in lib/xpath.js - About 1 hr to fix

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

                                    FunctionResolver.prototype.addStandardFunctions = function() {
                                        this.functions["{}last"] = Functions.last;
                                        this.functions["{}position"] = Functions.position;
                                        this.functions["{}count"] = Functions.count;
                                        this.functions["{}id"] = Functions.id;
                                    Severity: Minor
                                    Found in lib/xpath.js - About 1 hr to fix

                                      Function translate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      Functions.translate = function() {
                                          var c = arguments[0];
                                          if (arguments.length != 4) {
                                              throw new Error("Function translate expects (string, string, string)");
                                          }
                                      Severity: Minor
                                      Found in lib/xpath.js - About 1 hr to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if (name == "mod") {
                                                                types.push(XPathParser.MOD);
                                                                values.push(name);
                                                                continue;
                                                            }
                                        Severity: Major
                                        Found in lib/xpath.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                              if (c == '(') {
                                                                  types.push(XPathParser.FUNCTIONNAME);
                                                                  values.push(name);
                                                                  continue;
                                                              }
                                          Severity: Major
                                          Found in lib/xpath.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                    if (xpc.contextNode !== xpc.virtualRoot) {
                                                                        if (xpc.contextNode.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) {
                                                                            m = this.getOwnerElement(xpc.contextNode);
                                                                        } else {
                                                                            m = xpc.contextNode.parentNode;
                                            Severity: Major
                                            Found in lib/xpath.js - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                      if (xpc.contextNode === xpc.virtualRoot) {
                                                                          break;
                                                                      }
                                              Severity: Major
                                              Found in lib/xpath.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                        if (step.nodeTest.matches(xpc.contextNode, xpc)) {
                                                                            newNodes.push(xpc.contextNode);
                                                                        }
                                                Severity: Major
                                                Found in lib/xpath.js - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                          for (var m = xpc.contextNode.previousSibling; m != null; m = m.previousSibling) {
                                                                              if (step.nodeTest.matches(m, xpc)) {
                                                                                  newNodes.push(m);
                                                                              }
                                                                          }
                                                  Severity: Major
                                                  Found in lib/xpath.js - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                            while (m != null) {
                                                                                if (step.nodeTest.matches(m, xpc)) {
                                                                                    newNodes.push(m);
                                                                                }
                                                                                if (m === xpc.virtualRoot) {
                                                    Severity: Major
                                                    Found in lib/xpath.js - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                              if (xpc.contextNode.nodeType == 1 /*Node.ELEMENT_NODE*/) {
                                                                                  n["xml"] = XPath.XML_NAMESPACE_URI;
                                                                                  n["xmlns"] = XPath.XMLNS_NAMESPACE_URI;
                                                                                  for (var m = xpc.contextNode; m != null && m.nodeType == 1 /*Node.ELEMENT_NODE*/; m = m.parentNode) {
                                                                                      for (var k = 0; k < m.attributes.length; k++) {
                                                      Severity: Major
                                                      Found in lib/xpath.js - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                if (xpc.contextNode === xpc.virtualRoot) {
                                                                                    break;
                                                                                }
                                                        Severity: Major
                                                        Found in lib/xpath.js - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                              if (s.charAt(pos) == ')') {
                                                                                  types.push(XPathParser.NODETYPE);
                                                                              } else {
                                                                                  types.push(XPathParser.PROCESSINGINSTRUCTIONWITHLITERAL);
                                                                              }
                                                          Severity: Major
                                                          Found in lib/xpath.js - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                    for (var m = xpc.contextNode.nextSibling; m != null; m = m.nextSibling) {
                                                                                        if (step.nodeTest.matches(m, xpc)) {
                                                                                            newNodes.push(m);
                                                                                        }
                                                                                    }
                                                            Severity: Major
                                                            Found in lib/xpath.js - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                      if (xpc.contextNode.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) {
                                                                                          m = this.getOwnerElement(xpc.contextNode);
                                                                                      } else {
                                                                                          m = xpc.contextNode.parentNode;
                                                                                      }
                                                              Severity: Major
                                                              Found in lib/xpath.js - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                        for (var m = xpc.contextNode; m != null; m = m.nodeType == 2 /*Node.ATTRIBUTE_NODE*/ ? this.getOwnerElement(m) : m.parentNode) {
                                                                                            if (step.nodeTest.matches(m, xpc)) {
                                                                                                newNodes.push(m);
                                                                                            }
                                                                                            if (m === xpc.virtualRoot) {
                                                                Severity: Major
                                                                Found in lib/xpath.js - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                          if (nnm != null) {
                                                                                              for (var k = 0; k < nnm.length; k++) {
                                                                                                  var m = nnm.item(k);
                                                                                                  if (step.nodeTest.matches(m, xpc)) {
                                                                                                      newNodes.push(m);
                                                                  Severity: Major
                                                                  Found in lib/xpath.js - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                            while (st.length > 0) {
                                                                                                for (var m = st.pop(); m != null; ) {
                                                                                                    if (step.nodeTest.matches(m, xpc)) {
                                                                                                        newNodes.push(m);
                                                                                                    }
                                                                    Severity: Major
                                                                    Found in lib/xpath.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                          if (this.predicateMatches(pred, xpc)) {
                                                                                              newNodes.push(xpc.contextNode);
                                                                                          } else {
                                                                                          }
                                                                      Severity: Major
                                                                      Found in lib/xpath.js - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                                if (step.nodeTest.matches(xpc.contextNode, xpc)) {
                                                                                                    newNodes.push(xpc.contextNode);
                                                                                                }
                                                                        Severity: Major
                                                                        Found in lib/xpath.js - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                                  for (var m = xpc.contextNode.firstChild; m != null; m = m.nextSibling) {
                                                                                                      if (step.nodeTest.matches(m, xpc)) {
                                                                                                          newNodes.push(m);
                                                                                                      }
                                                                                                  }
                                                                          Severity: Major
                                                                          Found in lib/xpath.js - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                    outer: while (st.length > 0) {
                                                                                                        for (var m = st.pop(); m != null; ) {
                                                                                                            if (m == xpc.contextNode) {
                                                                                                                break outer;
                                                                                                            }
                                                                            Severity: Major
                                                                            Found in lib/xpath.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                  if (name == "and") {
                                                                                                      types.push(XPathParser.AND);
                                                                                                      values.push(name);
                                                                                                      continue;
                                                                                                  }
                                                                              Severity: Major
                                                                              Found in lib/xpath.js - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                    if (name == "div") {
                                                                                                        types.push(XPathParser.DIV);
                                                                                                        values.push(name);
                                                                                                        continue;
                                                                                                    }
                                                                                Severity: Major
                                                                                Found in lib/xpath.js - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                          if (xpc.contextNode === xpc.virtualRoot) {
                                                                                                              break;
                                                                                                          }
                                                                                  Severity: Major
                                                                                  Found in lib/xpath.js - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                        if (this.predicateMatches(pred, xpc)) {
                                                                                                            newNodes.push(xpc.contextNode);
                                                                                                        }
                                                                                    Severity: Major
                                                                                    Found in lib/xpath.js - About 45 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                          if (nodes[0].ownerDocument == null) {
                                                                                                              // IE 5.5 doesn't have ownerDocument?
                                                                                                              var n = nodes[0];
                                                                                                              while (n.parentNode != null) {
                                                                                                                  n = n.parentNode;
                                                                                      Severity: Major
                                                                                      Found in lib/xpath.js - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                                if (m != null && step.nodeTest.matches(m, xpc)) {
                                                                                                                    newNodes.push(m);
                                                                                                                }
                                                                                        Severity: Major
                                                                                        Found in lib/xpath.js - About 45 mins to fix

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

                                                                                          Utilities.resolveQName = function(qn, nr, n, useDefault) {
                                                                                              var parts = Utilities.splitQName(qn);
                                                                                              if (parts[0] != null) {
                                                                                                  parts[0] = nr.getNamespace(parts[0], n);
                                                                                              } else {
                                                                                          Severity: Minor
                                                                                          Found in lib/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

                                                                                                              while (c >= '0' && c <= '9') {
                                                                                                                  number += c;
                                                                                                                  c = s.charAt(pos++);
                                                                                                              }
                                                                                          Severity: Major
                                                                                          Found in lib/xpath.js - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                                while (Utilities.isNCNameChar(c.charCodeAt(0))) {
                                                                                                                    name += c;
                                                                                                                    c = s.charAt(pos++);
                                                                                                                }
                                                                                            Severity: Major
                                                                                            Found in lib/xpath.js - About 45 mins to fix

                                                                                              Avoid deeply nested control flow statements.
                                                                                              Open

                                                                                                                      if (xpc.contextNode === xpc.virtualRoot) {
                                                                                                                          break;
                                                                                                                      }
                                                                                              Severity: Major
                                                                                              Found in lib/xpath.js - About 45 mins to fix

                                                                                                Avoid deeply nested control flow statements.
                                                                                                Open

                                                                                                                        if (xpc.contextNode.firstChild != null) {
                                                                                                                            st.unshift(xpc.contextNode.firstChild);
                                                                                                                        } else {
                                                                                                                            st.unshift(xpc.contextNode.nextSibling);
                                                                                                                        }
                                                                                                Severity: Major
                                                                                                Found in lib/xpath.js - About 45 mins to fix

                                                                                                  Avoid deeply nested control flow statements.
                                                                                                  Open

                                                                                                                          if (xpc.virtualRoot != null) {
                                                                                                                              st = [ xpc.virtualRoot ];
                                                                                                                          } else {
                                                                                                                              st = xpc.contextNode.nodeType == 9 /*Node.DOCUMENT_NODE*/
                                                                                                                                  ? [ xpc.contextNode ]
                                                                                                  Severity: Major
                                                                                                  Found in lib/xpath.js - About 45 mins to fix

                                                                                                    Avoid deeply nested control flow statements.
                                                                                                    Open

                                                                                                                            while (st.length > 0) {
                                                                                                                                for (var m = st.pop(); m != null; ) {
                                                                                                                                    if (step.nodeTest.matches(m, xpc)) {
                                                                                                                                        newNodes.push(m);
                                                                                                                                    }
                                                                                                    Severity: Major
                                                                                                    Found in lib/xpath.js - About 45 mins to fix

                                                                                                      Avoid deeply nested control flow statements.
                                                                                                      Open

                                                                                                                              do {
                                                                                                                                  for (var m = st.pop(); m != null; ) {
                                                                                                                                      if (step.nodeTest.matches(m, xpc)) {
                                                                                                                                          newNodes.push(m);
                                                                                                                                      }
                                                                                                      Severity: Major
                                                                                                      Found in lib/xpath.js - About 45 mins to fix

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                                for (var m = xpc.contextNode.parentNode; m != null && m.nodeType != 9 /*Node.DOCUMENT_NODE*/ && m !== xpc.virtualRoot; m = m.parentNode) {
                                                                                                                                    st.unshift(m.nextSibling);
                                                                                                                                }
                                                                                                        Severity: Major
                                                                                                        Found in lib/xpath.js - About 45 mins to fix

                                                                                                          Avoid deeply nested control flow statements.
                                                                                                          Open

                                                                                                                              if (name == "or") {
                                                                                                                                  types.push(XPathParser.OR);
                                                                                                                                  values.push(name);
                                                                                                                                  continue;
                                                                                                                              }
                                                                                                          Severity: Major
                                                                                                          Found in lib/xpath.js - About 45 mins to fix

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

                                                                                                                doc.evaluate = function(e, cn, r, t, res) {
                                                                                                            Severity: Minor
                                                                                                            Found in lib/xpath.js - About 35 mins to fix

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

                                                                                                              Functions.name = function() {
                                                                                                                  var c = arguments[0];
                                                                                                                  var n;
                                                                                                                  if (arguments.length == 1) {
                                                                                                                      n = c.contextNode;
                                                                                                              Severity: Minor
                                                                                                              Found in lib/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

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                  return 1;
                                                                                                              Severity: Major
                                                                                                              Found in lib/xpath.js - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                                return;
                                                                                                                Severity: Major
                                                                                                                Found in lib/xpath.js - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                              return Step.FOLLOWING;
                                                                                                                  Severity: Major
                                                                                                                  Found in lib/xpath.js - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this function.
                                                                                                                    Open

                                                                                                                                return Step.SELF;
                                                                                                                    Severity: Major
                                                                                                                    Found in lib/xpath.js - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this function.
                                                                                                                      Open

                                                                                                                                  return Step.NAMESPACE;
                                                                                                                      Severity: Major
                                                                                                                      Found in lib/xpath.js - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this function.
                                                                                                                        Open

                                                                                                                                        return;
                                                                                                                        Severity: Major
                                                                                                                        Found in lib/xpath.js - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                                      return Step.FOLLOWINGSIBLING;
                                                                                                                          Severity: Major
                                                                                                                          Found in lib/xpath.js - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

                                                                                                                                        return Step.DESCENDANT;
                                                                                                                            Severity: Major
                                                                                                                            Found in lib/xpath.js - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

                                                                                                                                          return Step.PRECEDING;
                                                                                                                              Severity: Major
                                                                                                                              Found in lib/xpath.js - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                Open

                                                                                                                                            return Step.PARENT;
                                                                                                                                Severity: Major
                                                                                                                                Found in lib/xpath.js - About 30 mins to fix

                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                  Open

                                                                                                                                              return Step.PRECEDINGSIBLING;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in lib/xpath.js - About 30 mins to fix

                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                    Open

                                                                                                                                                return Step.DESCENDANTORSELF;
                                                                                                                                    Severity: Major
                                                                                                                                    Found in lib/xpath.js - About 30 mins to fix

                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                      Open

                                                                                                                                                          return test[0] == node[0] && String(test[1]).toLowerCase() == String(node[1]).toLowerCase();
                                                                                                                                      Severity: Major
                                                                                                                                      Found in lib/xpath.js - About 30 mins to fix

                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                        Open

                                                                                                                                                    return false;
                                                                                                                                        Severity: Major
                                                                                                                                        Found in lib/xpath.js - About 30 mins to fix

                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                          Open

                                                                                                                                              return false;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in lib/xpath.js - About 30 mins to fix

                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                            Open

                                                                                                                                                    return -1;
                                                                                                                                            Severity: Major
                                                                                                                                            Found in lib/xpath.js - About 30 mins to fix

                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                              Open

                                                                                                                                                      return new NodeTest(-1, undefined);
                                                                                                                                              Severity: Major
                                                                                                                                              Found in lib/xpath.js - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                Open

                                                                                                                                                                return test[0] == node[0] && test[1] == node[1];
                                                                                                                                                Severity: Major
                                                                                                                                                Found in lib/xpath.js - About 30 mins to fix

                                                                                                                                                  Function getElementById has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                  Open

                                                                                                                                                  Utilities.getElementById = function(n, id) {
                                                                                                                                                      // Note that this does not check the DTD to check for actual
                                                                                                                                                      // attributes of type ID, so this may be a bit wrong.
                                                                                                                                                      if (n.nodeType == 1 /*Node.ELEMENT_NODE*/) {
                                                                                                                                                          if (n.getAttribute("id") == id
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/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 selectWithResolver has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                  Open

                                                                                                                                                  exports.selectWithResolver = function(e, doc, resolver, single) {
                                                                                                                                                      var expression = new XPathExpression(e, resolver, new XPathParser());
                                                                                                                                                      var type = XPathResult.ANY_TYPE;
                                                                                                                                                  
                                                                                                                                                      var result = expression.evaluate(doc, type, null);
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/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 lang has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                  Open

                                                                                                                                                  Functions.lang = function() {
                                                                                                                                                      var c = arguments[0];
                                                                                                                                                      if (arguments.length != 2) {
                                                                                                                                                          throw new Error("Function lang expects (string)");
                                                                                                                                                      }
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/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 compareWithNodeSet has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                  Open

                                                                                                                                                  XNodeSet.prototype.compareWithNodeSet = function(r, o) {
                                                                                                                                                      var a = this.toArray();
                                                                                                                                                      for (var i = 0; i < a.length; i++) {
                                                                                                                                                          var n = a[i];
                                                                                                                                                          var l = new XString(this.stringForNode(n));
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/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

                                                                                                                                                      return c >= 0x0030 && c <= 0x0039 
                                                                                                                                                          || c >= 0x0660 && c <= 0x0669 
                                                                                                                                                          || c >= 0x06F0 && c <= 0x06F9 
                                                                                                                                                          || c >= 0x0966 && c <= 0x096F 
                                                                                                                                                          || c >= 0x09E6 && c <= 0x09EF 
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 day to fix
                                                                                                                                                  lib/xpath.js on lines 3680..3696

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

                                                                                                                                                  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

                                                                                                                                                      return c >= 0x0041 && c <= 0x005A ||
                                                                                                                                                          c >= 0x0061 && c <= 0x007A ||
                                                                                                                                                          c >= 0x00C0 && c <= 0x00D6 ||
                                                                                                                                                          c >= 0x00D8 && c <= 0x00F6 ||
                                                                                                                                                          c >= 0x00F8 && c <= 0x00FF ||
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 day to fix
                                                                                                                                                  lib/xpath.js on lines 3888..3904

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

                                                                                                                                                  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 (last != XPathParser.AT
                                                                                                                                                                          && last != XPathParser.DOUBLECOLON
                                                                                                                                                                          && last != XPathParser.LEFTPARENTHESIS
                                                                                                                                                                          && last != XPathParser.LEFTBRACKET
                                                                                                                                                                          && last != XPathParser.AND
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 day to fix
                                                                                                                                                  lib/xpath.js on lines 912..936

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

                                                                                                                                                  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 (last != XPathParser.AT
                                                                                                                                                                          && last != XPathParser.DOUBLECOLON
                                                                                                                                                                          && last != XPathParser.LEFTPARENTHESIS
                                                                                                                                                                          && last != XPathParser.LEFTBRACKET
                                                                                                                                                                          && last != XPathParser.AND
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 day to fix
                                                                                                                                                  lib/xpath.js on lines 1014..1054

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

                                                                                                                                                  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

                                                                                                                                                  AVLTree.prototype.rotateLL = function() {
                                                                                                                                                      // the left side is too long => rotate from the left (_not_ leftwards)
                                                                                                                                                      var nodeBefore = this.node;
                                                                                                                                                      var rightBefore = this.right;
                                                                                                                                                      this.node = this.left.node;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 6 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2729..2741

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

                                                                                                                                                  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

                                                                                                                                                  AVLTree.prototype.rotateRR = function() {
                                                                                                                                                      // the right side is too long => rotate from the right (_not_ rightwards)
                                                                                                                                                      var nodeBefore = this.node;
                                                                                                                                                      var leftBefore = this.left;
                                                                                                                                                      this.node = this.right.node;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 6 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2715..2727

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

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

                                                                                                                                                  XNodeSet.prototype.greaterthan = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XString)) {
                                                                                                                                                          return this.compareWithNumber(r.number(), Operators.greaterthan);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XNumber)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 5 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3034..3045
                                                                                                                                                  lib/xpath.js on lines 3060..3071
                                                                                                                                                  lib/xpath.js on lines 3073..3084

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

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

                                                                                                                                                  XNodeSet.prototype.lessthanorequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XString)) {
                                                                                                                                                          return this.compareWithNumber(r.number(), Operators.lessthanorequal);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XNumber)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 5 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3034..3045
                                                                                                                                                  lib/xpath.js on lines 3047..3058
                                                                                                                                                  lib/xpath.js on lines 3073..3084

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

                                                                                                                                                  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

                                                                                                                                                  XNumber.prototype.notequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XBoolean)) {
                                                                                                                                                          return this.bool().notequal(r);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XString)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 5 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2479..2490

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

                                                                                                                                                  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

                                                                                                                                                  XNumber.prototype.equals = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XBoolean)) {
                                                                                                                                                          return this.bool().equals(r);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XString)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 5 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2492..2503

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

                                                                                                                                                  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

                                                                                                                                                  XString.prototype.notequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XBoolean)) {
                                                                                                                                                          return this.bool().notequal(r);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XNumber)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 5 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2369..2380

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

                                                                                                                                                  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

                                                                                                                                                  XString.prototype.equals = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XBoolean)) {
                                                                                                                                                          return this.bool().equals(r);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XNumber)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 5 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2382..2393

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

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

                                                                                                                                                  XNodeSet.prototype.greaterthanorequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XString)) {
                                                                                                                                                          return this.compareWithNumber(r.number(), Operators.greaterthanorequal);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XNumber)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 5 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3034..3045
                                                                                                                                                  lib/xpath.js on lines 3047..3058
                                                                                                                                                  lib/xpath.js on lines 3060..3071

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

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

                                                                                                                                                  XNodeSet.prototype.lessthan = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XString)) {
                                                                                                                                                          return this.compareWithNumber(r.number(), Operators.lessthan);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XNumber)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 5 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3047..3058
                                                                                                                                                  lib/xpath.js on lines 3060..3071
                                                                                                                                                  lib/xpath.js on lines 3073..3084

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

                                                                                                                                                  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

                                                                                                                                                  XNodeSet.prototype.notequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XString)) {
                                                                                                                                                          return this.compareWithString(r, Operators.notequal);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XNumber)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3008..3019

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

                                                                                                                                                  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

                                                                                                                                                  XNodeSet.prototype.equals = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XString)) {
                                                                                                                                                          return this.compareWithString(r, Operators.equals);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XNumber)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3021..3032

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

                                                                                                                                                  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

                                                                                                                                                  XNodeSet.prototype.compareWithString = function(r, o) {
                                                                                                                                                      var a = this.toArray();
                                                                                                                                                      for (var i = 0; i < a.length; i++) {
                                                                                                                                                          var n = a[i];
                                                                                                                                                          var l = new XString(this.stringForNode(n));
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2973..2984

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

                                                                                                                                                  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

                                                                                                                                                  XNodeSet.prototype.compareWithNumber = function(r, o) {
                                                                                                                                                      var a = this.toArray();
                                                                                                                                                      for (var i = 0; i < a.length; i++) {
                                                                                                                                                          var n = a[i];
                                                                                                                                                          var l = new XNumber(this.stringForNode(n));
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2960..2971

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

                                                                                                                                                  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 (st.length > 0) {
                                                                                                                                                                              for (var m = st.pop(); m != null; ) {
                                                                                                                                                                                  if (step.nodeTest.matches(m, xpc)) {
                                                                                                                                                                                      newNodes.push(m);
                                                                                                                                                                                  }
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 1799..1811

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

                                                                                                                                                  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 (st.length > 0) {
                                                                                                                                                                              for (var m = st.pop(); m != null; ) {
                                                                                                                                                                                  if (step.nodeTest.matches(m, xpc)) {
                                                                                                                                                                                      newNodes.push(m);
                                                                                                                                                                                  }
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 1777..1789

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

                                                                                                                                                  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 (c == '<') {
                                                                                                                                                              if (s.charAt(pos) == '=') {
                                                                                                                                                                  types.push(XPathParser.LESSTHANOREQUAL);
                                                                                                                                                                  values.push("<=");
                                                                                                                                                                  pos++;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 991..1003

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

                                                                                                                                                  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 (c == '>') {
                                                                                                                                                              if (s.charAt(pos) == '=') {
                                                                                                                                                                  types.push(XPathParser.GREATERTHANOREQUAL);
                                                                                                                                                                  values.push(">=");
                                                                                                                                                                  pos++;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 977..989

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

                                                                                                                                                  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

                                                                                                                                                  XPathParser.actionTable = [
                                                                                                                                                      " s s        sssssssss    s ss  s  ss",
                                                                                                                                                      "                 s                  ",
                                                                                                                                                      "r  rrrrrrrrr         rrrrrrr rr  r  ",
                                                                                                                                                      "                rrrrr               ",
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 2 other locations - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 436..545
                                                                                                                                                  lib/xpath.js on lines 547..656

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

                                                                                                                                                  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

                                                                                                                                                  XPathParser.gotoTable = [
                                                                                                                                                      "3456789:;<=>?@ AB  CDEFGH IJ ",
                                                                                                                                                      "                             ",
                                                                                                                                                      "                             ",
                                                                                                                                                      "                             ",
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 2 other locations - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 325..434
                                                                                                                                                  lib/xpath.js on lines 436..545

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

                                                                                                                                                  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

                                                                                                                                                  XPathParser.actionTableNumber = [
                                                                                                                                                      " 1 0        /.-,+*)('    & %$  #  \"!",
                                                                                                                                                      "                 J                  ",
                                                                                                                                                      "a  aaaaaaaaa         aaaaaaa aa  a  ",
                                                                                                                                                      "                YYYYY               ",
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 2 other locations - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 325..434
                                                                                                                                                  lib/xpath.js on lines 547..656

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

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

                                                                                                                                                  XNumber.prototype.lessthan = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this, Operators.greaterthanorequal);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2515..2523
                                                                                                                                                  lib/xpath.js on lines 2525..2533
                                                                                                                                                  lib/xpath.js on lines 2535..2543

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

                                                                                                                                                  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

                                                                                                                                                  XBoolean.prototype.equals = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XString) || Utilities.instance_of(r, XNumber)) {
                                                                                                                                                          return this.equals(r.bool());
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2631..2639

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

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

                                                                                                                                                  XNumber.prototype.greaterthan = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this, Operators.lessthanorequal);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2505..2513
                                                                                                                                                  lib/xpath.js on lines 2525..2533
                                                                                                                                                  lib/xpath.js on lines 2535..2543

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

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

                                                                                                                                                  XNumber.prototype.greaterthanorequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this, Operators.lessthan);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2505..2513
                                                                                                                                                  lib/xpath.js on lines 2515..2523
                                                                                                                                                  lib/xpath.js on lines 2525..2533

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

                                                                                                                                                  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

                                                                                                                                                  XBoolean.prototype.notequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XString) || Utilities.instance_of(r, XNumber)) {
                                                                                                                                                          return this.notequal(r.bool());
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2621..2629

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

                                                                                                                                                  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 (ldepth + 1 < rdepth) {
                                                                                                                                                          // RR or RL rorarion
                                                                                                                                                          var rrdepth = this.right.right == null ? 0 : this.right.right.depth;
                                                                                                                                                          var rldepth = this.right.left  == null ? 0 : this.right.left.depth;
                                                                                                                                                       
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2690..2712

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

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

                                                                                                                                                  XNumber.prototype.lessthanorequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this, Operators.greaterthan);
                                                                                                                                                      }
                                                                                                                                                      if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2505..2513
                                                                                                                                                  lib/xpath.js on lines 2515..2523
                                                                                                                                                  lib/xpath.js on lines 2535..2543

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

                                                                                                                                                  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 (ldepth > rdepth + 1) {
                                                                                                                                                          // LR or LL rotation
                                                                                                                                                          var lldepth = this.left.left  == null ? 0 : this.left.left.depth;
                                                                                                                                                          var lrdepth = this.left.right == null ? 0 : this.left.right.depth;
                                                                                                                                                  
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 4 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2701..2712

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

                                                                                                                                                  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 Step.PRECEDINGSIBLING:
                                                                                                                                                                          if (xpc.contextNode === xpc.virtualRoot) {
                                                                                                                                                                              break;
                                                                                                                                                                          }
                                                                                                                                                                          for (var m = xpc.contextNode.previousSibling; m != null; m = m.previousSibling) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 3 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 1842..1851

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

                                                                                                                                                  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 Step.FOLLOWINGSIBLING:
                                                                                                                                                                          if (xpc.contextNode === xpc.virtualRoot) {
                                                                                                                                                                              break;
                                                                                                                                                                          }
                                                                                                                                                                          for (var m = xpc.contextNode.nextSibling; m != null; m = m.nextSibling) {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 3 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 1924..1933

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

                                                                                                                                                  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 (arguments.length == 1) {
                                                                                                                                                          s = XNodeSet.prototype.stringForNode(c.contextNode);
                                                                                                                                                      } else if (arguments.length == 2) {
                                                                                                                                                          s = arguments[1].evaluate(c).stringValue();
                                                                                                                                                      } else {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3474..3480

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

                                                                                                                                                  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 (arguments.length == 1) {
                                                                                                                                                          s = XNodeSet.prototype.stringForNode(c.contextNode);
                                                                                                                                                      } else if (arguments.length == 2) {
                                                                                                                                                          s = arguments[1].evaluate(c).stringValue();
                                                                                                                                                      } else {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3487..3493

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

                                                                                                                                                  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

                                                                                                                                                  XBoolean.prototype.greaterthanorequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this.number(), Operators.lessthan);
                                                                                                                                                      }
                                                                                                                                                      return this.number().greaterthanorequal(r.number());
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2416..2421

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

                                                                                                                                                  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

                                                                                                                                                  XString.prototype.greaterthanorequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this.number(), Operators.lessthan);
                                                                                                                                                      }
                                                                                                                                                      return this.number().greaterthanorequal(r.number());
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2662..2667

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  XString.prototype.lessthan = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this.number(), Operators.greaterthanorequal);
                                                                                                                                                      }
                                                                                                                                                      return this.number().lessthan(r.number());
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2402..2407
                                                                                                                                                  lib/xpath.js on lines 2409..2414
                                                                                                                                                  lib/xpath.js on lines 2641..2646
                                                                                                                                                  lib/xpath.js on lines 2648..2653
                                                                                                                                                  lib/xpath.js on lines 2655..2660

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  XString.prototype.greaterthan = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this.number(), Operators.lessthanorequal);
                                                                                                                                                      }
                                                                                                                                                      return this.number().greaterthan(r.number());
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2395..2400
                                                                                                                                                  lib/xpath.js on lines 2409..2414
                                                                                                                                                  lib/xpath.js on lines 2641..2646
                                                                                                                                                  lib/xpath.js on lines 2648..2653
                                                                                                                                                  lib/xpath.js on lines 2655..2660

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  XString.prototype.lessthanorequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this.number(), Operators.greaterthan);
                                                                                                                                                      }
                                                                                                                                                      return this.number().lessthanorequal(r.number());
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2395..2400
                                                                                                                                                  lib/xpath.js on lines 2402..2407
                                                                                                                                                  lib/xpath.js on lines 2641..2646
                                                                                                                                                  lib/xpath.js on lines 2648..2653
                                                                                                                                                  lib/xpath.js on lines 2655..2660

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  XBoolean.prototype.lessthanorequal = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this.number(), Operators.greaterthan);
                                                                                                                                                      }
                                                                                                                                                      return this.number().lessthanorequal(r.number());
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2395..2400
                                                                                                                                                  lib/xpath.js on lines 2402..2407
                                                                                                                                                  lib/xpath.js on lines 2409..2414
                                                                                                                                                  lib/xpath.js on lines 2641..2646
                                                                                                                                                  lib/xpath.js on lines 2648..2653

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  XBoolean.prototype.greaterthan = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this.number(), Operators.lessthanorequal);
                                                                                                                                                      }
                                                                                                                                                      return this.number().greaterthan(r.number());
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2395..2400
                                                                                                                                                  lib/xpath.js on lines 2402..2407
                                                                                                                                                  lib/xpath.js on lines 2409..2414
                                                                                                                                                  lib/xpath.js on lines 2641..2646
                                                                                                                                                  lib/xpath.js on lines 2655..2660

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  XBoolean.prototype.lessthan = function(r) {
                                                                                                                                                      if (Utilities.instance_of(r, XNodeSet)) {
                                                                                                                                                          return r.compareWithNumber(this.number(), Operators.greaterthanorequal);
                                                                                                                                                      }
                                                                                                                                                      return this.number().lessthan(r.number());
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2395..2400
                                                                                                                                                  lib/xpath.js on lines 2402..2407
                                                                                                                                                  lib/xpath.js on lines 2409..2414
                                                                                                                                                  lib/xpath.js on lines 2648..2653
                                                                                                                                                  lib/xpath.js on lines 2655..2660

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

                                                                                                                                                  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

                                                                                                                                                  Functions.floor = function() {
                                                                                                                                                      var c = arguments[0];
                                                                                                                                                      if (arguments.length != 2) {
                                                                                                                                                          throw new Error("Function floor expects (number)");
                                                                                                                                                      }
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3630..3636

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

                                                                                                                                                  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

                                                                                                                                                  Functions.ceiling = function() {
                                                                                                                                                      var c = arguments[0];
                                                                                                                                                      if (arguments.length != 2) {
                                                                                                                                                          throw new Error("Function ceiling expects (number)");
                                                                                                                                                      }
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3622..3628

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

                                                                                                                                                  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 (o == -1) {
                                                                                                                                                          if (this.left == null) {
                                                                                                                                                              this.left = new AVLTree(n);
                                                                                                                                                              ret = true;
                                                                                                                                                          } else {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2818..2828

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

                                                                                                                                                  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 (o == 1) {
                                                                                                                                                          if (this.right == null) {
                                                                                                                                                              this.right = new AVLTree(n);
                                                                                                                                                              ret = true;
                                                                                                                                                          } else {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 2808..2828

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

                                                                                                                                                  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 (c == ':') {
                                                                                                                                                              if (s.charAt(pos) == ':') {
                                                                                                                                                                  types.push(XPathParser.DOUBLECOLON);
                                                                                                                                                                  values.push("::");
                                                                                                                                                                  pos++;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 967..975

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                      if (arguments.length == 1) {
                                                                                                                                                          n = c.contextNode;
                                                                                                                                                      } else if (arguments.length == 2) {
                                                                                                                                                          n = arguments[1].evaluate(c).first();
                                                                                                                                                      } else {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 2 other locations - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3340..3346
                                                                                                                                                  lib/xpath.js on lines 3356..3362

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                      if (arguments.length == 1) {
                                                                                                                                                          n = c.contextNode;
                                                                                                                                                      } else if (arguments.length == 2) {
                                                                                                                                                          n = arguments[1].evaluate(c).first();
                                                                                                                                                      } else {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 2 other locations - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3356..3362
                                                                                                                                                  lib/xpath.js on lines 3372..3378

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

                                                                                                                                                  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 (c == '!') {
                                                                                                                                                              if (s.charAt(pos) == '=') {
                                                                                                                                                                  types.push(XPathParser.NOTEQUAL);
                                                                                                                                                                  values.push("!=");
                                                                                                                                                                  pos++;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 944..952

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                      if (arguments.length == 1) {
                                                                                                                                                          n = c.contextNode;
                                                                                                                                                      } else if (arguments.length == 2) {
                                                                                                                                                          n = arguments[1].evaluate(c).first();
                                                                                                                                                      } else {
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 2 other locations - About 2 hrs to fix
                                                                                                                                                  lib/xpath.js on lines 3340..3346
                                                                                                                                                  lib/xpath.js on lines 3372..3378

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

                                                                                                                                                  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.steps.length; i++) {
                                                                                                                                                          if (i != 0) {
                                                                                                                                                              s += "/";
                                                                                                                                                          }
                                                                                                                                                          s += this.steps[i].toString();
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 2299..2304

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

                                                                                                                                                  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.arguments.length; i++) {
                                                                                                                                                          if (i > 0) {
                                                                                                                                                              s += ", ";
                                                                                                                                                          }
                                                                                                                                                          s += this.arguments[i].toString();
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 2050..2055

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  PlusOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).number().plus(this.rhs.evaluate(c).number());
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1532..1534
                                                                                                                                                  lib/xpath.js on lines 1556..1558
                                                                                                                                                  lib/xpath.js on lines 1580..1582
                                                                                                                                                  lib/xpath.js on lines 1604..1606
                                                                                                                                                  lib/xpath.js on lines 1628..1630

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  MultiplyOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).number().multiply(this.rhs.evaluate(c).number());
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1508..1510
                                                                                                                                                  lib/xpath.js on lines 1532..1534
                                                                                                                                                  lib/xpath.js on lines 1580..1582
                                                                                                                                                  lib/xpath.js on lines 1604..1606
                                                                                                                                                  lib/xpath.js on lines 1628..1630

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  BarOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).nodeset().union(this.rhs.evaluate(c).nodeset());
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1508..1510
                                                                                                                                                  lib/xpath.js on lines 1532..1534
                                                                                                                                                  lib/xpath.js on lines 1556..1558
                                                                                                                                                  lib/xpath.js on lines 1580..1582
                                                                                                                                                  lib/xpath.js on lines 1604..1606

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  MinusOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).number().minus(this.rhs.evaluate(c).number());
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1508..1510
                                                                                                                                                  lib/xpath.js on lines 1556..1558
                                                                                                                                                  lib/xpath.js on lines 1580..1582
                                                                                                                                                  lib/xpath.js on lines 1604..1606
                                                                                                                                                  lib/xpath.js on lines 1628..1630

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  DivOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).number().div(this.rhs.evaluate(c).number());
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1508..1510
                                                                                                                                                  lib/xpath.js on lines 1532..1534
                                                                                                                                                  lib/xpath.js on lines 1556..1558
                                                                                                                                                  lib/xpath.js on lines 1604..1606
                                                                                                                                                  lib/xpath.js on lines 1628..1630

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

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  ModOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).number().mod(this.rhs.evaluate(c).number());
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 5 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1508..1510
                                                                                                                                                  lib/xpath.js on lines 1532..1534
                                                                                                                                                  lib/xpath.js on lines 1556..1558
                                                                                                                                                  lib/xpath.js on lines 1580..1582
                                                                                                                                                  lib/xpath.js on lines 1628..1630

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

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

                                                                                                                                                  GreaterThanOrEqualOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " >= " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 8 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1416..1418
                                                                                                                                                  lib/xpath.js on lines 1440..1442
                                                                                                                                                  lib/xpath.js on lines 1464..1466
                                                                                                                                                  lib/xpath.js on lines 1512..1514
                                                                                                                                                  lib/xpath.js on lines 1536..1538
                                                                                                                                                  lib/xpath.js on lines 1560..1562
                                                                                                                                                  lib/xpath.js on lines 1584..1586
                                                                                                                                                  lib/xpath.js on lines 1608..1610

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

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

                                                                                                                                                  LessThanOrEqualOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " <= " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 8 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1416..1418
                                                                                                                                                  lib/xpath.js on lines 1440..1442
                                                                                                                                                  lib/xpath.js on lines 1488..1490
                                                                                                                                                  lib/xpath.js on lines 1512..1514
                                                                                                                                                  lib/xpath.js on lines 1536..1538
                                                                                                                                                  lib/xpath.js on lines 1560..1562
                                                                                                                                                  lib/xpath.js on lines 1584..1586
                                                                                                                                                  lib/xpath.js on lines 1608..1610

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

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

                                                                                                                                                  MultiplyOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " * " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 8 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1416..1418
                                                                                                                                                  lib/xpath.js on lines 1440..1442
                                                                                                                                                  lib/xpath.js on lines 1464..1466
                                                                                                                                                  lib/xpath.js on lines 1488..1490
                                                                                                                                                  lib/xpath.js on lines 1512..1514
                                                                                                                                                  lib/xpath.js on lines 1536..1538
                                                                                                                                                  lib/xpath.js on lines 1584..1586
                                                                                                                                                  lib/xpath.js on lines 1608..1610

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

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

                                                                                                                                                  GreaterThanOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " > " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 8 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1416..1418
                                                                                                                                                  lib/xpath.js on lines 1464..1466
                                                                                                                                                  lib/xpath.js on lines 1488..1490
                                                                                                                                                  lib/xpath.js on lines 1512..1514
                                                                                                                                                  lib/xpath.js on lines 1536..1538
                                                                                                                                                  lib/xpath.js on lines 1560..1562
                                                                                                                                                  lib/xpath.js on lines 1584..1586
                                                                                                                                                  lib/xpath.js on lines 1608..1610

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

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

                                                                                                                                                  MinusOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " - " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 8 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1416..1418
                                                                                                                                                  lib/xpath.js on lines 1440..1442
                                                                                                                                                  lib/xpath.js on lines 1464..1466
                                                                                                                                                  lib/xpath.js on lines 1488..1490
                                                                                                                                                  lib/xpath.js on lines 1512..1514
                                                                                                                                                  lib/xpath.js on lines 1560..1562
                                                                                                                                                  lib/xpath.js on lines 1584..1586
                                                                                                                                                  lib/xpath.js on lines 1608..1610

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

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

                                                                                                                                                  ModOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " mod " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 8 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1416..1418
                                                                                                                                                  lib/xpath.js on lines 1440..1442
                                                                                                                                                  lib/xpath.js on lines 1464..1466
                                                                                                                                                  lib/xpath.js on lines 1488..1490
                                                                                                                                                  lib/xpath.js on lines 1512..1514
                                                                                                                                                  lib/xpath.js on lines 1536..1538
                                                                                                                                                  lib/xpath.js on lines 1560..1562
                                                                                                                                                  lib/xpath.js on lines 1584..1586

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

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

                                                                                                                                                  LessThanOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " < " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 8 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1440..1442
                                                                                                                                                  lib/xpath.js on lines 1464..1466
                                                                                                                                                  lib/xpath.js on lines 1488..1490
                                                                                                                                                  lib/xpath.js on lines 1512..1514
                                                                                                                                                  lib/xpath.js on lines 1536..1538
                                                                                                                                                  lib/xpath.js on lines 1560..1562
                                                                                                                                                  lib/xpath.js on lines 1584..1586
                                                                                                                                                  lib/xpath.js on lines 1608..1610

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

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

                                                                                                                                                  PlusOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " + " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 8 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1416..1418
                                                                                                                                                  lib/xpath.js on lines 1440..1442
                                                                                                                                                  lib/xpath.js on lines 1464..1466
                                                                                                                                                  lib/xpath.js on lines 1488..1490
                                                                                                                                                  lib/xpath.js on lines 1536..1538
                                                                                                                                                  lib/xpath.js on lines 1560..1562
                                                                                                                                                  lib/xpath.js on lines 1584..1586
                                                                                                                                                  lib/xpath.js on lines 1608..1610

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

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

                                                                                                                                                  DivOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " div " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 8 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1416..1418
                                                                                                                                                  lib/xpath.js on lines 1440..1442
                                                                                                                                                  lib/xpath.js on lines 1464..1466
                                                                                                                                                  lib/xpath.js on lines 1488..1490
                                                                                                                                                  lib/xpath.js on lines 1512..1514
                                                                                                                                                  lib/xpath.js on lines 1536..1538
                                                                                                                                                  lib/xpath.js on lines 1560..1562
                                                                                                                                                  lib/xpath.js on lines 1608..1610

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

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

                                                                                                                                                  AndOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " and " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1308..1310
                                                                                                                                                  lib/xpath.js on lines 1364..1366
                                                                                                                                                  lib/xpath.js on lines 1388..1390

                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                  Tuning

                                                                                                                                                  This issue has a mass of 61.

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  OrOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " or " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1336..1338
                                                                                                                                                  lib/xpath.js on lines 1364..1366
                                                                                                                                                  lib/xpath.js on lines 1388..1390

                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                  Tuning

                                                                                                                                                  This issue has a mass of 61.

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  EqualsOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " = " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1308..1310
                                                                                                                                                  lib/xpath.js on lines 1336..1338
                                                                                                                                                  lib/xpath.js on lines 1388..1390

                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                  Tuning

                                                                                                                                                  This issue has a mass of 61.

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  NotEqualOperation.prototype.toString = function() {
                                                                                                                                                      return "(" + this.lhs.toString() + " != " + this.rhs.toString() + ")";
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1308..1310
                                                                                                                                                  lib/xpath.js on lines 1336..1338
                                                                                                                                                  lib/xpath.js on lines 1364..1366

                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                  Tuning

                                                                                                                                                  This issue has a mass of 61.

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                                          if (xpc.contextNode.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) {
                                                                                                                                                                              m = this.getOwnerElement(xpc.contextNode);
                                                                                                                                                                          } else {
                                                                                                                                                                              m = xpc.contextNode.parentNode;
                                                                                                                                                                          }
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1886..1890

                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                  Tuning

                                                                                                                                                  This issue has a mass of 61.

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                                              if (xpc.contextNode.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) {
                                                                                                                                                                                  m = this.getOwnerElement(xpc.contextNode);
                                                                                                                                                                              } else {
                                                                                                                                                                                  m = xpc.contextNode.parentNode;
                                                                                                                                                                              }
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1724..1728

                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                  Tuning

                                                                                                                                                  This issue has a mass of 61.

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

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

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

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

                                                                                                                                                  Refactorings

                                                                                                                                                  Further Reading

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

                                                                                                                                                  Functions.position = function() {
                                                                                                                                                      var c = arguments[0];
                                                                                                                                                      if (arguments.length != 1) {
                                                                                                                                                          throw new Error("Function position expects ()");
                                                                                                                                                      }
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 3279..3285

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

                                                                                                                                                  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

                                                                                                                                                  Functions.last = function() {
                                                                                                                                                      var c = arguments[0];
                                                                                                                                                      if (arguments.length != 1) {
                                                                                                                                                          throw new Error("Function last expects ()");
                                                                                                                                                      }
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 3287..3293

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

                                                                                                                                                  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

                                                                                                                                                  EqualsOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).equals(this.rhs.evaluate(c));
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1392..1394

                                                                                                                                                  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

                                                                                                                                                  NotEqualOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).notequal(this.rhs.evaluate(c));
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1368..1370

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

                                                                                                                                                  LessThanOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).lessthan(this.rhs.evaluate(c));
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1436..1438
                                                                                                                                                  lib/xpath.js on lines 1460..1462
                                                                                                                                                  lib/xpath.js on lines 1484..1486

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

                                                                                                                                                  GreaterThanOrEqualOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).greaterthanorequal(this.rhs.evaluate(c));
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1412..1414
                                                                                                                                                  lib/xpath.js on lines 1436..1438
                                                                                                                                                  lib/xpath.js on lines 1460..1462

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

                                                                                                                                                  LessThanOrEqualOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).lessthanorequal(this.rhs.evaluate(c));
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1412..1414
                                                                                                                                                  lib/xpath.js on lines 1436..1438
                                                                                                                                                  lib/xpath.js on lines 1484..1486

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

                                                                                                                                                  GreaterThanOperation.prototype.evaluate = function(c) {
                                                                                                                                                      return this.lhs.evaluate(c).greaterthan(this.rhs.evaluate(c));
                                                                                                                                                  };
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 3 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 1412..1414
                                                                                                                                                  lib/xpath.js on lines 1460..1462
                                                                                                                                                  lib/xpath.js on lines 1484..1486

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

                                                                                                                                                          if (c == '(') {
                                                                                                                                                              types.push(XPathParser.LEFTPARENTHESIS);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 789..794
                                                                                                                                                  lib/xpath.js on lines 795..800
                                                                                                                                                  lib/xpath.js on lines 801..806
                                                                                                                                                  lib/xpath.js on lines 807..812
                                                                                                                                                  lib/xpath.js on lines 813..818
                                                                                                                                                  lib/xpath.js on lines 819..824
                                                                                                                                                  lib/xpath.js on lines 825..830
                                                                                                                                                  lib/xpath.js on lines 831..836
                                                                                                                                                  lib/xpath.js on lines 837..842
                                                                                                                                                  lib/xpath.js on lines 843..848

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

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

                                                                                                                                                          if (c == ')') {
                                                                                                                                                              types.push(XPathParser.RIGHTPARENTHESIS);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 783..788
                                                                                                                                                  lib/xpath.js on lines 795..800
                                                                                                                                                  lib/xpath.js on lines 801..806
                                                                                                                                                  lib/xpath.js on lines 807..812
                                                                                                                                                  lib/xpath.js on lines 813..818
                                                                                                                                                  lib/xpath.js on lines 819..824
                                                                                                                                                  lib/xpath.js on lines 825..830
                                                                                                                                                  lib/xpath.js on lines 831..836
                                                                                                                                                  lib/xpath.js on lines 837..842
                                                                                                                                                  lib/xpath.js on lines 843..848

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

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

                                                                                                                                                          if (c == '=') {
                                                                                                                                                              types.push(XPathParser.EQUALS);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 783..788
                                                                                                                                                  lib/xpath.js on lines 789..794
                                                                                                                                                  lib/xpath.js on lines 795..800
                                                                                                                                                  lib/xpath.js on lines 801..806
                                                                                                                                                  lib/xpath.js on lines 807..812
                                                                                                                                                  lib/xpath.js on lines 813..818
                                                                                                                                                  lib/xpath.js on lines 819..824
                                                                                                                                                  lib/xpath.js on lines 825..830
                                                                                                                                                  lib/xpath.js on lines 831..836
                                                                                                                                                  lib/xpath.js on lines 843..848

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

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

                                                                                                                                                          if (c == '[') {
                                                                                                                                                              types.push(XPathParser.LEFTBRACKET);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 783..788
                                                                                                                                                  lib/xpath.js on lines 789..794
                                                                                                                                                  lib/xpath.js on lines 801..806
                                                                                                                                                  lib/xpath.js on lines 807..812
                                                                                                                                                  lib/xpath.js on lines 813..818
                                                                                                                                                  lib/xpath.js on lines 819..824
                                                                                                                                                  lib/xpath.js on lines 825..830
                                                                                                                                                  lib/xpath.js on lines 831..836
                                                                                                                                                  lib/xpath.js on lines 837..842
                                                                                                                                                  lib/xpath.js on lines 843..848

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

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

                                                                                                                                                          if (c == ',') {
                                                                                                                                                              types.push(XPathParser.COMMA);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 783..788
                                                                                                                                                  lib/xpath.js on lines 789..794
                                                                                                                                                  lib/xpath.js on lines 795..800
                                                                                                                                                  lib/xpath.js on lines 801..806
                                                                                                                                                  lib/xpath.js on lines 807..812
                                                                                                                                                  lib/xpath.js on lines 819..824
                                                                                                                                                  lib/xpath.js on lines 825..830
                                                                                                                                                  lib/xpath.js on lines 831..836
                                                                                                                                                  lib/xpath.js on lines 837..842
                                                                                                                                                  lib/xpath.js on lines 843..848

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

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

                                                                                                                                                          if (c == '@') {
                                                                                                                                                              types.push(XPathParser.AT);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 783..788
                                                                                                                                                  lib/xpath.js on lines 789..794
                                                                                                                                                  lib/xpath.js on lines 795..800
                                                                                                                                                  lib/xpath.js on lines 801..806
                                                                                                                                                  lib/xpath.js on lines 813..818
                                                                                                                                                  lib/xpath.js on lines 819..824
                                                                                                                                                  lib/xpath.js on lines 825..830
                                                                                                                                                  lib/xpath.js on lines 831..836
                                                                                                                                                  lib/xpath.js on lines 837..842
                                                                                                                                                  lib/xpath.js on lines 843..848

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

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

                                                                                                                                                          if (c == ']') {
                                                                                                                                                              types.push(XPathParser.RIGHTBRACKET);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 783..788
                                                                                                                                                  lib/xpath.js on lines 789..794
                                                                                                                                                  lib/xpath.js on lines 795..800
                                                                                                                                                  lib/xpath.js on lines 807..812
                                                                                                                                                  lib/xpath.js on lines 813..818
                                                                                                                                                  lib/xpath.js on lines 819..824
                                                                                                                                                  lib/xpath.js on lines 825..830
                                                                                                                                                  lib/xpath.js on lines 831..836
                                                                                                                                                  lib/xpath.js on lines 837..842
                                                                                                                                                  lib/xpath.js on lines 843..848

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

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

                                                                                                                                                          if (c == '|') {
                                                                                                                                                              types.push(XPathParser.BAR);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 783..788
                                                                                                                                                  lib/xpath.js on lines 789..794
                                                                                                                                                  lib/xpath.js on lines 795..800
                                                                                                                                                  lib/xpath.js on lines 801..806
                                                                                                                                                  lib/xpath.js on lines 807..812
                                                                                                                                                  lib/xpath.js on lines 813..818
                                                                                                                                                  lib/xpath.js on lines 825..830
                                                                                                                                                  lib/xpath.js on lines 831..836
                                                                                                                                                  lib/xpath.js on lines 837..842
                                                                                                                                                  lib/xpath.js on lines 843..848

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

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

                                                                                                                                                          if (c == '+') {
                                                                                                                                                              types.push(XPathParser.PLUS);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 783..788
                                                                                                                                                  lib/xpath.js on lines 789..794
                                                                                                                                                  lib/xpath.js on lines 795..800
                                                                                                                                                  lib/xpath.js on lines 801..806
                                                                                                                                                  lib/xpath.js on lines 807..812
                                                                                                                                                  lib/xpath.js on lines 813..818
                                                                                                                                                  lib/xpath.js on lines 819..824
                                                                                                                                                  lib/xpath.js on lines 831..836
                                                                                                                                                  lib/xpath.js on lines 837..842
                                                                                                                                                  lib/xpath.js on lines 843..848

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

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

                                                                                                                                                          if (c == '-') {
                                                                                                                                                              types.push(XPathParser.MINUS);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 783..788
                                                                                                                                                  lib/xpath.js on lines 789..794
                                                                                                                                                  lib/xpath.js on lines 795..800
                                                                                                                                                  lib/xpath.js on lines 801..806
                                                                                                                                                  lib/xpath.js on lines 807..812
                                                                                                                                                  lib/xpath.js on lines 813..818
                                                                                                                                                  lib/xpath.js on lines 819..824
                                                                                                                                                  lib/xpath.js on lines 825..830
                                                                                                                                                  lib/xpath.js on lines 837..842
                                                                                                                                                  lib/xpath.js on lines 843..848

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

                                                                                                                                                  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 (c == '.') {
                                                                                                                                                                  types.push(XPathParser.DOUBLEDOT);
                                                                                                                                                                  values.push("..");
                                                                                                                                                                  c = s.charAt(pos++);
                                                                                                                                                                  continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 956..961

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

                                                                                                                                                  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 (c == '/') {
                                                                                                                                                                  types.push(XPathParser.DOUBLESLASH);
                                                                                                                                                                  values.push("//");
                                                                                                                                                                  c = s.charAt(pos++);
                                                                                                                                                                  continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 852..857

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

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

                                                                                                                                                          if (c == '$') {
                                                                                                                                                              types.push(XPathParser.DOLLAR);
                                                                                                                                                              values.push(c);
                                                                                                                                                              c = s.charAt(pos++);
                                                                                                                                                              continue;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/xpath.js and 10 other locations - About 1 hr to fix
                                                                                                                                                  lib/xpath.js on lines 783..788
                                                                                                                                                  lib/xpath.js on lines 789..794
                                                                                                                                                  lib/xpath.js on lines 795..800
                                                                                                                                                  lib/xpath.js on lines 801..806
                                                                                                                                                  lib/xpath.js on lines 807..812
                                                                                                                                                  lib/xpath.js on lines 813..818
                                                                                                                                                  lib/xpath.js on lines 819..824
                                                                                                                                                  lib/xpath.js on lines 825..830
                                                                                                                                                  lib/xpath.js on lines 831..836
                                                                                                                                                  lib/xpath.js on lines 837..842

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

                                                                                                                                                  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 (arguments.length != 2 || !Utilities.instance_of(ns = arguments[1].evaluate(c), XNodeSet)) {
                                                                                                                                                          throw new Error("Function count expects (node-set)");
                                                                                                                                                      }
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 55 mins to fix
                                                                                                                                                  lib/xpath.js on lines 3611..3613

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

                                                                                                                                                  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 (arguments.length != 2 || !Utilities.instance_of((ns = arguments[1].evaluate(c)), XNodeSet)) {
                                                                                                                                                          throw new Error("Function sum expects (node-set)");
                                                                                                                                                      }
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 55 mins to fix
                                                                                                                                                  lib/xpath.js on lines 3298..3300

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

                                                                                                                                                  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 (Utilities.isNCNameChar(c.charCodeAt(0))) {
                                                                                                                                                                          name += c;
                                                                                                                                                                          c = s.charAt(pos++);
                                                                                                                                                                      }
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 35 mins to fix
                                                                                                                                                  lib/xpath.js on lines 1008..1011

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

                                                                                                                                                  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

                                                                                                                                                      this.reduceActions[39] = function(rhs) {
                                                                                                                                                          rhs[2].unshift(rhs[0]);
                                                                                                                                                          return rhs[2];
                                                                                                                                                      };
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 35 mins to fix
                                                                                                                                                  lib/xpath.js on lines 239..242

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

                                                                                                                                                  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 (Utilities.isNCNameChar(c.charCodeAt(0))) {
                                                                                                                                                                  name += c;
                                                                                                                                                                  c = s.charAt(pos++);
                                                                                                                                                              }
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 35 mins to fix
                                                                                                                                                  lib/xpath.js on lines 1067..1070

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

                                                                                                                                                  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

                                                                                                                                                      this.reduceActions[55] = function(rhs) {
                                                                                                                                                          rhs[1].unshift(rhs[0]);
                                                                                                                                                          return rhs[1];
                                                                                                                                                      };
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 35 mins to fix
                                                                                                                                                  lib/xpath.js on lines 206..209

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

                                                                                                                                                  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 (this.resultType != XPathResult.UNORDERED_NODE_ITERATOR_TYPE
                                                                                                                                                              && this.resultType != XPathResult.ORDERED_NODE_ITERATOR_TYPE) {
                                                                                                                                                          throw new XPathException(XPathException.TYPE_ERR);
                                                                                                                                                      }
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 35 mins to fix
                                                                                                                                                  lib/xpath.js on lines 4220..4223

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

                                                                                                                                                  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 (this.resultType != XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE
                                                                                                                                                              && this.resultType != XPathResult.ORDERED_NODE_SNAPSHOT_TYPE) {
                                                                                                                                                          throw new XPathException(XPathException.TYPE_ERR);
                                                                                                                                                      }
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 35 mins to fix
                                                                                                                                                  lib/xpath.js on lines 4212..4215

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

                                                                                                                                                  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 (n.nodeType == 2 /*Node.ATTRIBUTE_NODE*/
                                                                                                                                                                      || n.nodeType == 1 /*Node.ELEMENT_NODE*/
                                                                                                                                                                      || n.nodeType == XPathNamespace.XPATH_NAMESPACE_NODE) {
                                                                                                                                                                  var test = Utilities.resolveQName(this.value, xpc.namespaceResolver, xpc.expressionContextNode, false);
                                                                                                                                                                  if (test[0] == null) {
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 35 mins to fix
                                                                                                                                                  lib/xpath.js on lines 2189..2193

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

                                                                                                                                                  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 (n.nodeType == 2 /*Node.ATTRIBUTE_NODE*/
                                                                                                                                                                      || n.nodeType == 1 /*Node.ELEMENT_NODE*/
                                                                                                                                                                      || n.nodeType == XPathNamespace.XPATH_NAMESPACE_NODE) {
                                                                                                                                                                  return true;
                                                                                                                                                              }
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 35 mins to fix
                                                                                                                                                  lib/xpath.js on lines 2205..2227

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

                                                                                                                                                  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

                                                                                                                                                  Functions.false_ = function() {
                                                                                                                                                      if (arguments.length != 1) {
                                                                                                                                                          throw new Error("Function false expects ()");
                                                                                                                                                      }
                                                                                                                                                      return new XBoolean(false);
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 30 mins to fix
                                                                                                                                                  lib/xpath.js on lines 3562..3567

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

                                                                                                                                                  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

                                                                                                                                                  Functions.true_ = function() {
                                                                                                                                                      if (arguments.length != 1) {
                                                                                                                                                          throw new Error("Function true expects ()");
                                                                                                                                                      }
                                                                                                                                                      return new XBoolean(true);
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/xpath.js and 1 other location - About 30 mins to fix
                                                                                                                                                  lib/xpath.js on lines 3569..3574

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

                                                                                                                                                  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