autolab/Autolab

View on GitHub
app/assets/javascripts/jquery.simplemodal-1.4.4.js

Summary

Maintainability
F
4 days
Test Coverage

File jquery.simplemodal-1.4.4.js has 411 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * SimpleModal 1.4.4 - jQuery Plugin
 * http://simplemodal.com/
 * Copyright (c) 2013 Eric Martin
 * Licensed under MIT and GPL
Severity: Minor
Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js - About 5 hrs to fix

    Function create has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            create: function (data) {
                var s = this;
    
                // get the window properties
                s.getDimensions();
    Severity: Major
    Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js - About 2 hrs to fix

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

              fixIE: function () {
                  var s = this, p = s.o.position;
      
                  // simulate fixed position - adapted from BlockUI
                  $.each([s.d.iframe || null, !s.o.modal ? null : s.d.overlay, s.d.container.css('position') === 'fixed' ? s.d.container : null], function (i, el) {
      Severity: Minor
      Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js - About 1 hr to fix

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

                setContainerDimensions: function () {
                    var s = this,
                        badIE = browser.ie6 || browser.ie7;
        
                    // get the dimensions for the container and data
        Severity: Minor
        Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js - About 1 hr to fix

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

                  init: function (data, options) {
                      var s = this;
          
                      // don't allow multiple calls
                      if (s.d.data) {
          Severity: Minor
          Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js - About 1 hr to fix

            Function bindEvents has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    bindEvents: function () {
                        var s = this;
            
                        // bind the close event to any element with the closeClass class
                        $('.' + s.o.closeClass).bind('click.simplemodal', function (e) {
            Severity: Minor
            Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js - About 1 hr to fix

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

                      close: function () {
                          var s = this;
              
                          // prevent close when dialog does not exist
                          if (!s.d.data) {
              Severity: Minor
              Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js - About 1 hr to fix

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

                                                le = left.indexOf('%') === -1
                                                    ? left + ' + (t = ' + sl + ' ? ' + sl + ' : ' + bsl + ') + "px"'
                                                    : parseInt(left.replace(/%/, '')) + ' * ((' + cw + ' || ' + bcw + ') / 100) + (t = ' + sl + ' ? ' + sl + ' : ' + bsl + ') + "px"';
                Severity: Major
                Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/jquery.simplemodal-1.4.4.js on lines 465..467

                Duplicated Code

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

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

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

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

                                            te = top.indexOf('%') === -1
                                                ? top + ' + (t = ' + st + ' ? ' + st + ' : ' + bst + ') + "px"'
                                                : parseInt(top.replace(/%/, '')) + ' * ((' + ch + ' || ' + bch + ') / 100) + (t = ' + st + ' ? ' + st + ' : ' + bst + ') + "px"';
                Severity: Major
                Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/jquery.simplemodal-1.4.4.js on lines 471..473

                Duplicated Code

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

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

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

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

                            var ch = s.d.origHeight ? s.d.origHeight : browser.opera ? s.d.container.height() : s.getVal(badIE ? s.d.container[0].currentStyle['height'] : s.d.container.css('height'), 'h'),
                Severity: Major
                Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/jquery.simplemodal-1.4.4.js on lines 549..549

                Duplicated Code

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

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

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

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

                                cw = s.d.origWidth ? s.d.origWidth : browser.opera ? s.d.container.width() : s.getVal(badIE ? s.d.container[0].currentStyle['width'] : s.d.container.css('width'), 'w'),
                Severity: Major
                Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/jquery.simplemodal-1.4.4.js on lines 548..548

                Duplicated Code

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

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

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

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

                            if (!cw) {
                                if (!dw) {cw = mow;}
                                else {
                                    if (dw > mw) {cw = mw;}
                                    else if (s.o.minWidth && mow !== 'auto' && dw < mow) {cw = mow;}
                Severity: Major
                Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/jquery.simplemodal-1.4.4.js on lines 563..573

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 92.

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

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

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

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

                Refactorings

                Further Reading

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

                            if (!ch) {
                                if (!dh) {ch = moh;}
                                else {
                                    if (dh > mh) {ch = mh;}
                                    else if (s.o.minHeight && moh !== 'auto' && dh < moh) {ch = moh;}
                Severity: Major
                Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/jquery.simplemodal-1.4.4.js on lines 577..587

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 92.

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

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

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

                                            te = '(' + ch + ' || ' + bch + ') / 2 - (this.offsetHeight / 2) + (t = ' + st + ' ? ' + st + ' : ' + bst + ') + "px"';
                Severity: Minor
                Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js and 1 other location - About 35 mins to fix
                app/assets/javascripts/jquery.simplemodal-1.4.4.js on lines 478..478

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

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

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

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

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

                Refactorings

                Further Reading

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

                                            le = '(' + cw + ' || ' + bcw + ') / 2 - (this.offsetWidth / 2) + (t = ' + sl + ' ? ' + sl + ' : ' + bsl + ') + "px"';
                Severity: Minor
                Found in app/assets/javascripts/jquery.simplemodal-1.4.4.js and 1 other location - About 35 mins to fix
                app/assets/javascripts/jquery.simplemodal-1.4.4.js on lines 477..477

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

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

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

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

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

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status