Undev/redmine-stuff-to-do-plugin

View on GitHub
assets/javascripts/ui/ui.accordion.js

Summary

Maintainability
D
1 day
Test Coverage

File ui.accordion.js has 324 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jQuery UI Accordion @VERSION
 *
 * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
Severity: Minor
Found in assets/javascripts/ui/ui.accordion.js - About 3 hrs to fix

    Function _init has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _init: function() {
            var options = this.options;
    
            if ( options.navigation ) {
                var current = this.element.find("a").filter(options.navigationFilter);
    Severity: Major
    Found in assets/javascripts/ui/ui.accordion.js - About 2 hrs to fix

      Function toggle has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function toggle(toShow, toHide, data, clickedActive, down) {
          var options = $.data(this, "accordion").options;
          options.toShow = toShow;
          options.toHide = toHide;
          options.data = data;
      Severity: Major
      Found in assets/javascripts/ui/ui.accordion.js - About 2 hrs to fix

        Function clickHandler has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function clickHandler(event) {
            var options = $.data(this, "accordion").options;
            if (options.disabled) {
                return false;
            }
        Severity: Minor
        Found in assets/javascripts/ui/ui.accordion.js - About 1 hr to fix

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

                  slide: function(options, additions) {
                      options = $.extend({
                          easing: "swing",
                          duration: 300
                      }, options, additions);
          Severity: Minor
          Found in assets/javascripts/ui/ui.accordion.js - About 1 hr to fix

            Function _keydown has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _keydown: function(event) {
                    if (this.options.disabled || event.altKey || event.ctrlKey)
                        return;
            
                    var keyCode = $.ui.keyCode;
            Severity: Minor
            Found in assets/javascripts/ui/ui.accordion.js - About 1 hr to fix

              Function toggle has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function toggle(toShow, toHide, data, clickedActive, down) {
              Severity: Minor
              Found in assets/javascripts/ui/ui.accordion.js - About 35 mins to fix

                Avoid too many return statements within this function.
                Open

                    return false;
                Severity: Major
                Found in assets/javascripts/ui/ui.accordion.js - About 30 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status