mambax7/smartobject

View on GitHub
include/projax/js/prototype.js

Summary

Maintainability
F
4 mos
Test Coverage

File prototype.js has 2128 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*  Prototype JavaScript framework, version 1.5.0
 *  (c) 2005-2007 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://prototype.conio.net/
Severity: Major
Found in include/projax/js/prototype.js - About 5 days to fix

    Methods has 43 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Element.Methods = {
        visible: function (element) {
            return $(element).style.display != 'none';
        },
    
    
    Severity: Minor
    Found in include/projax/js/prototype.js - About 5 hrs to fix

      Function setStyle has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          setStyle: function (element, style) {
              element = $(element);
              for (var name in style) {
                  var value = style[name];
                  if (name == 'opacity') {
      Severity: Minor
      Found in include/projax/js/prototype.js - About 4 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          getStyle: function (element, style) {
              element = $(element);
              if (['float', 'cssFloat'].include(style))
                  style = (typeof element.style.styleFloat != 'undefined' ? 'styleFloat' : 'cssFloat');
              style = style.camelize();
      Severity: Minor
      Found in include/projax/js/prototype.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

      Enumerable has 22 functions (exceeds 20 allowed). Consider refactoring.
      Open

      var Enumerable = {
          each: function (iterator) {
              var index = 0;
              try {
                  this._each(function (value) {
      Severity: Minor
      Found in include/projax/js/prototype.js - About 2 hrs to fix

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

            serializeElements: function (elements, getHash) {
                var data = elements.inject({}, function (result, element) {
                    if (!element.disabled && element.name) {
                        var key = element.name, value = $(element).getValue();
                        if (value != undefined) {
        Severity: Minor
        Found in include/projax/js/prototype.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 buildMatchExpression has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            buildMatchExpression: function () {
                var params = this.params, conditions = [], clause;
        
                if (params.wildcard)
                    conditions.push('true');
        Severity: Minor
        Found in include/projax/js/prototype.js - About 1 hr to fix

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

              setRequestHeaders: function () {
                  var headers = {
                      'X-Requested-With': 'XMLHttpRequest',
                      'X-Prototype-Version': Prototype.Version,
                      'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
          Severity: Minor
          Found in include/projax/js/prototype.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 update has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Element.Methods.update = function (element, html) {
                  element = $(element);
                  html = typeof html == 'undefined' ? '' : html.toString();
                  var tagName = element.tagName.toUpperCase();
                  if (['THEAD', 'TBODY', 'TR', 'TD'].include(tagName)) {
          Severity: Minor
          Found in include/projax/js/prototype.js - About 1 hr to fix

            Function request has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                request: function (url) {
                    this.url = url;
                    this.method = this.options.method;
                    var params = this.options.parameters;
            
            
            Severity: Minor
            Found in include/projax/js/prototype.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 concat has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                Array.prototype.concat = function () {
                    var array = [];
                    for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
                    for (var i = 0, length = arguments.length; i < length; i++) {
                        if (arguments[i].constructor == Array) {
            Severity: Minor
            Found in include/projax/js/prototype.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 extend has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            Element.extend = function (element) {
                if (!element || _nativeExtensions || element.nodeType == 3) return element;
            
                if (!element._extended && element.tagName && element != window) {
                    var methods = Object.clone(Element.Methods), cache = Element.extend.cache;
            Severity: Minor
            Found in include/projax/js/prototype.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 remove has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                remove: function () {
                    var result;
                    for (var i = 0, length = arguments.length; i < length; i++) {
                        var value = this[arguments[i]];
                        if (value !== undefined) {
            Severity: Minor
            Found in include/projax/js/prototype.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 initialize has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                initialize: function (element, content) {
                    this.element = $(element);
                    this.content = content.stripScripts();
            
                    if (this.adjacency && this.element.insertAdjacentHTML) {
            Severity: Minor
            Found in include/projax/js/prototype.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 parseExpression has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                parseExpression: function () {
                    function abort(message) {
                        throw 'Parse error in selector: ' + message;
                    }
            
            
            Severity: Minor
            Found in include/projax/js/prototype.js - About 1 hr to fix

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

                  request: function (url) {
                      this.url = url;
                      this.method = this.options.method;
                      var params = this.options.parameters;
              
              
              Severity: Minor
              Found in include/projax/js/prototype.js - About 1 hr to fix

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

                    page: function (forElement) {
                        var valueT = 0, valueL = 0;
                
                        var element = forElement;
                        do {
                Severity: Minor
                Found in include/projax/js/prototype.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 respondToReadyState has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    respondToReadyState: function (readyState) {
                        var state = Ajax.Request.Events[readyState];
                        var transport = this.transport, json = this.evalJSON();
                
                        if (state == 'Complete') {
                Severity: Minor
                Found in include/projax/js/prototype.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 findElements has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    findElements: function (scope) {
                        var element;
                
                        if (element = $(this.params.id))
                            if (this.match(element))
                Severity: Minor
                Found in include/projax/js/prototype.js - About 55 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function positionedOffset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    positionedOffset: function (element) {
                        var valueT = 0, valueL = 0;
                        do {
                            valueT += element.offsetTop || 0;
                            valueL += element.offsetLeft || 0;
                Severity: Minor
                Found in include/projax/js/prototype.js - About 55 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function cumulativeOffset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    Position.cumulativeOffset = function (element) {
                        var valueT = 0, valueL = 0;
                        do {
                            valueT += element.offsetTop || 0;
                            valueL += element.offsetLeft || 0;
                Severity: Minor
                Found in include/projax/js/prototype.js - About 55 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Avoid deeply nested control flow statements.
                Open

                                    if (/MSIE/.test(navigator.userAgent) && !window.opera)
                                        element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi, '');
                Severity: Major
                Found in include/projax/js/prototype.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if (value < 0.00001) value = 0;
                  Severity: Major
                  Found in include/projax/js/prototype.js - About 45 mins to fix

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

                        updateContent: function () {
                            var receiver = this.container[this.success() ? 'success' : 'failure'];
                            var response = this.transport.responseText;
                    
                            if (!this.options.evalScripts) response = response.stripScripts();
                    Severity: Minor
                    Found in include/projax/js/prototype.js - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                        parseExpression: function () {
                            function abort(message) {
                                throw 'Parse error in selector: ' + message;
                            }
                    
                    
                    Severity: Minor
                    Found in include/projax/js/prototype.js - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                        Element.Methods.update = function (element, html) {
                            element = $(element);
                            html = typeof html == 'undefined' ? '' : html.toString();
                            var tagName = element.tagName.toUpperCase();
                            if (['THEAD', 'TBODY', 'TR', 'TD'].include(tagName)) {
                    Severity: Minor
                    Found in include/projax/js/prototype.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

                                        if (/MSIE/.test(navigator.userAgent) && !window.opera)
                                            element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi, '') +
                                                'alpha(opacity=' + value * 100 + ')';
                    Severity: Major
                    Found in include/projax/js/prototype.js - About 45 mins to fix

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

                      Element.addMethods = function (methods) {
                          Object.extend(Element.Methods, methods || {});
                      
                          function copy(methods, destination, onlyIfAbsent) {
                              onlyIfAbsent = onlyIfAbsent || false;
                      Severity: Minor
                      Found in include/projax/js/prototype.js - About 35 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                      document.getElementsByClassName = function (className, parentElement) {
                          if (Prototype.BrowserFeatures.XPath) {
                              var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]";
                              return document._getElementsByXPath(q, parentElement);
                          } else {
                      Severity: Minor
                      Found in include/projax/js/prototype.js - About 35 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                          readAttribute: function (element, name) {
                              element = $(element);
                              if (document.all && !window.opera) {
                                  var t = Element._attributeTranslations;
                                  if (t.values[name]) return t.values[name](element, name);
                      Severity: Minor
                      Found in include/projax/js/prototype.js - About 35 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                          stopObserving: function (element, name, observer, useCapture) {
                              element = $(element);
                              useCapture = useCapture || false;
                      
                              if (name == 'keypress' &&
                      Severity: Minor
                      Found in include/projax/js/prototype.js - About 35 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                          buildMatchExpression: function () {
                              var params = this.params, conditions = [], clause;
                      
                              if (params.wildcard)
                                  conditions.push('true');
                      Severity: Minor
                      Found in include/projax/js/prototype.js - About 35 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                          getInputs: function (form, typeName, name) {
                              form = $(form);
                              var inputs = form.getElementsByTagName('input');
                      
                              if (!typeName && !name) return $A(inputs).map(Element.extend);
                      Severity: Minor
                      Found in include/projax/js/prototype.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 offsetParent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          offsetParent: function (element) {
                              if (element.offsetParent) return element.offsetParent;
                              if (element == document.body) return element;
                      
                              while ((element = element.parentNode) && element != document.body)
                      Severity: Minor
                      Found in include/projax/js/prototype.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 inspect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          inspect: function (object) {
                              try {
                                  if (object === undefined) return 'undefined';
                                  if (object === null) return 'null';
                                  return object.inspect ? object.inspect() : object.toString();
                      Severity: Minor
                      Found in include/projax/js/prototype.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 clone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          clone: function (source, target) {
                              var options = Object.extend({
                                  setLeft: true,
                                  setTop: true,
                                  setWidth: true,
                      Severity: Minor
                      Found in include/projax/js/prototype.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

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

                      Element.Methods = {
                          visible: function (element) {
                              return $(element).style.display != 'none';
                          },
                      
                      
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 3 wks to fix
                      include/projax_/js/prototype.js on lines 1166..1512

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

                      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

                      var Position = {
                          // set to true if needed, warning: firefox performance problems
                          // NOT neeeded for page scrolling, only if draggable contained in
                          // scrollable elements
                          includeScrollOffsets: false,
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 wk to fix
                      include/projax_/js/prototype.js on lines 2350..2553

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

                      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

                      Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
                          _complete: false,
                      
                          initialize: function (url, options) {
                              this.transport = Ajax.getTransport();
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 wk to fix
                      include/projax_/js/prototype.js on lines 843..1006

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

                      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

                      var Enumerable = {
                          each: function (iterator) {
                              var index = 0;
                              try {
                                  this._each(function (value) {
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 wk to fix
                      include/projax_/js/prototype.js on lines 332..522

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 1524.

                      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

                      Object.extend(String.prototype, {
                          gsub: function (pattern, replacement) {
                              var result = '', source = this, match;
                              replacement = arguments.callee.prepareReplacement(replacement);
                      
                      
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 wk to fix
                      include/projax_/js/prototype.js on lines 156..300

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

                      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

                      Selector.prototype = {
                          initialize: function (expression) {
                              this.params = {classNames: []};
                              this.expression = expression.toString().strip();
                              this.parseExpression();
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 wk to fix
                      include/projax_/js/prototype.js on lines 1782..1902

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

                      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

                      Object.extend(Event, {
                          KEY_BACKSPACE: 8,
                          KEY_TAB: 9,
                          KEY_RETURN: 13,
                          KEY_ESC: 27,
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 5 days to fix
                      include/projax_/js/prototype.js on lines 2239..2345

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

                      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

                      Form.Methods = {
                          serialize: function (form, getHash) {
                              return Form.serializeElements(Form.getElements(form), getHash);
                          },
                      
                      
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 3 days to fix
                      include/projax_/js/prototype.js on lines 1955..2015

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

                      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

                      Object.extend(Array.prototype, {
                          _each: function (iterator) {
                              for (var i = 0, length = this.length; i < length; i++)
                                  iterator(this[i]);
                          },
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 3 days to fix
                      include/projax_/js/prototype.js on lines 548..618

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                      Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
                          initialize: function (container, url, options) {
                              this.setOptions(options);
                              this.onComplete = this.options.onComplete;
                      
                      
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 2 days to fix
                      include/projax/js/prototype_b.js on lines 898..938
                      include/projax_/js/prototype.js on lines 1050..1090
                      include/projax_/js/prototype_b.js on lines 898..938
                      include/scriptaculous/lib/prototype.js on lines 898..938

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

                      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

                      Object.extend(Hash.prototype, {
                          _each: function (iterator) {
                              for (var key in this) {
                                  var value = this[key];
                                  if (value && value == Hash.prototype[key]) continue;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 2 days to fix
                      include/projax_/js/prototype.js on lines 674..727

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

                      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

                      Form.Element.Methods = {
                          serialize: function (element) {
                              element = $(element);
                              if (!element.disabled && element.name) {
                                  var value = element.getValue();
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 2 days to fix
                      include/projax_/js/prototype.js on lines 2033..2082

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

                      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 (document.all && !window.opera) {
                          Element.Methods.update = function (element, html) {
                              element = $(element);
                              html = typeof html == 'undefined' ? '' : html.toString();
                              var tagName = element.tagName.toUpperCase();
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 2 days to fix
                      include/projax_/js/prototype.js on lines 1568..1608

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

                      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

                      Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
                          initialize: function (container, url, options) {
                              this.container = {
                                  success: (container.success || container),
                                  failure: (container.failure || (container.success ? null : container))
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 2 days to fix
                      include/projax_/js/prototype.js on lines 1010..1047

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

                      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

                      Form.Element.Serializers = {
                          input: function (element) {
                              switch (element.type.toLowerCase()) {
                                  case 'checkbox':
                                  case 'radio':
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 2 days to fix
                      include/projax_/js/prototype.js on lines 2090..2134

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

                      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

                      Abstract.Insertion.prototype = {
                          initialize: function (element, content) {
                              this.element = $(element);
                              this.content = content.stripScripts();
                      
                      
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 2 days to fix
                      include/projax_/js/prototype.js on lines 1656..1688

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

                      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

                      Abstract.EventObserver.prototype = {
                          initialize: function (element, callback) {
                              this.element = $(element);
                              this.callback = callback;
                      
                      
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 day to fix
                      include/projax_/js/prototype.js on lines 2183..2220

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

                      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

                      Object.extend(Hash, {
                          toQueryString: function (obj) {
                              var parts = [];
                      
                              this.prototype._each.call(obj, function (pair) {
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 day to fix
                      include/projax_/js/prototype.js on lines 646..671

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

                      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

                      Element.ClassNames.prototype = {
                          initialize: function (element) {
                              this.element = $(element);
                          },
                      
                      
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 day to fix
                      include/projax_/js/prototype.js on lines 1750..1778

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

                      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

                      Element.extend = function (element) {
                          if (!element || _nativeExtensions || element.nodeType == 3) return element;
                      
                          if (!element._extended && element.tagName && element != window) {
                              var methods = Object.clone(Element.Methods), cache = Element.extend.cache;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 day to fix
                      include/projax_/js/prototype.js on lines 1134..1156

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

                      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

                      Object.extend(Selector, {
                          matchElements: function (elements, expression) {
                              var selector = new Selector(expression);
                              return elements.select(selector.match.bind(selector)).map(Element.extend);
                          },
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 day to fix
                      include/projax_/js/prototype.js on lines 1904..1925

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

                      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

                      Element.addMethods = function (methods) {
                          Object.extend(Element.Methods, methods || {});
                      
                          function copy(methods, destination, onlyIfAbsent) {
                              onlyIfAbsent = onlyIfAbsent || false;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 day to fix
                      include/projax_/js/prototype.js on lines 1623..1645

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

                      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

                      Abstract.TimedObserver.prototype = {
                          initialize: function (element, frequency, callback) {
                              this.frequency = frequency;
                              this.element = $(element);
                              this.callback = callback;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 day to fix
                      include/projax_/js/prototype.js on lines 2140..2163

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

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

                      PeriodicalExecuter.prototype = {
                          initialize: function (callback, frequency) {
                              this.callback = callback;
                              this.frequency = frequency;
                              this.currentlyExecuting = false;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 1 day to fix
                      include/projax/js/prototype_b.js on lines 119..148
                      include/projax_/js/prototype.js on lines 122..151
                      include/projax_/js/prototype_b.js on lines 119..148
                      include/scriptaculous/lib/prototype.js on lines 119..148

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

                      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

                      var Form = {
                          reset: function (form) {
                              $(form).reset();
                              return form;
                          },
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 day to fix
                      include/projax_/js/prototype.js on lines 1930..1953

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                      Object.extend(Object, {
                          inspect: function (object) {
                              try {
                                  if (object === undefined) return 'undefined';
                                  if (object === null) return 'null';
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 1 day to fix
                      include/projax/js/prototype_b.js on lines 37..66
                      include/projax_/js/prototype.js on lines 40..69
                      include/projax_/js/prototype_b.js on lines 37..66
                      include/scriptaculous/lib/prototype.js on lines 37..66

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

                      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 (window.opera) {
                          Array.prototype.concat = function () {
                              var array = [];
                              for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
                              for (var i = 0, length = arguments.length; i < length; i++) {
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 day to fix
                      include/projax_/js/prototype.js on lines 627..641

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

                      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

                      Ajax.Responders = {
                          responders: [],
                      
                          _each: function (iterator) {
                              this.responders._each(iterator);
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 day to fix
                      include/projax_/js/prototype.js on lines 781..807

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

                      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

                      document.getElementsByClassName = function (className, parentElement) {
                          if (Prototype.BrowserFeatures.XPath) {
                              var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]";
                              return document._getElementsByXPath(q, parentElement);
                          } else {
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 7 hrs to fix
                      include/projax_/js/prototype.js on lines 1113..1127

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

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

                      Object.extend(ObjectRange.prototype, {
                          initialize: function (start, end, exclusive) {
                              this.start = start;
                              this.end = end;
                              this.exclusive = exclusive;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 7 hrs to fix
                      include/projax/js/prototype_b.js on lines 604..626
                      include/projax_/js/prototype.js on lines 735..757
                      include/projax_/js/prototype_b.js on lines 604..626
                      include/scriptaculous/lib/prototype.js on lines 604..626

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

                      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

                      Ajax.Base.prototype = {
                          setOptions: function (options) {
                              this.options = {
                                  method: 'post',
                                  asynchronous: true,
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 6 hrs to fix
                      include/projax_/js/prototype.js on lines 822..837

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

                      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

                      Template.prototype = {
                          initialize: function (template, pattern) {
                              this.template = template.toString();
                              this.pattern = pattern || Template.Pattern;
                          },
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 5 hrs to fix
                      include/projax_/js/prototype.js on lines 314..327

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 147.

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

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

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

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

                      Refactorings

                      Further Reading

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

                      Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
                          initializeRange: function () {
                              this.range.selectNodeContents(this.element);
                              this.range.collapse(true);
                          },
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 5 hrs to fix
                      include/projax/js/prototype_b.js on lines 1417..1428
                      include/projax_/js/prototype.js on lines 1706..1717
                      include/projax_/js/prototype_b.js on lines 1417..1428
                      include/scriptaculous/lib/prototype.js on lines 1417..1428

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

                      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

                      Element._attributeTranslations.values = {
                          _getAttr: function (element, attribute) {
                              return element.getAttribute(attribute, 2);
                          },
                      
                      
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 5 hrs to fix
                      include/projax_/js/prototype.js on lines 1531..1548

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

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

                      if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) {
                          Position.cumulativeOffset = function (element) {
                              var valueT = 0, valueL = 0;
                              do {
                                  valueT += element.offsetTop || 0;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 5 hrs to fix
                      include/projax/js/prototype_b.js on lines 2284..2298
                      include/projax_/js/prototype.js on lines 2558..2572
                      include/projax_/js/prototype_b.js on lines 2284..2298
                      include/scriptaculous/lib/prototype.js on lines 2284..2298

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                      Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {
                          initializeRange: function () {
                              this.range.selectNodeContents(this.element);
                              this.range.collapse(this.element);
                          },
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 4 hrs to fix
                      include/projax/js/prototype_b.js on lines 1431..1442
                      include/projax_/js/prototype.js on lines 1720..1731
                      include/projax_/js/prototype_b.js on lines 1431..1442
                      include/scriptaculous/lib/prototype.js on lines 1431..1442

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                      Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
                          initializeRange: function () {
                              this.range.setStartAfter(this.element);
                          },
                      
                      
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 4 hrs to fix
                      include/projax/js/prototype_b.js on lines 1445..1456
                      include/projax_/js/prototype.js on lines 1734..1745
                      include/projax_/js/prototype_b.js on lines 1445..1456
                      include/scriptaculous/lib/prototype.js on lines 1445..1456

                      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

                      Object.extend(Element._attributeTranslations.values, {
                          href: Element._attributeTranslations.values._getAttr,
                          src: Element._attributeTranslations.values._getAttr,
                          disabled: Element._attributeTranslations.values._flag,
                          checked: Element._attributeTranslations.values._flag,
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 4 hrs to fix
                      include/projax_/js/prototype.js on lines 1550..1557

                      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

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

                      if (Prototype.BrowserFeatures.XPath) {
                          document._getElementsByXPath = function (expression, parentElement) {
                              var results = [];
                              var query = document.evaluate(expression, $(parentElement) || document,
                                  null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 4 hrs to fix
                      include/projax_/js/prototype.js on lines 1102..1111

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

                      Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {
                          initializeRange: function () {
                              this.range.setStartBefore(this.element);
                          },
                      
                      
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 4 hrs to fix
                      include/projax/js/prototype_b.js on lines 1404..1414
                      include/projax_/js/prototype.js on lines 1693..1703
                      include/projax_/js/prototype_b.js on lines 1404..1414
                      include/scriptaculous/lib/prototype.js on lines 1404..1414

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

                      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

                      function $(element) {
                          if (arguments.length > 1) {
                              for (var i = 0, elements = [], length = arguments.length; i < length; i++)
                                  elements.push($(arguments[i]));
                              return elements;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 4 hrs to fix
                      include/projax_/js/prototype.js on lines 1091..1100

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

                      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 (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
                          ['', 'Form', 'Input', 'TextArea', 'Select'].each(function (tag) {
                              var className = 'HTML' + tag + 'Element';
                              if (window[className]) return;
                              var klass = window[className] = {};
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 4 hrs to fix
                      include/projax_/js/prototype.js on lines 1615..1621

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

                      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

                      var $A = Array.from = function (iterable) {
                          if (!iterable) return [];
                          if (iterable.toArray) {
                              return iterable.toArray();
                          } else {
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 3 hrs to fix
                      include/projax_/js/prototype.js on lines 531..541

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 111.

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

                      Object.extend(Number.prototype, {
                          toColorPart: function () {
                              var digits = this.toString(16);
                              if (this < 16) return '0' + digits;
                              return digits;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 3 hrs to fix
                      include/projax/js/prototype_b.js on lines 82..97
                      include/projax_/js/prototype.js on lines 85..100
                      include/projax_/js/prototype_b.js on lines 82..97
                      include/scriptaculous/lib/prototype.js on lines 82..97

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 108.

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

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

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

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

                      Refactorings

                      Further Reading

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

                      Function.prototype.bindAsEventListener = function (object) {
                          var __method = this, args = $A(arguments), object = args.shift();
                          return function (event) {
                              return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments)));
                          }
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 3 hrs to fix
                      include/projax/js/prototype_b.js on lines 75..80
                      include/projax_/js/prototype.js on lines 78..83
                      include/projax_/js/prototype_b.js on lines 75..80
                      include/scriptaculous/lib/prototype.js on lines 75..80

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

                      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

                      var Try = {
                          these: function () {
                              var returnValue;
                      
                              for (var i = 0, length = arguments.length; i < length; i++) {
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 3 hrs to fix
                      include/projax_/js/prototype.js on lines 102..117

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

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

                      Function.prototype.bind = function () {
                          var __method = this, args = $A(arguments), object = args.shift();
                          return function () {
                              return __method.apply(object, args.concat($A(arguments)));
                          }
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 2 hrs to fix
                      include/projax/js/prototype_b.js on lines 68..73
                      include/projax_/js/prototype.js on lines 71..76
                      include/projax_/js/prototype_b.js on lines 68..73
                      include/scriptaculous/lib/prototype.js on lines 68..73

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

                      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

                      Element.Methods.Simulated = {
                          hasAttribute: function (element, attribute) {
                              var t = Element._attributeTranslations;
                              attribute = t.names[attribute] || attribute;
                              return $(element).getAttributeNode(attribute).specified;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 2 hrs to fix
                      include/projax_/js/prototype.js on lines 1559..1565

                      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

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

                      Element.extend.cache = {
                          findOrStore: function (value) {
                              return this[value] = this[value] || function () {
                                      return value.apply(null, [this].concat($A(arguments)));
                                  }
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 2 hrs to fix
                      include/projax/js/prototype_b.js on lines 987..993
                      include/projax_/js/prototype.js on lines 1158..1164
                      include/projax_/js/prototype_b.js on lines 987..993
                      include/scriptaculous/lib/prototype.js on lines 987..993

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 77.

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

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

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

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

                      Refactorings

                      Further Reading

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

                      var Ajax = {
                          getTransport: function () {
                              return Try.these(
                                      function () {
                                          return new XMLHttpRequest()
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 2 hrs to fix
                      include/projax/js/prototype_b.js on lines 632..648
                      include/projax_/js/prototype.js on lines 763..779
                      include/projax_/js/prototype_b.js on lines 632..648
                      include/scriptaculous/lib/prototype.js on lines 632..648

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 75.

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

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

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

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

                      Refactorings

                      Further Reading

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

                      Form.Element = {
                          focus: function (element) {
                              $(element).focus();
                              return element;
                          },
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 1 hr to fix
                      include/projax/js/prototype_b.js on lines 1733..1743
                      include/projax_/js/prototype.js on lines 2021..2031
                      include/projax_/js/prototype_b.js on lines 1733..1743
                      include/scriptaculous/lib/prototype.js on lines 1733..1743

                      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

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

                      String.prototype.gsub.prepareReplacement = function (replacement) {
                          if (typeof replacement == 'function') return replacement;
                          var template = new Template(replacement);
                          return function (match) {
                              return template.evaluate(match)
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 1 hr to fix
                      include/projax/js/prototype_b.js on lines 266..272
                      include/projax_/js/prototype.js on lines 302..308
                      include/projax_/js/prototype_b.js on lines 266..272
                      include/scriptaculous/lib/prototype.js on lines 266..272

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 69.

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

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

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

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

                      Refactorings

                      Further Reading

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

                      Element._attributeTranslations.names = {
                          colspan: "colSpan",
                          rowspan: "rowSpan",
                          valign: "vAlign",
                          datetime: "dateTime",
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 hr to fix
                      include/projax_/js/prototype.js on lines 1518..1529

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 66.

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

                      Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
                          getValue: function () {
                              return Form.Element.getValue(this.element);
                          }
                      });
                      Severity: Major
                      Found in include/projax/js/prototype.js and 9 other locations - About 1 hr to fix
                      include/projax/js/prototype.js on lines 2223..2227
                      include/projax/js/prototype_b.js on lines 1887..1891
                      include/projax/js/prototype_b.js on lines 1946..1950
                      include/projax_/js/prototype.js on lines 2166..2170
                      include/projax_/js/prototype.js on lines 2223..2227
                      include/projax_/js/prototype_b.js on lines 1887..1891
                      include/projax_/js/prototype_b.js on lines 1946..1950
                      include/scriptaculous/lib/prototype.js on lines 1887..1891
                      include/scriptaculous/lib/prototype.js on lines 1946..1950

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

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

                      Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
                          getValue: function () {
                              return Form.Element.getValue(this.element);
                          }
                      });
                      Severity: Major
                      Found in include/projax/js/prototype.js and 9 other locations - About 1 hr to fix
                      include/projax/js/prototype.js on lines 2166..2170
                      include/projax/js/prototype_b.js on lines 1887..1891
                      include/projax/js/prototype_b.js on lines 1946..1950
                      include/projax_/js/prototype.js on lines 2166..2170
                      include/projax_/js/prototype.js on lines 2223..2227
                      include/projax_/js/prototype_b.js on lines 1887..1891
                      include/projax_/js/prototype_b.js on lines 1946..1950
                      include/scriptaculous/lib/prototype.js on lines 1887..1891
                      include/scriptaculous/lib/prototype.js on lines 1946..1950

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

                      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

                      var Prototype = {
                          Version: '1.5.0',
                          BrowserFeatures: {
                              XPath: !!document.evaluate
                          },
                      Severity: Major
                      Found in include/projax/js/prototype.js and 1 other location - About 1 hr to fix
                      include/projax_/js/prototype.js on lines 9..21

                      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

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

                      Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
                          getValue: function () {
                              return Form.serialize(this.element);
                          }
                      });
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 1 hr to fix
                      include/projax/js/prototype_b.js on lines 1894..1898
                      include/projax_/js/prototype.js on lines 2173..2177
                      include/projax_/js/prototype_b.js on lines 1894..1898
                      include/scriptaculous/lib/prototype.js on lines 1894..1898

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

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

                      Object.extend(Enumerable, {
                          map: Enumerable.collect,
                          find: Enumerable.detect,
                          select: Enumerable.findAll,
                          member: Enumerable.include,
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 1 hr to fix
                      include/projax/js/prototype_b.js on lines 468..474
                      include/projax_/js/prototype.js on lines 524..530
                      include/projax_/js/prototype_b.js on lines 468..474
                      include/scriptaculous/lib/prototype.js on lines 468..474

                      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

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

                      Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
                          getValue: function () {
                              return Form.serialize(this.element);
                          }
                      });
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 1 hr to fix
                      include/projax/js/prototype_b.js on lines 1953..1957
                      include/projax_/js/prototype.js on lines 2230..2234
                      include/projax_/js/prototype_b.js on lines 1953..1957
                      include/scriptaculous/lib/prototype.js on lines 1953..1957

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 57.

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

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

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

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

                      Refactorings

                      Further Reading

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

                      Ajax.Responders.register({
                          onCreate: function () {
                              Ajax.activeRequestCount++;
                          },
                          onComplete: function () {
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 55 mins to fix
                      include/projax/js/prototype_b.js on lines 680..688
                      include/projax_/js/prototype.js on lines 811..818
                      include/projax_/js/prototype_b.js on lines 680..688
                      include/scriptaculous/lib/prototype.js on lines 680..688

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

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

                      Object.extend = function (destination, source) {
                          for (var property in source) {
                              destination[property] = source[property];
                          }
                          return destination;
                      Severity: Major
                      Found in include/projax/js/prototype.js and 4 other locations - About 40 mins to fix
                      include/projax/js/prototype_b.js on lines 30..35
                      include/projax_/js/prototype.js on lines 33..38
                      include/projax_/js/prototype_b.js on lines 30..35
                      include/scriptaculous/lib/prototype.js on lines 30..35

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

                      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