concord-consortium/rigse

View on GitHub
rails/app/assets/javascripts/prototype-ui/prototype-ui.js

Summary

Maintainability
F
9 mos
Test Coverage

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

/*  Prototype-UI, version trunk
 *
 *  Prototype-UI is freely distributable under the terms of an MIT-style license.
 *  For details, see the PrototypeUI web site: http://www.prototype-ui.com/
 *
Severity: Major
Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 wk to fix

    Window has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    UI.Window = Class.create(UI.Options, {
      // Group: Options
      options: {
    
        // Property: theme
    Severity: Minor
    Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 5 hrs to fix

      AutoComplete has 34 functions (exceeds 20 allowed). Consider refactoring.
      Open

      UI.AutoComplete = Class.create(UI.Options, {
        // Group: Options
        options: {
          className: "pui-autocomplete",         // CSS class name prefix
          max: {selection: 10, selected:false},  // Max values fort autocomplete,
      Severity: Minor
      Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 4 hrs to fix

        Function CSS has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        var CSS = (function() {
          // Code based on:
          //   - IE5.5+ PNG Alpha Fix v1.0RC4 (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
          //   - Whatever:hover - V2.02.060206 - hover, active & focus (c) 2005 - Peter Nederlof * Peterned - http://www.xs4all.nl/~peterned/
          function fixPNG() {
        Severity: Minor
        Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function displayCompletion has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

          displayCompletion: function(event) {
            var value = this.input.value.strip();
            this.current = null;
            if (!this.canAddMoreItems())
              return;
        Severity: Minor
        Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 3 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        WindowManager has 27 functions (exceeds 20 allowed). Consider refactoring.
        Open

        UI.WindowManager = Class.create(UI.Options, {
          options: {
            container:   null, // will default to document.body
            zIndex:      0,
            theme:       "alphacube",
        Severity: Minor
        Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 3 hrs to fix

          Function CSS has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var CSS = (function() {
            // Code based on:
            //   - IE5.5+ PNG Alpha Fix v1.0RC4 (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
            //   - Whatever:hover - V2.02.060206 - hover, active & focus (c) 2005 - Peter Nederlof * Peterned - http://www.xs4all.nl/~peterned/
            function fixPNG() {
          Severity: Major
          Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 2 hrs to fix

            Calendar has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            UI.Calendar = Class.create(UI.Options, {
              options: {
                theme: 'mac_os_x',
                format: '%m/%d/%Y',
                startWeekday: 0,
            Severity: Minor
            Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 2 hrs to fix

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

                update: function(newDate) {
                  this.updateDaysRow();
                  this.date = newDate;
                  var today = new Date();
                  this.headerSpan.innerHTML = UI.Calendar.Options.MONTHS[this.date.getMonth()] + ' ' + this.date.getFullYear();
              Severity: Minor
              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 2 hrs to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function computeSize has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                computeSize: function(width, height, innerSize) {
                  var innerWidth, innerHeight, outerWidth, outerHeight;
                    if (innerSize) {
                      outerWidth  =  width  + this.borderSize.width;
                      outerHeight =  height + this.borderSize.height;
              Severity: Minor
              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 2 hrs to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function buildSelector has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                buildSelector: function() {
                  this.selector = new Element('div').addClassName('selector').hide();
              
                  this.mask = new Element('div').hide().addClassName('ui_calendar_mask').setOpacity(0.3);
              
              
              Severity: Minor
              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

                Function keydown has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  keydown: function(event) {
                    if (event.element() != this.input)
                      return;
                
                    this.ignoreKeyup = false;
                Severity: Minor
                Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

                  Function displayCompletion has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    displayCompletion: function(event) {
                      var value = this.input.value.strip();
                      this.current = null;
                      if (!this.canAddMoreItems())
                        return;
                  Severity: Minor
                  Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

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

                      keydown: function(event) {
                        if (event.element() != this.input)
                          return;
                    
                        this.ignoreKeyup = false;
                    Severity: Minor
                    Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.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 strftime has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      strftime: function(grammar) {
                        var parts = { }, i18n = Date.default_i18n;
                        var lambda = function(date, part) {
                          switch (part) {
                          // date
                    Severity: Minor
                    Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

                      Function strftime has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        strftime: function(grammar) {
                          var parts = { }, i18n = Date.default_i18n;
                          var lambda = function(date, part) {
                            switch (part) {
                            // date
                      Severity: Minor
                      Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

                        Function parseString has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          parseString: function(dateString, format) {
                            var date = new Date(), i18n = Date.default_i18n;
                        
                            format=format.replace('%D','%m/%d/%y');
                            format=format.replace('%T','%H:%M:%S').replace('%r','%I:%M:%S %p').replace('%R','%H:%M:%S');
                        Severity: Minor
                        Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

                          Function parseString has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            parseString: function(dateString, format) {
                              var date = new Date(), i18n = Date.default_i18n;
                          
                              format=format.replace('%D','%m/%d/%y');
                              format=format.replace('%T','%H:%M:%S').replace('%r','%I:%M:%S %p').replace('%R','%H:%M:%S');
                          Severity: Minor
                          Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

                            Function buildHeader has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              buildHeader: function(date) {
                                var header = new Element('thead');
                                this.daysRow = new Element('tr', {
                                  id: this.generateId('_days_row')
                                });
                            Severity: Minor
                            Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

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

                                computeSize: function(width, height, innerSize) {
                                  var innerWidth, innerHeight, outerWidth, outerHeight;
                                    if (innerSize) {
                                      outerWidth  =  width  + this.borderSize.width;
                                      outerHeight =  height + this.borderSize.height;
                              Severity: Minor
                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

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

                                    var lambda = function(date, part) {
                                      switch (part) {
                                      // date
                                        case 'a': return i18n.WEEKDAYS_MEDIUM[date.getDay()];
                                        case 'A': return i18n.WEEKDAYS[date.getDay()];
                                Severity: Minor
                                Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

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

                                      var lambda = function(date, part) {
                                        switch (part) {
                                        // date
                                          case 'a': return i18n.WEEKDAYS_MEDIUM[date.getDay()];
                                          case 'A': return i18n.WEEKDAYS[date.getDay()];
                                  Severity: Minor
                                  Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

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

                                      update: function(newDate) {
                                        this.updateDaysRow();
                                        this.date = newDate;
                                        var today = new Date();
                                        this.headerSpan.innerHTML = UI.Calendar.Options.MONTHS[this.date.getMonth()] + ' ' + this.date.getFullYear();
                                    Severity: Minor
                                    Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

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

                                        scroll: function(deltaPixel) {
                                          if (this.animating)
                                            return this;
                                      
                                          // Compute new position
                                      Severity: Minor
                                      Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

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

                                          createList: function(items) {
                                            var list = new Element('ul');
                                        
                                            items.each(function(item){
                                              list.insert(
                                        Severity: Minor
                                        Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

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

                                            initObservers: function() {
                                              var contextEvent = Prototype.Browser.Opera ? 'click' : 'contextmenu';
                                          
                                              document.observe('click', function(e) {
                                                if (this.element.visible() && !e.isRightClick()) {
                                          Severity: Minor
                                          Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

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

                                              setAltitude: function(win, altitude) {
                                                var stack = this.stack;
                                            
                                                if (altitude === "front") {
                                                  if (stack.getFrontWindow() === win) return;
                                            Severity: Minor
                                            Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.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 focus has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                              focus: function(event, element) {
                                                if (event)
                                                  event.stop();
                                            
                                                // Multi selection with shift
                                            Severity: Minor
                                            Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 45 mins to fix

                                            Cognitive Complexity

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

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

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

                                            Further reading

                                            Avoid deeply nested control flow statements.
                                            Open

                                                        if (! selected.empty())
                                                          this.selectedList = this.selectedList.findAll(function(entry) {return !selected.include(entry.value)});
                                            Severity: Major
                                            Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 45 mins to fix

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

                                                removeSelected: function(event) {
                                                  if (event.element().readAttribute("type") != "text" && event.keyCode == Event.KEY_BACKSPACE) {
                                                    this.container.select("li." + this.getClassName("box")).each(function(element) {
                                                      if (this.isSelected(element))
                                                        this.remove(element);
                                              Severity: Minor
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.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 strftime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                strftime: function(grammar) {
                                                  var parts = { }, i18n = Date.default_i18n;
                                                  var lambda = function(date, part) {
                                                    switch (part) {
                                                    // date
                                              Severity: Minor
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.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 strftime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                strftime: function(grammar) {
                                                  var parts = { }, i18n = Date.default_i18n;
                                                  var lambda = function(date, part) {
                                                    switch (part) {
                                                    // date
                                              Severity: Minor
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.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 position has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                position: function(e) {
                                                  var x = Event.pointer(e).x,
                                                      y = Event.pointer(e).y,
                                                      vpDim = document.viewport.getDimensions(),
                                                      vpOff = document.viewport.getScrollOffset(),
                                              Severity: Minor
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 25 mins to fix

                                              Cognitive Complexity

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

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

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

                                              Further reading

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

                                              UI.AutoComplete = Class.create(UI.Options, {
                                                // Group: Options
                                                options: {
                                                  className: "pui-autocomplete",         // CSS class name prefix
                                                  max: {selection: 10, selected:false},  // Max values fort autocomplete,
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 mo to fix
                                              rails/public/javascripts/light_box.js on lines 5268..5797

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 5103.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Calendar = Class.create(UI.Options, {
                                                options: {
                                                  theme: 'mac_os_x',
                                                  format: '%m/%d/%Y',
                                                  startWeekday: 0,
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 3 wks to fix
                                              rails/public/javascripts/light_box.js on lines 5992..6351

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 3755.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Shadow = Class.create(UI.Options, {
                                                options: {
                                                  theme: "mac_shadow",
                                                  focus: false,
                                                  zIndex: 100,
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 2 wks to fix
                                              rails/public/javascripts/light_box.js on lines 2628..2928

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 2654.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Carousel = Class.create(UI.Options, {
                                                // Group: Options
                                                options: {
                                                  // Property: direction
                                                  //   Can be horizontal or vertical, horizontal by default
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 2 wks to fix
                                              rails/public/javascripts/light_box.js on lines 462..922

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 2324.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Window.addMethods({
                                                style: "position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;",
                                              
                                                action: function(name) {
                                                  var action = this.options[name];
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 wk to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2054..2234
                                              rails/public/javascripts/light_box.js on lines 3811..3991

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 2084.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.ContextMenu = Class.create(UI.Options, {
                                                // Group: Options
                                                options: {
                                                  // Property: className
                                                  //   class to be applied to menu element, default is 'ui-context_menu'
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 wk to fix
                                              rails/public/javascripts/light_box.js on lines 4982..5255

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 2021.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Dock = Class.create(UI.Options, {
                                              
                                                // Group: Options
                                                options: {
                                                  // Property: maxItemSize
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 wk to fix
                                              rails/public/javascripts/light_box.js on lines 1157..1328

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 1612.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Window.addMethods({
                                                startDrag: function(handle) {
                                                  this.initBounds = this.getBounds();
                                                  this.activate();
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 wk to fix
                                              rails/public/javascripts/light_box.js on lines 4057..4158

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 1184.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Ajax.Carousel = Class.create(UI.Carousel, {
                                                // Group: Options
                                                //
                                                //   Notice:
                                                //     It also include of all carousel's options
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 6 days to fix
                                              rails/public/javascripts/light_box.js on lines 933..1136

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 1144.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.PullDown = Class.create(UI.Options, {
                                                options: {
                                                  className:   '',
                                                  shadow:      false,
                                                  position:    'over',
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 6 days to fix
                                              rails/public/javascripts/light_box.js on lines 2458..2614

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 1070.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Window.addMethods({
                                                methodsAdded: function(base) {
                                                  (function(methods) {
                                                    $w(methods).each(function(m) { base.aliasMethodChain(m, 'shadow') });
                                                  })(' create addElements setZIndex setPosition setSize setBounds ');
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 5 days to fix
                                              rails/public/javascripts/light_box.js on lines 4250..4353

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 970.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              Object.extend(Date.prototype, {
                                                addDays: function(days) {
                                                  return new Date(this.getFullYear(), this.getMonth(), this.getDate() + days, this.getHours(), this.getMinutes(), this.getSeconds(), this.getMilliseconds());
                                                },
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 3 other locations - About 5 days to fix
                                              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 5827..5901
                                              rails/public/javascripts/light_box.js on lines 1738..1812
                                              rails/public/javascripts/light_box.js on lines 5827..5901

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 967.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              Object.extend(Date.prototype, {
                                                addDays: function(days) {
                                                  return new Date(this.getFullYear(), this.getMonth(), this.getDate() + days, this.getHours(), this.getMinutes(), this.getSeconds(), this.getMilliseconds());
                                                },
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 3 other locations - About 5 days to fix
                                              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 1738..1812
                                              rails/public/javascripts/light_box.js on lines 1738..1812
                                              rails/public/javascripts/light_box.js on lines 5827..5901

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 967.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Dialog = Class.create(UI.Window, {
                                                options: {
                                                  buttons:       null, // default = ok/cancel button
                                                  beforeSelect:  Prototype.trueFunction,
                                                  close:         false,
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 5 days to fix
                                              rails/public/javascripts/light_box.js on lines 4374..4535

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 957.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              var CSS = (function() {
                                                // Code based on:
                                                //   - IE5.5+ PNG Alpha Fix v1.0RC4 (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
                                                //   - Whatever:hover - V2.02.060206 - hover, active & focus (c) 2005 - Peter Nederlof * Peterned - http://www.xs4all.nl/~peterned/
                                                function fixPNG() {
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 5 days to fix
                                              rails/public/javascripts/light_box.js on lines 1615..1733

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 921.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Window.addMethods({
                                                methodsAdded: function(base) {
                                                  base.aliasMethodChain('create',  'buttons');
                                                  base.aliasMethodChain('destroy', 'buttons');
                                                },
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 4 days to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2403..2493
                                              rails/public/javascripts/light_box.js on lines 4159..4249

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 739.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              (function(browser) {
                                                var watch, change, changed, fragment;
                                              
                                                // returns fragment part of the URL without "#"
                                                // "http://someplace.org/path/to#?something" => "something"
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 4 days to fix
                                              rails/public/javascripts/light_box.js on lines 2065..2168

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 684.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 4 locations. Consider refactoring.
                                              Open

                                              Object.extend(Date, {
                                                STRFT_GRAMMER : /(^|.|\r|\n)(\%(\w+))/,
                                              
                                                default_i18n: {
                                                  MONTHS_SHORT: $w('Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'),
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 3 other locations - About 3 days to fix
                                              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 1814..1871
                                              rails/public/javascripts/light_box.js on lines 1814..1871
                                              rails/public/javascripts/light_box.js on lines 5903..5960

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 626.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 4 locations. Consider refactoring.
                                              Open

                                              Object.extend(Date, {
                                                STRFT_GRAMMER : /(^|.|\r|\n)(\%(\w+))/,
                                              
                                                default_i18n: {
                                                  MONTHS_SHORT: $w('Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'),
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 3 other locations - About 3 days to fix
                                              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 5903..5960
                                              rails/public/javascripts/light_box.js on lines 1814..1871
                                              rails/public/javascripts/light_box.js on lines 5903..5960

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 626.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.IframeShim = Class.create(UI.Options, {
                                              
                                                options: {
                                                  parent: document.body
                                                },
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 3 days to fix
                                              rails/public/javascripts/light_box.js on lines 2195..2325

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 591.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.IframeShim = Class.create(UI.Options, {
                                                
                                                options: {
                                                  parent: document.body
                                                },
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 3 days to fix
                                              rails/public/javascripts/light_box.js on lines 1355..1485

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 589.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              (function() {
                                                UI.Options = {
                                                  methodsAdded: function(klass) {
                                                    klass.classMethod($w(' setOptions allOptions optionsGetter optionsSetter optionsAccessor '));
                                                  },
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 days to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 300..379
                                              rails/public/javascripts/light_box.js on lines 355..434

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 476.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              Object.extend(Class.Methods, {
                                                extend: Object.extend.methodize(),
                                              
                                                addMethods: Class.Methods.addMethods.wrap(function(proceed, source) {
                                                  // ensure we are not trying to add null or undefined
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 days to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 54..118
                                              rails/public/javascripts/light_box.js on lines 58..122

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 474.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              if (!Object.isUndefined(window.Effect)) {
                                                UI.Window.Effects = UI.Window.Effects || {};
                                                UI.Window.Effects.Morph = Class.create(Effect.Base, {
                                                  initialize: function(window, bounds) {
                                                    this.window = window;
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 days to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2277..2301
                                              rails/public/javascripts/light_box.js on lines 4032..4056

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 440.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.WindowManager.Stack = Class.create(Enumerable, {
                                                initialize: function() {
                                                  this.windows = [ ];
                                                },
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 days to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2925..2972
                                              rails/public/javascripts/light_box.js on lines 4892..4939

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 395.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              (function() {
                                                var initPointer, draggedElement;
                                                
                                                document.observe('mousedown', function(event) {
                                                  if (draggedElement = findDraggable(event.element())) {
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 3 other locations - About 2 days to fix
                                              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 1941..1996
                                              rails/public/javascripts/light_box.js on lines 1548..1603
                                              rails/public/javascripts/light_box.js on lines 1941..1996

                                              Duplicated Code

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

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

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

                                              (function() {
                                                var initPointer, draggedElement;
                                              
                                                document.observe('mousedown', function(event) {
                                                  if (draggedElement = findDraggable(event.element())) {
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 3 other locations - About 2 days to fix
                                              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 1548..1603
                                              rails/public/javascripts/light_box.js on lines 1548..1603
                                              rails/public/javascripts/light_box.js on lines 1941..1996

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 388.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              Object.extend(Array.prototype, {
                                                /**
                                                 * Array#isEmpty() -> Boolean
                                                 * Convenient method to check wether or not array is empty
                                                 * returns: true if array is empty, false otherwise
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 2 days to fix
                                              rails/public/javascripts/light_box.js on lines 158..222

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 364.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              Element.addMethods({
                                                center: function( container, element ) {
                                                  element = $(element);
                                                  container = $(container);
                                                  var cBorders = container.borderDimensions(), eBorders = element.borderDimensions();
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 2 days to fix
                                              rails/public/javascripts/light_box.js on lines 5961..5985

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 357.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              Element.addMethods({
                                                getCaretPosition: function(element) {
                                                  if (element.createTextRange) {
                                                    var r = document.selection.createRange().duplicate();
                                                      r.moveEnd('character', element.value.length);
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 day to fix
                                              rails/public/javascripts/light_box.js on lines 5799..5822

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 330.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                startModalSession: function(win) {
                                                  if (!this.modalSessions) {
                                                    this.removeOverflow();
                                                    this.modalOverlay.className = win.getTheme() + "_overlay";
                                                    this.container.appendChild(this.modalOverlay);
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 day to fix
                                              rails/public/javascripts/light_box.js on lines 4684..4702

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 316.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              Element.addMethods({
                                                getScrollDimensions: function(element) {
                                                  element = $(element);
                                                  return {
                                                    width:  element.scrollWidth,
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 day to fix
                                              rails/public/javascripts/light_box.js on lines 226..263

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 295.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                initialize: function(options) {
                                                  this.setOptions(options);
                                              
                                                  this.container = $(this.options.container || document.body);
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 day to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2609..2632

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 282.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.URLWindow = Class.create(UI.Window, {
                                                options: {
                                                  url: 'about:blank'
                                                },
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 day to fix
                                              rails/public/javascripts/light_box.js on lines 3992..4031

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 277.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                center: function(options) {
                                                  var size          = this.getSize(),
                                                      windowManager = this.windowManager,
                                                      viewport      = windowManager.viewport;
                                                      viewportArea  = viewport.getDimensions(),
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 day to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1852..1871
                                              rails/public/javascripts/light_box.js on lines 3609..3628

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 276.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              (function(p) {
                                                var b = p.Browser, n = navigator;
                                              
                                                if (b.WebKit) {
                                                  b.WebKitVersion = parseFloat(n.userAgent.match(/AppleWebKit\/([\d\.\+]*)/)[1]);
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 day to fix
                                              rails/public/javascripts/light_box.js on lines 11..27

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 229.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                maximize: function() {
                                                  if (this.maximized) return this;
                                              
                                                  // Get bounds has to be before  this.windowManager.maximize for IE!! this.windowManager.maximize remove overflow
                                                  // and it breaks this.getBounds()
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 day to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1625..1642
                                              rails/public/javascripts/light_box.js on lines 3373..3390

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 216.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                morph: function(bounds, innerSize) {
                                                  bounds = Object.extend(this.getBounds(innerSize), bounds || {});
                                              
                                                  if (this.centerOptions && this.centerOptions.auto)
                                                     bounds = Object.extend(bounds, this.computeRecenter(bounds));
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 day to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1948..1969
                                              rails/public/javascripts/light_box.js on lines 3705..3726

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 216.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                options: {
                                              
                                                  // Property: theme
                                                  //   window theme, uses the window manager theme as default
                                                  theme:         null,
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 day to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1199..1283
                                              rails/public/javascripts/light_box.js on lines 2947..3031

                                              Duplicated Code

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

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

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                                                setSize: function(width, height, innerSize) {
                                                  var size = this.computeSize(width, height, innerSize);
                                                  var elementStyle = this.element.style, contentStyle = this.content.style;
                                              
                                                  this.options.width  = size.outerWidth;
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 day to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1903..1916
                                              rails/public/javascripts/light_box.js on lines 3660..3673

                                              Duplicated Code

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

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

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                                                hide: function() {
                                                  if (!this.visible) return this;
                                              
                                                  this.fire('hiding');
                                                  this.effect('hide');
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 7 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1513..1535
                                              rails/public/javascripts/light_box.js on lines 3261..3283

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 186.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                setAjaxContent: function(url, options) {
                                                  if (!options)
                                                    options = {};
                                              
                                                  // bind all callbacks to the window
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 7 hrs to fix
                                              rails/public/javascripts/light_box.js on lines 3545..3563

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 184.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                onStartDrag: function(event) {
                                                  var handle = event.element(),
                                                      isMoveHandle   = handle.match(this.moveHandleSelector),
                                                      isResizeHandle = handle.match(this.resizeHandleSelector);
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 7 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2753..2771
                                              rails/public/javascripts/light_box.js on lines 4719..4737

                                              Duplicated Code

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

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

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                                              UI.ElementLogger = Class.create(UI.Abstract.Logger, {
                                                /*
                                                  Method: initialize
                                                    Constructor, takes a DOM element to log into as argument
                                                */
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 6 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 850..878
                                              rails/public/javascripts/light_box.js on lines 2423..2451

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 174.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                show: function(modal) {
                                                  if (this.visible) return this;
                                              
                                                  this.fire('showing');
                                                  this.effect('show');
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 6 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1483..1504
                                              rails/public/javascripts/light_box.js on lines 3231..3252

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 165.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                initialize: function(options) {
                                                  this.setOptions(options);
                                                  this.windowManager = this.options.windowManager || UI.defaultWM;
                                                  this.create();
                                                  this.id = this.element.id;
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 6 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1397..1406
                                              rails/public/javascripts/light_box.js on lines 3145..3154

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 158.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                removeOverflow: function() {
                                                  var container = this.container;
                                                  // Remove overflow, save overflow and scrolloffset values to restore them when restore window
                                                  container.savedOverflow = container.style.overflow || "auto";
                                                  container.savedOffset = this.viewport.getScrollOffset();
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 6 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2803..2814
                                              rails/public/javascripts/light_box.js on lines 4769..4780

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 158.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                fold: function() {
                                                  if (!this.folded) {
                                                    var size = this.getSize(true);
                                                    this.folded = true;
                                                    this.savedInnerHeight = size.height;
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 5 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1698..1713
                                              rails/public/javascripts/light_box.js on lines 3446..3461

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 148.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                endModalSession: function(win) {
                                                  this.modalSessions--;
                                                  if (this.modalSessions) {
                                                    this.modalOverlay.setStyle({ zIndex: this.stack.getPreviousWindow(win).zIndex - 1 });
                                                  } else {
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 5 hrs to fix
                                              rails/public/javascripts/light_box.js on lines 4704..4714

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 147.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                setAltitude: function(win, altitude) {
                                                  var stack = this.stack;
                                              
                                                  if (altitude === "front") {
                                                    if (stack.getFrontWindow() === win) return;
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 5 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2867..2883
                                              rails/public/javascripts/light_box.js on lines 4834..4850

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 146.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                blur: function() {
                                                  if (!this.focused) return this;
                                              
                                                  this.windowManager.blur(this);
                                                  this.element.removeClassName(this.options.theme + '_focused');
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 5 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1602..1615
                                              rails/public/javascripts/light_box.js on lines 3350..3363

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 144.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                              UI.WindowManager.DumbPositionningStrategy = function(win, area) {
                                                size = win.getSize();
                                              
                                                var top  = area.height - size.height,
                                                    left = area.width  - size.width;
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 5 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2911..2921
                                              rails/public/javascripts/light_box.js on lines 4878..4888

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 140.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                unfold: function() {
                                                  if (this.folded) {
                                                    var size = this.getSize(true);
                                                    this.folded = false;
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 5 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1722..1736
                                              rails/public/javascripts/light_box.js on lines 3470..3484

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 139.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                restore: function() {
                                                  if (!this.maximized) return this;
                                              
                                                  if (this.windowManager.restore(this)) {
                                                    this[this.options.superflousEffects  && !Prototype.Browser.IE ? "morph" : "setBounds"](this.savedArea);
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 5 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1651..1662
                                              rails/public/javascripts/light_box.js on lines 3399..3410

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 139.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Dialog =  Object.extend(UI.Dialog, {
                                                okButton        : [{title: 'Ok',     className: 'ok',     callback: function(win) { win.destroy(); }}],
                                                okCancelButtons : [{title: 'Ok',     className: 'ok',     callback: function(win) { win.destroy(); }},
                                                                   {title: 'Cancel', className: 'cancel', callback: function(win) { win.destroy(); }}]
                                              });
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 5 hrs to fix
                                              rails/public/javascripts/light_box.js on lines 4538..4542

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 138.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                resetOverflow: function() {
                                                  var container = this.container;
                                                  // Restore overflow ans scrolloffset
                                                  if (container.savedOverflow) {
                                                    if (this.container == document.body && Prototype.Browser.IE)
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 5 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2816..2828
                                              rails/public/javascripts/light_box.js on lines 4782..4794

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 135.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                setPosition: function(top, left) {
                                                  var pos = this.computePosition(top, left);
                                                  this.options.top  = pos.top;
                                                  this.options.left = pos.left;
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 5 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1832..1843
                                              rails/public/javascripts/light_box.js on lines 3589..3600

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 135.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                setResizable: function(resizable) {
                                                  this.options.resizable = resizable;
                                              
                                                  var toggleClassName = (resizable ? 'add' : 'remove') + 'ClassName';
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 4 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1994..2007

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 129.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              Object.extend(String.prototype, {
                                                camelcase: function() {
                                                  var string = this.dasherize().camelize();
                                                  return string.charAt(0).toUpperCase() + string.slice(1);
                                                },
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 4 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 130..153
                                              rails/public/javascripts/light_box.js on lines 134..157

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 124.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              (function() {
                                                /*
                                                  Method: debug
                                                    Logs with "debug" level
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 4 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 786..809
                                              rails/public/javascripts/light_box.js on lines 2359..2382

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 122.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              document.whenReady = (function() {
                                                var queue = [ ];
                                              
                                                document.observe('dom:loaded', function() {
                                                  queue.invoke('call', document);
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 4 hrs to fix
                                              rails/public/javascripts/light_box.js on lines 265..275

                                              Duplicated Code

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

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

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
                                              Open

                                              Object.extend(document.viewport, {
                                                // Alias this method for consistency
                                                getScrollOffset: document.viewport.getScrollOffsets,
                                              
                                                setScrollOffset: function(offset) {
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 4 hrs to fix
                                              rails/public/javascripts/light_box.js on lines 277..288

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 120.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                handlePosition: function(win) {
                                                  // window has its own position, nothing needs to be done
                                                  if (Object.isNumber(win.options.top) && Object.isNumber(win.options.left))
                                                    return;
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 4 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2899..2908
                                              rails/public/javascripts/light_box.js on lines 4866..4875

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 116.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                focus: function() {
                                                  if (this.focused) return this;
                                              
                                                  this.windowManager.focus(this);
                                                  // Hide the overlay that catch events
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 3 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1581..1593
                                              rails/public/javascripts/light_box.js on lines 3329..3341

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 112.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                getWindow: function(element) {
                                                  element = $(element);
                                              
                                                  if (!element) return;
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 3 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2689..2699
                                              rails/public/javascripts/light_box.js on lines 4649..4659

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 107.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                resize: function(event) {
                                                  var area = this.viewport.getDimensions();
                                              
                                                  if (this.maximizedWindow)
                                                    this.maximizedWindow.setSize(area.width, area.height);
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 3 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2889..2897
                                              rails/public/javascripts/light_box.js on lines 4856..4864

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 103.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                getSize: function(innerSize) {
                                                  if (innerSize)
                                                    return { width:  this.options.width  - this.borderSize.width,
                                                             height: this.options.height - this.borderSize.height };
                                                  else
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 3 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1883..1889
                                              rails/public/javascripts/light_box.js on lines 3640..3646

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 102.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                createOverlays: function() {
                                                  this.modalOverlay = new Element("div", { style: this.overlayStyle });
                                                  this.dragOverlay  = new Element("div", { style: this.overlayStyle+"height: 100%" });
                                                  this.iframe       = Prototype.Browser.IE ? new UI.IframeShim() : null;
                                                },
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 3 hrs to fix
                                              rails/public/javascripts/light_box.js on lines 4816..4820

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 98.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Calendar.Options = {
                                                  MONTHS_SHORT: $w('Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'),
                                                  MONTHS: $w('January February March April May June July August September October November December'),
                                                  WEEKDAYS_1CHAR: $w('S M T W T F S'),
                                                  WEEKDAYS_SHORT: $w('Su Mo Tu We Th Fr Sa'),
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 3 hrs to fix
                                              rails/public/javascripts/light_box.js on lines 6353..6367

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 95.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              Element.addMethods({
                                                enableDrag: function(element) {
                                                  return $(element).writeAttribute('draggable');
                                                },
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 3 other locations - About 2 hrs to fix
                                              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 1534..1546
                                              rails/public/javascripts/light_box.js on lines 1534..1546
                                              rails/public/javascripts/light_box.js on lines 1927..1939

                                              Duplicated Code

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

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

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

                                              Element.addMethods({
                                                enableDrag: function(element) {
                                                  return $(element).writeAttribute('draggable');
                                                },
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 3 other locations - About 2 hrs to fix
                                              rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 1927..1939
                                              rails/public/javascripts/light_box.js on lines 1534..1546
                                              rails/public/javascripts/light_box.js on lines 1927..1939

                                              Duplicated Code

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

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

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
                                              Open

                                              document.whenReady(function() {
                                                if ($('log'))             UI.logger = new UI.ElementLogger('log');
                                                else if (window.console)  UI.logger = new UI.ConsoleLogger();
                                                else                      UI.logger = new UI.MemLogger();
                                              });
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 2 hrs to fix
                                              rails/public/javascripts/light_box.js on lines 2453..2457

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 89.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                destroy: function($super) {
                                                  this.hide();
                                                  if (this.centerOptions)
                                                    Event.stopObserving(this.windowManager.scrollContainer, "scroll", this.centerOptions.handler);
                                                  this.windowManager.unregister(this);
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1412..1418
                                              rails/public/javascripts/light_box.js on lines 3160..3166

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 86.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                restartZIndexes: function(){
                                                  // Reset zIndex
                                                  var zIndex = this.getZIndex() + 1; // keep a zIndex free for overlay divs
                                                  this.stack.windows.each(function(w) {
                                                    w.setZIndex(zIndex);
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2835..2842
                                              rails/public/javascripts/light_box.js on lines 4801..4808

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 85.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.MemLogger = Class.create(UI.Abstract.Logger, {
                                                initialize: function() {
                                                  this.logs = [ ];
                                                },
                                              
                                              
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 826..834
                                              rails/public/javascripts/light_box.js on lines 2399..2407

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 81.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                adapt: function() {
                                                  var dimensions = this.content.getScrollDimensions();
                                                  if (this.options.superflousEffects)
                                                    this.morph(dimensions, true);
                                                  else
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1682..1689
                                              rails/public/javascripts/light_box.js on lines 3430..3437

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 79.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                setTheme: function(theme) {
                                                  this.stack.windows.select(function(w) {
                                                    return !w.options.theme;
                                                  }).invoke('setTheme', theme, true);
                                                  this.options.theme = theme;
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 hrs to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2651..2657
                                              rails/public/javascripts/light_box.js on lines 4611..4617

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 79.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                options: {
                                                  container:   null, // will default to document.body
                                                  zIndex:      0,
                                                  theme:       "alphacube",
                                                  shadowTheme: "mac_shadow",
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2597..2607
                                              rails/public/javascripts/light_box.js on lines 4557..4567

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 74.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                setTheme: function(theme, windowManagerTheme) {
                                                  this.element.removeClassName(this.getTheme()).addClassName(theme);
                                                  // window has it's own theme
                                                  if (!windowManagerTheme)
                                                    this.options.theme = theme;
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2032..2039
                                              rails/public/javascripts/light_box.js on lines 3789..3796

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 72.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                onEndDrag: function(event) {
                                                  if (this.draggedWindow) {
                                                    event.stop();
                                                    this.dragOverlay.remove();
                                                    this.draggedWindow.endDrag();
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2780..2787
                                              rails/public/javascripts/light_box.js on lines 4746..4753

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 71.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                fire: function(eventName, memo) {
                                                  memo = memo || { };
                                                  memo.window = this;
                                                  return (this.savedElement || this.element).fire('window:' + eventName, memo);
                                                },
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 hr to fix
                                              rails/public/javascripts/light_box.js on lines 3196..3200

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 66.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.Benchmark = {
                                                benchmark: function(lambda, iterations) {
                                                  var date = new Date();
                                                  (iterations || 1).times(lambda);
                                                  return (new Date() - date) / 1000;
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 505..511
                                              rails/public/javascripts/light_box.js on lines 1872..1878

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 65.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              document.whenReady(function() {
                                                window.$head = $(document.getElementsByTagName('head')[0]);
                                                window.$body = $(document.body);
                                              });
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 hr to fix
                                              rails/public/javascripts/light_box.js on lines 290..293

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 64.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                onDrag: function(event) {
                                                  if (this.draggedWindow) {
                                                    event.stop();
                                                    this.draggedWindow.drag(event.memo.dx, event.memo.dy);
                                                  }
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2773..2778
                                              rails/public/javascripts/light_box.js on lines 4739..4744

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 64.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              Object.extend(Number.prototype, {
                                                // Snap a number to a grid
                                                snap: function(round) {
                                                  return parseInt(round == 1 ? this : (this / round).floor() * round);
                                                }
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 119..124
                                              rails/public/javascripts/light_box.js on lines 123..128

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 64.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                register: function(win) {
                                                  if (this.getWindow(win.id)) return;
                                              
                                                  this.handlePosition(win);
                                                  this.stack.add(win);
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2659..2665
                                              rails/public/javascripts/light_box.js on lines 4619..4625

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 64.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                              UI.ConsoleLogger = Class.create(UI.Abstract.Logger, {
                                                _log: function(log) {
                                                  console[log.level](log.message);
                                                }
                                              });
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 hr to fix
                                              rails/public/javascripts/light_box.js on lines 2413..2417

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 63.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                destroy: function() {
                                                  this.windows().invoke('destroy');
                                                  this.stack.destroy();
                                                  Event.stopObserving(window, "resize", this.resizeEvent);
                                                },
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2634..2638
                                              rails/public/javascripts/light_box.js on lines 4594..4598

                                              Duplicated Code

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

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

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

                                                setDraggable: function(draggable) {
                                                  this.options.draggable = draggable;
                                                  this.element[(draggable ? 'add' : 'remove') + 'ClassName']('draggable');
                                                  return this;
                                                },
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2013..2017
                                              rails/public/javascripts/light_box.js on lines 3770..3774

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 56.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                setBounds: function(bounds, innerSize) {
                                                  return this.setPosition(bounds.top, bounds.left)
                                                             .setSize(bounds.width, bounds.height, innerSize);
                                                },
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 50 mins to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 1943..1946
                                              rails/public/javascripts/light_box.js on lines 3700..3703

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                                unregister: function(win) {
                                                  this.stack.remove(win);
                                              
                                                  if (win == this.focusedWindow)
                                                    this.focusedWindow = null;
                                              Severity: Major
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 40 mins to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2667..2672
                                              rails/public/javascripts/light_box.js on lines 4627..4632

                                              Duplicated Code

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

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

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

                                                restore: function(win) {
                                                  if (this.maximizedWindow) {
                                                    this.resetOverflow();
                                                    this.maximizedWindow = false;
                                                  }
                                              Severity: Minor
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 35 mins to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2795..2801
                                              rails/public/javascripts/light_box.js on lines 4761..4767

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 46.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                focus: function(win) {
                                                  // Blur the previous focused window
                                                  if (this.focusedWindow)
                                                    this.focusedWindow.blur();
                                                  this.focusedWindow = win;
                                              Severity: Minor
                                              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 35 mins to fix
                                              rails/app/assets/javascripts/livepipe/window.js on lines 2855..2860
                                              rails/public/javascripts/light_box.js on lines 4822..4827

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 46.

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

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

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

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

                                              Refactorings

                                              Further Reading

                                              There are no issues that match your filters.

                                              Category
                                              Status