spotweb/spotweb

View on GitHub
templates/we1rdo/js/jquery.address.js

Summary

Maintainability
F
1 wk
Test Coverage

Function address has 619 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.address = (function () {

        var _trigger = function(name) {
                var ev = $.extend($.Event(name),
                    (function() {
Severity: Major
Found in templates/we1rdo/js/jquery.address.js - About 3 days to fix

    File jquery.address.js has 656 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * jQuery Address Plugin v1.5
     * http://www.asual.com/jquery/address/
     *
     * Copyright (c) 2009-2010 Rostislav Hristov
    Severity: Major
    Found in templates/we1rdo/js/jquery.address.js - About 1 day to fix

      Function _load has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  _load = function() {
                      if (!_loaded) {
                          _loaded = TRUE;
                          _options();
                          var complete = function() {
      Severity: Major
      Found in templates/we1rdo/js/jquery.address.js - About 3 hrs to fix

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

                    value: function(value) {
                        if (value !== UNDEFINED) {
                            value = _strict(value);
                            if (value == '/') {
                                value = '';
        Severity: Minor
        Found in templates/we1rdo/js/jquery.address.js - About 1 hr to fix

          Function parameter has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      parameter: function(name, value, append) {
                          var i, params;
                          if (value !== UNDEFINED) {
                              var names = this.parameterNames();
                              params = [];
          Severity: Minor
          Found in templates/we1rdo/js/jquery.address.js - About 1 hr to fix

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

                $.fn.address = function(fn) {
                    var sel;
                    if (typeof fn == 'string') {
                        sel = fn;
                        fn = undefined;
            Severity: Minor
            Found in templates/we1rdo/js/jquery.address.js - About 1 hr to fix

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

                          _preventDefault = function(){
                              _value = _old;
              
                              if (_supportsState()) {
                                  _h.popState({}, '', _opts.state.replace(/\/$/, '') + (_value === '' ? '/' : _value));
              Severity: Minor
              Found in templates/we1rdo/js/jquery.address.js - About 1 hr to fix

                Avoid deeply nested control flow statements.
                Open

                                            } else if (_value != _href()) {
                                                if (_opts.history) {
                                                    _l.hash = '#' + _crawl(_value, TRUE);
                                                } else {
                                                    _l.replace('#' + _crawl(_value, TRUE));
                Severity: Major
                Found in templates/we1rdo/js/jquery.address.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                  if (_opts.history) {
                                                      _l.hash = '#' + _crawl(_value, TRUE);
                                                  } else {
                                                      _l.replace('#' + _crawl(_value, TRUE));
                                                  }
                  Severity: Major
                  Found in templates/we1rdo/js/jquery.address.js - About 45 mins to fix

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

                                            if (_supportsState()) {
                                                _h[_opts.history ? 'pushState' : 'replaceState']({}, '',
                                                    _opts.state.replace(/\/$/, '') + (_value === '' ? '/' : _value));
                                            } else {
                                                _silent = TRUE;
                    Severity: Major
                    Found in templates/we1rdo/js/jquery.address.js and 1 other location - About 1 day to fix
                    templates/we1rdo/js/jquery.address.js on lines 120..145

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

                    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 (_supportsState()) {
                                        _h.popState({}, '', _opts.state.replace(/\/$/, '') + (_value === '' ? '/' : _value));
                                    } else {
                                        _silent = TRUE;
                                        if (_webkit) {
                    Severity: Major
                    Found in templates/we1rdo/js/jquery.address.js and 1 other location - About 1 day to fix
                    templates/we1rdo/js/jquery.address.js on lines 522..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 210.

                    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

                                _unload = function() {
                                    if (_t.removeEventListener) {
                                        _t.removeEventListener(HASH_CHANGE, _listen, FALSE);
                                    } else if (_t.detachEvent) {
                                        _t.detachEvent('on' + HASH_CHANGE, _listen);
                    Severity: Major
                    Found in templates/we1rdo/js/jquery.address.js and 1 other location - About 1 hr to fix
                    templates/we1rdo/js/jquery.address.js on lines 262..268

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

                    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 ((_msie && _version > 7) || (!_msie && _hashchange)) {
                                                if (_t.addEventListener) {
                                                    _t.addEventListener(HASH_CHANGE, _listen, FALSE);
                                                } else if (_t.attachEvent) {
                                                    _t.attachEvent('on' + HASH_CHANGE, _listen);
                    Severity: Major
                    Found in templates/we1rdo/js/jquery.address.js and 1 other location - About 1 hr to fix
                    templates/we1rdo/js/jquery.address.js on lines 302..308

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

                    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

                                _unbind = function(value,  fn) {
                                    $().unbind.apply($($.address), Array.prototype.slice.call(arguments));
                                    return $.address;
                                },
                    Severity: Minor
                    Found in templates/we1rdo/js/jquery.address.js and 1 other location - About 55 mins to fix
                    templates/we1rdo/js/jquery.address.js on lines 40..43

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 54.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                _bind = function(value, data, fn) {
                                    $().bind.apply($($.address), Array.prototype.slice.call(arguments));
                                    return $.address;
                                },
                    Severity: Minor
                    Found in templates/we1rdo/js/jquery.address.js and 1 other location - About 55 mins to fix
                    templates/we1rdo/js/jquery.address.js on lines 44..47

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 54.

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

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

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

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

                    Refactorings

                    Further Reading

                    There are no issues that match your filters.

                    Category
                    Status