concord-consortium/rigse

View on GitHub
rails/app/assets/javascripts/livepipe/window.js

Summary

Maintainability
F
2 mos
Test Coverage

File window.js has 1543 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/livepipe/window.js - About 4 days 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/livepipe/window.js - About 5 hrs to fix

      Function CSS has a Cognitive Complexity of 30 (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/livepipe/window.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

      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/livepipe/window.js - About 3 hrs to fix

        Function CSS has 66 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/livepipe/window.js - About 2 hrs to fix

          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/livepipe/window.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 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/livepipe/window.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/livepipe/window.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

            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/livepipe/window.js and 2 other locations - About 1 wk to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3811..3991
            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 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/livepipe/window.js and 2 other locations - About 4 days to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4159..4249
            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

            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/livepipe/window.js and 2 other locations - About 2 days to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 355..434
            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/livepipe/window.js and 2 other locations - About 2 days to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 58..122
            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/livepipe/window.js and 2 other locations - About 2 days to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4032..4056
            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/livepipe/window.js and 2 other locations - About 2 days to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4892..4939
            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

            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/livepipe/window.js and 1 other location - About 1 day to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4569..4592

            Duplicated Code

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

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

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

            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/livepipe/window.js and 2 other locations - About 1 day to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3609..3628
            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 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/livepipe/window.js and 2 other locations - About 1 day to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3373..3390
            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/livepipe/window.js and 2 other locations - About 1 day to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3705..3726
            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

              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/livepipe/window.js and 2 other locations - About 1 day to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3660..3673
            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

              options: {
            
                // Property: theme
                //   window theme, uses the window manager theme as default
                theme:         null,
            Severity: Major
            Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 1 day to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 2947..3031
            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

              hide: function() {
                if (!this.visible) return this;
            
                this.fire('hiding');
                this.effect('hide');
            Severity: Major
            Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 7 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3261..3283
            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 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/livepipe/window.js and 2 other locations - About 7 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4719..4737
            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/livepipe/window.js and 2 other locations - About 6 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 2423..2451
            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/livepipe/window.js and 2 other locations - About 6 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3231..3252
            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/livepipe/window.js and 2 other locations - About 6 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3145..3154
            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/livepipe/window.js and 2 other locations - About 6 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4769..4780
            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/livepipe/window.js and 2 other locations - About 5 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3446..3461
            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 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/livepipe/window.js and 2 other locations - About 5 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4834..4850
            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/livepipe/window.js and 2 other locations - About 5 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3350..3363
            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/livepipe/window.js and 2 other locations - About 5 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4878..4888
            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/livepipe/window.js and 2 other locations - About 5 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3470..3484
            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/livepipe/window.js and 2 other locations - About 5 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3399..3410
            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 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/livepipe/window.js and 2 other locations - About 5 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4782..4794
            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/livepipe/window.js and 2 other locations - About 5 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3589..3600
            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/livepipe/window.js and 1 other location - About 4 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3751..3764

            Duplicated Code

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

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

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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/livepipe/window.js and 2 other locations - About 4 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 134..157
            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/livepipe/window.js and 2 other locations - About 4 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 2359..2382
            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 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/livepipe/window.js and 2 other locations - About 4 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4866..4875
            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/livepipe/window.js and 2 other locations - About 3 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3329..3341
            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/livepipe/window.js and 2 other locations - About 3 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4649..4659
            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/livepipe/window.js and 2 other locations - About 3 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4856..4864
            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/livepipe/window.js and 2 other locations - About 3 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3640..3646
            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 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/livepipe/window.js and 2 other locations - About 2 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3160..3166
            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/livepipe/window.js and 2 other locations - About 2 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4801..4808
            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/livepipe/window.js and 2 other locations - About 2 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 2399..2407
            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

              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/livepipe/window.js and 2 other locations - About 2 hrs to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4611..4617
            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

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

              options: {
                container:   null, // will default to document.body
                zIndex:      0,
                theme:       "alphacube",
                shadowTheme: "mac_shadow",
            Severity: Major
            Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 1 hr to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4557..4567
            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/livepipe/window.js and 2 other locations - About 1 hr to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3789..3796
            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/livepipe/window.js and 2 other locations - About 1 hr to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4746..4753
            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

            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/livepipe/window.js and 2 other locations - About 1 hr to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 1872..1878
            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 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/livepipe/window.js and 2 other locations - About 1 hr to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4619..4625
            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 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/livepipe/window.js and 2 other locations - About 1 hr to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4739..4744
            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/livepipe/window.js and 2 other locations - About 1 hr to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 123..128
            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

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

              initialize: function() {
                this.element = new Element('iframe', {
                  style: 'position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);display:none',
                  src: 'javascript:false;',
                  frameborder: 0
            Severity: Major
            Found in rails/app/assets/javascripts/livepipe/window.js and 1 other location - About 1 hr to fix
            rails/app/assets/javascripts/livepipe/livepipe.js on lines 316..323

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 62.

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

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

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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/livepipe/window.js and 2 other locations - About 1 hr to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4594..4598
            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/livepipe/window.js and 2 other locations - About 1 hr to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3770..3774
            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/livepipe/window.js and 2 other locations - About 50 mins to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3700..3703
            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/livepipe/window.js and 2 other locations - About 40 mins to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4627..4632
            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

              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/livepipe/window.js and 2 other locations - About 35 mins to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4822..4827
            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

            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/livepipe/window.js and 2 other locations - About 35 mins to fix
            rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4761..4767
            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

            There are no issues that match your filters.

            Category
            Status