nemesiscodex/openfonacide

View on GitHub
static/js/jquery.address.js

Summary

Maintainability
F
5 days
Test Coverage

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

    $.address = (function () {

        var _trigger = function(name) {
               var e = $.extend($.Event(name), (function() {
                    var parameters = {},
Severity: Major
Found in static/js/jquery.address.js - About 2 days to fix

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

    /*! jQuery Address v${version} | (c) 2009, 2013 Rostislav Hristov | jquery.org/license */
    (function ($) {
    
        $.address = (function () {
    
    
    Severity: Major
    Found in static/js/jquery.address.js - About 1 day to fix

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

                  _load = function() {
                      if (!_loaded) {
                          _loaded = TRUE;
                          _options();
                          $('a[rel*="address:"]').address();
      Severity: Major
      Found in static/js/jquery.address.js - About 3 hrs to fix

        Function value has 44 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 static/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 static/js/jquery.address.js - About 1 hr to fix

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

                $.fn.address = function(fn) {
                    $(this).each(function(index) {
                        if (!$(this).data('address')) {
                            $(this).on('click', function(e) {
                                if (e.shiftKey || e.ctrlKey || e.metaKey || e.which == 2) {
            Severity: Minor
            Found in static/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 = '#' + _value;
                                              } else {
                                                  _l.replace('#' + _value);
              Severity: Major
              Found in static/js/jquery.address.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

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

                  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 static/js/jquery.address.js and 1 other location - About 1 hr to fix
                  static/js/jquery.address.js on lines 225..231

                  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

                              _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 static/js/jquery.address.js and 1 other location - About 1 hr to fix
                  static/js/jquery.address.js on lines 204..210

                  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 static/js/jquery.address.js and 1 other location - About 55 mins to fix
                  static/js/jquery.address.js on lines 28..31

                  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 static/js/jquery.address.js and 1 other location - About 55 mins to fix
                  static/js/jquery.address.js on lines 32..35

                  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

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

                                              } else if (_value != _href()) {
                                                  if (_opts.history) {
                                                      _l.hash = '#' + _value;
                                                  } else {
                                                      _l.replace('#' + _value);
                  Severity: Minor
                  Found in static/js/jquery.address.js and 1 other location - About 40 mins to fix
                  static/js/jquery.address.js on lines 463..475

                  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 2 locations. Consider refactoring.
                  Open

                                              if (_webkit) {
                                                  if (_opts.history) {
                                                      _l.hash = '#' + _value;
                                                  } else {
                                                      _l.replace('#' + _value);
                  Severity: Minor
                  Found in static/js/jquery.address.js and 1 other location - About 40 mins to fix
                  static/js/jquery.address.js on lines 469..475

                  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

                  There are no issues that match your filters.

                  Category
                  Status