talho/openphin

View on GitHub
app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js

Summary

Maintainability
F
4 days
Test Coverage

Function offset has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    offset: function(options, returnObject) {
        var x = 0, y = 0, sl = 0, st = 0,
            elem = this[0], parent = this[0], op, parPos, elemPos = $.css(elem, 'position'),
            mo = $.browser.mozilla, ie = $.browser.msie, sf = $.browser.safari, oa = $.browser.opera,
            absparent = false, relparent = false, 
Severity: Major
Found in app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js - About 2 hrs to fix

    Avoid deeply nested control flow statements.
    Open

                            if (mo && parent != elem && $.css(parent, 'overflow') != 'visible') {
                                x += num(parent, 'borderLeftWidth');
                                y += num(parent, 'borderTopWidth');
                            }
    Severity: Major
    Found in app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js - About 45 mins to fix

      Function handleOffsetReturn has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      var handleOffsetReturn = function(elem, options, x, y, sl, st) {
      Severity: Minor
      Found in app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (options.scroll) {
                                    // get scroll offsets
                                    sl += parent.scrollLeft;
                                    st += parent.scrollTop;
                                }
        Severity: Major
        Found in app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js - About 45 mins to fix

          Consider simplifying this complex logical expression.
          Open

                              if ( (mo && !absparent && elemPos != 'fixed') || 
                                   (ie && elemPos == 'static' && !relparent) ) {
                                  x += num(parent, 'borderLeftWidth');
                                  y += num(parent, 'borderTopWidth');
                              }
          Severity: Major
          Found in app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js - About 40 mins to fix

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

                height: function() {
                    if ( this[0] == window )
                        return self.innerHeight ||
                            $.boxModel && document.documentElement.clientHeight || 
                            document.body.clientHeight;
            app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 66..76

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 115.

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

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

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

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

            Refactorings

            Further Reading

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

                width: function() {
                    if ( this[0] == window )
                        return self.innerWidth ||
                            $.boxModel && document.documentElement.clientWidth ||
                            document.body.clientWidth;
            app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 36..46

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 115.

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

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

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

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

            Refactorings

            Further Reading

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

                innerWidth: function() {
                    return this[0] == window || this[0] == document ?
                        this.width() :
                        this.is(':visible') ?
                            this[0].offsetWidth - num(this, 'borderLeftWidth') - num(this, 'borderRightWidth') :
            app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 90..96

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 113.

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

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

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

                outerWidth: function() {
                    return this[0] == window || this[0] == document ?
                        this.width() :
                        this.is(':visible') ?
                            this[0].offsetWidth :
            app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 129..135

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 113.

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

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

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

                innerHeight: function() {
                    return this[0] == window || this[0] == document ?
                        this.height() :
                        this.is(':visible') ?
                            this[0].offsetHeight - num(this, 'borderTopWidth') - num(this, 'borderBottomWidth') :
            app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 110..116

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 113.

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

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

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

                outerHeight: function() {
                    return this[0] == window || this[0] == document ?
                        this.height() :
                        this.is(':visible') ?
                            this[0].offsetHeight :
            app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 148..154

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 113.

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

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

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 ( this[0] == window || this[0] == document )
                        return self.pageYOffset ||
                            $.boxModel && document.documentElement.scrollTop ||
                            document.body.scrollTop;
            app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 190..193

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 65.

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

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

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

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

            Refactorings

            Further Reading

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

                    if ( this[0] == window || this[0] == document )
                        return self.pageXOffset ||
                            $.boxModel && document.documentElement.scrollLeft ||
                            document.body.scrollLeft;
            app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 232..235

            Duplicated Code

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

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

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

            There are no issues that match your filters.

            Category
            Status