mambax7/smartobject

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

Summary

Maintainability
F
4 mos
Test Coverage

File prototype_b.js has 1889 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*  Prototype JavaScript framework, version 1.5.0_rc1
 *  (c) 2005 Sam Stephenson <sam@conio.net>
 *
 *  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_b.js - About 5 days to fix

    Methods has 39 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_b.js - About 5 hrs to fix

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

          request: function (url) {
              var parameters = this.options.parameters || '';
              if (parameters.length > 0) parameters += '&_=';
      
              /* Simulate other verbs over post */
      Severity: Minor
      Found in include/projax/js/prototype_b.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 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_b.js - About 1 hr to fix

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

        Element.extend = function (element) {
            if (!element) return;
            if (_nativeExtensions || element.nodeType == 3) return element;
        
            if (!element._extended && element.tagName && element != window) {
        Severity: Minor
        Found in include/projax/js/prototype_b.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 12 (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_b.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 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Element.Methods.update = function (element, html) {
                element = $(element);
                var tagName = element.tagName.toUpperCase();
                if (['THEAD', 'TBODY', 'TR', 'TD'].indexOf(tagName) > -1) {
                    var div = document.createElement('div');
        Severity: Minor
        Found in include/projax/js/prototype_b.js - About 1 hr to fix

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

              getStyle: function (element, style) {
                  element = $(element);
                  var value = element.style[style.camelize()];
                  if (!value) {
                      if (document.defaultView && document.defaultView.getComputedStyle) {
          Severity: Minor
          Found in include/projax/js/prototype_b.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_b.js - About 1 hr to fix

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

                respondToReadyState: function (readyState) {
                    var event = Ajax.Request.Events[readyState];
                    var transport = this.transport, json = this.evalJSON();
            
                    if (event == 'Complete') {
            Severity: Minor
            Found in include/projax/js/prototype_b.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 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_b.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 request has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                request: function (url) {
                    var parameters = this.options.parameters || '';
                    if (parameters.length > 0) parameters += '&_=';
            
                    /* Simulate other verbs over post */
            Severity: Minor
            Found in include/projax/js/prototype_b.js - About 1 hr to fix

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

                  updateContent: function () {
                      var receiver = this.responseIsSuccess() ?
                          this.containers.success : this.containers.failure;
                      var response = this.transport.responseText;
              
              
              Severity: Minor
              Found in include/projax/js/prototype_b.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 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_b.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_b.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 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_b.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 7 (exceeds 5 allowed). Consider refactoring.
              Open

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

                  Element.Methods.update = function (element, html) {
                      element = $(element);
                      var tagName = element.tagName.toUpperCase();
                      if (['THEAD', 'TBODY', 'TR', 'TD'].indexOf(tagName) > -1) {
                          var div = document.createElement('div');
              Severity: Minor
              Found in include/projax/js/prototype_b.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_b.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 dispatch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  dispatch: function (callback, request, transport, json) {
                      this.each(function (responder) {
                          if (responder[callback] && typeof responder[callback] == 'function') {
                              try {
                                  responder[callback].apply(responder, [request, transport, json]);
              Severity: Minor
              Found in include/projax/js/prototype_b.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_b.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_b.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 positionedOffset has a Cognitive Complexity of 6 (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_b.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 3 locations. Consider refactoring.
              Open

              Element.Methods = {
                  visible: function (element) {
                      return $(element).style.display != 'none';
                  },
              
              
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 2 wks to fix
              include/projax_/js/prototype_b.js on lines 995..1280
              include/scriptaculous/lib/prototype.js on lines 995..1280

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

              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 3 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_b.js and 2 other locations - About 1 wk to fix
              include/projax_/js/prototype_b.js on lines 2073..2279
              include/scriptaculous/lib/prototype.js on lines 2073..2279

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

              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 3 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_b.js and 2 other locations - About 1 wk to fix
              include/projax_/js/prototype_b.js on lines 296..466
              include/scriptaculous/lib/prototype.js on lines 296..466

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

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

              Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
                  initialize: function (url, options) {
                      this.transport = Ajax.getTransport();
                      this.setOptions(options);
                      this.request(url);
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 1 wk to fix
              include/projax_/js/prototype_b.js on lines 718..850
              include/scriptaculous/lib/prototype.js on lines 718..850

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

              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 3 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_b.js and 2 other locations - About 1 wk to fix
              include/projax_/js/prototype_b.js on lines 1495..1614
              include/scriptaculous/lib/prototype.js on lines 1495..1614

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

              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 3 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_b.js and 2 other locations - About 6 days to fix
              include/projax_/js/prototype_b.js on lines 149..264
              include/scriptaculous/lib/prototype.js on lines 149..264

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

              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 3 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_b.js and 2 other locations - About 5 days to fix
              include/projax_/js/prototype_b.js on lines 1962..2068
              include/scriptaculous/lib/prototype.js on lines 1962..2068

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

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

              Form.Methods = {
                  serialize: function (form) {
                      var elements = Form.getElements($(form));
                      var queryComponents = new Array();
              
              
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 4 days to fix
              include/projax_/js/prototype_b.js on lines 1649..1727
              include/scriptaculous/lib/prototype.js on lines 1649..1727

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

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

              Object.extend(Array.prototype, {
                  _each: function (iterator) {
                      for (var i = 0; i < this.length; i++)
                          iterator(this[i]);
                  },
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 2 days to fix
              include/projax_/js/prototype_b.js on lines 492..554
              include/scriptaculous/lib/prototype.js on lines 492..554

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

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

              Form.Element.Methods = {
                  serialize: function (element) {
                      element = $(element);
                      var method = element.tagName.toLowerCase();
                      var parameter = Form.Element.Serializers[method](element);
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 2 days to fix
              include/projax_/js/prototype_b.js on lines 1745..1802
              include/scriptaculous/lib/prototype.js on lines 1745..1802

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

              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_b.js and 4 other locations - About 2 days to fix
              include/projax/js/prototype.js on lines 1050..1090
              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 3 locations. Consider refactoring.
              Open

              Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
                  initialize: function (container, url, options) {
                      this.containers = {
                          success: container.success ? $(container.success) : $(container),
                          failure: container.failure ? $(container.failure) :
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 2 days to fix
              include/projax_/js/prototype_b.js on lines 854..895
              include/scriptaculous/lib/prototype.js on lines 854..895

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

              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 3 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_b.js and 2 other locations - About 2 days to fix
              include/projax_/js/prototype_b.js on lines 1809..1853
              include/scriptaculous/lib/prototype.js on lines 1809..1853

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

              if (document.all) {
                  Element.Methods.update = function (element, html) {
                      element = $(element);
                      var tagName = element.tagName.toUpperCase();
                      if (['THEAD', 'TBODY', 'TR', 'TD'].indexOf(tagName) > -1) {
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 2 days to fix
              include/projax_/js/prototype_b.js on lines 1283..1322
              include/scriptaculous/lib/prototype.js on lines 1283..1322

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

              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 3 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_b.js and 2 other locations - About 2 days to fix
              include/projax_/js/prototype_b.js on lines 1367..1399
              include/scriptaculous/lib/prototype.js on lines 1367..1399

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

              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 3 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_b.js and 2 other locations - About 1 day to fix
              include/projax_/js/prototype_b.js on lines 1904..1943
              include/scriptaculous/lib/prototype.js on lines 1904..1943

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

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

              var Hash = {
                  _each: function (iterator) {
                      for (var key in this) {
                          var value = this[key];
                          if (typeof value == 'function') continue;
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 1 day to fix
              include/projax_/js/prototype_b.js on lines 555..594
              include/scriptaculous/lib/prototype.js on lines 555..594

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

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

              Element.ClassNames.prototype = {
                  initialize: function (element) {
                      this.element = $(element);
                  },
              
              
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 1 day to fix
              include/projax_/js/prototype_b.js on lines 1461..1491
              include/scriptaculous/lib/prototype.js on lines 1461..1491

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

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

              Object.extend(Selector, {
                  matchElements: function (elements, expression) {
                      var selector = new Selector(expression);
                      return elements.select(selector.match.bind(selector));
                  },
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 1 day to fix
              include/projax_/js/prototype_b.js on lines 1616..1637
              include/scriptaculous/lib/prototype.js on lines 1616..1637

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 246.

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

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

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

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

              Refactorings

              Further Reading

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

              Element.extend = function (element) {
                  if (!element) return;
                  if (_nativeExtensions || element.nodeType == 3) return element;
              
                  if (!element._extended && element.tagName && element != window) {
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 1 day to fix
              include/projax_/js/prototype_b.js on lines 964..985
              include/scriptaculous/lib/prototype.js on lines 964..985

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

              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_b.js and 4 other locations - About 1 day to fix
              include/projax/js/prototype.js on lines 122..151
              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

              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_b.js and 4 other locations - About 1 day to fix
              include/projax/js/prototype.js on lines 40..69
              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 3 locations. Consider refactoring.
              Open

              Ajax.Responders = {
                  responders: [],
              
                  _each: function (iterator) {
                      this.responders._each(iterator);
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 1 day to fix
              include/projax_/js/prototype_b.js on lines 650..676
              include/scriptaculous/lib/prototype.js on lines 650..676

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

              Element.addMethods = function (methods) {
                  Object.extend(Element.Methods, methods || {});
              
                  function copy(methods, destination) {
                      var cache = Element.extend.cache;
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 1 day to fix
              include/projax_/js/prototype_b.js on lines 1337..1356
              include/scriptaculous/lib/prototype.js on lines 1337..1356

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

              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 3 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_b.js and 2 other locations - About 1 day to fix
              include/projax_/js/prototype_b.js on lines 1863..1884
              include/scriptaculous/lib/prototype.js on lines 1863..1884

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

              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_b.js and 4 other locations - About 7 hrs to fix
              include/projax/js/prototype.js on lines 735..757
              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 3 locations. Consider refactoring.
              Open

              Ajax.Base.prototype = {
                  setOptions: function (options) {
                      this.options = {
                          method: 'post',
                          asynchronous: true,
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 7 hrs to fix
              include/projax_/js/prototype_b.js on lines 692..712
              include/scriptaculous/lib/prototype.js on lines 692..712

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

              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 3 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_b.js and 2 other locations - About 5 hrs to fix
              include/projax_/js/prototype_b.js on lines 278..291
              include/scriptaculous/lib/prototype.js on lines 278..291

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 150.

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

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

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

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

              Refactorings

              Further Reading

              Similar blocks of code found in 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_b.js and 4 other locations - About 5 hrs to fix
              include/projax/js/prototype.js on lines 1706..1717
              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 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_b.js and 4 other locations - About 5 hrs to fix
              include/projax/js/prototype.js on lines 2558..2572
              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_b.js and 4 other locations - About 4 hrs to fix
              include/projax/js/prototype.js on lines 1720..1731
              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_b.js and 4 other locations - About 4 hrs to fix
              include/projax/js/prototype.js on lines 1734..1745
              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

              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_b.js and 4 other locations - About 4 hrs to fix
              include/projax/js/prototype.js on lines 1693..1703
              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 3 locations. Consider refactoring.
              Open

              document.getElementsByClassName = function (className, parentElement) {
                  var children = ($(parentElement) || document.body).getElementsByTagName('*');
                  return $A(children).inject([], function (elements, child) {
                      if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
                          elements.push(Element.extend(child));
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 4 hrs to fix
              include/projax_/js/prototype_b.js on lines 950..957
              include/scriptaculous/lib/prototype.js on lines 950..957

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

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

              if (!window.HTMLElement && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) {
                  /* Emulate HTMLElement, HTMLFormElement, HTMLInputElement, HTMLTextAreaElement,
                   and HTMLSelectElement in Safari */
                  ['', 'Form', 'Input', 'TextArea', 'Select'].each(function (tag) {
                      var klass = window['HTML' + tag + 'Element'] = {};
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 3 hrs to fix
              include/projax_/js/prototype_b.js on lines 1328..1335
              include/scriptaculous/lib/prototype.js on lines 1328..1335

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

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

              function $() {
                  var results = [], element;
                  for (var i = 0; i < arguments.length; i++) {
                      element = arguments[i];
                      if (typeof element == 'string')
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 3 hrs to fix
              include/projax_/js/prototype_b.js on lines 939..948
              include/scriptaculous/lib/prototype.js on lines 939..948

              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_b.js and 4 other locations - About 3 hrs to fix
              include/projax/js/prototype.js on lines 85..100
              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

              Identical blocks of code found in 3 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_b.js and 2 other locations - About 3 hrs to fix
              include/projax_/js/prototype_b.js on lines 475..485
              include/scriptaculous/lib/prototype.js on lines 475..485

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

              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_b.js and 4 other locations - About 3 hrs to fix
              include/projax/js/prototype.js on lines 78..83
              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 3 locations. Consider refactoring.
              Open

              var Try = {
                  these: function () {
                      var returnValue;
              
                      for (var i = 0; i < arguments.length; i++) {
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 2 hrs to fix
              include/projax_/js/prototype_b.js on lines 99..114
              include/scriptaculous/lib/prototype.js on lines 99..114

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

              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_b.js and 4 other locations - About 2 hrs to fix
              include/projax/js/prototype.js on lines 71..76
              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 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_b.js and 4 other locations - About 2 hrs to fix
              include/projax/js/prototype.js on lines 1158..1164
              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_b.js and 4 other locations - About 2 hrs to fix
              include/projax/js/prototype.js on lines 763..779
              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_b.js and 4 other locations - About 1 hr to fix
              include/projax/js/prototype.js on lines 2021..2031
              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_b.js and 4 other locations - About 1 hr to fix
              include/projax/js/prototype.js on lines 302..308
              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

              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_b.js and 9 other locations - About 1 hr to fix
              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.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.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
                  getValue: function () {
                      return Form.Element.getValue(this.element);
                  }
              });
              Severity: Major
              Found in include/projax/js/prototype_b.js and 9 other locations - About 1 hr to fix
              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 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 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_b.js and 4 other locations - About 1 hr to fix
              include/projax/js/prototype.js on lines 2173..2177
              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_b.js and 4 other locations - About 1 hr to fix
              include/projax/js/prototype.js on lines 524..530
              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 3 locations. Consider refactoring.
              Open

              function $H(object) {
                  var hash = Object.extend({}, object || {});
                  Object.extend(hash, Enumerable);
                  Object.extend(hash, Hash);
                  return hash;
              Severity: Major
              Found in include/projax/js/prototype_b.js and 2 other locations - About 1 hr to fix
              include/projax_/js/prototype_b.js on lines 596..601
              include/scriptaculous/lib/prototype.js on lines 596..601

              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_b.js and 4 other locations - About 1 hr to fix
              include/projax/js/prototype.js on lines 2230..2234
              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++;
                  },
              
              
              Severity: Major
              Found in include/projax/js/prototype_b.js and 4 other locations - About 55 mins to fix
              include/projax/js/prototype.js on lines 811..818
              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_b.js and 4 other locations - About 40 mins to fix
              include/projax/js/prototype.js on lines 33..38
              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