wikimedia/mediawiki-core

View on GitHub
resources/src/jquery/jquery.makeCollapsible.js

Summary

Maintainability
C
1 day
Test Coverage

Function makeCollapsible has 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.makeCollapsible = function ( options ) {
        options = options || {};

        this.each( function () {
            // Ensure class "mw-collapsible" is present in case .makeCollapsible()
Severity: Major
Found in resources/src/jquery/jquery.makeCollapsible.js - About 4 hrs to fix

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

        function togglingHandler( $toggle, $collapsible, e, options ) {
            options = options || {};
    
            if ( e ) {
                if (
    Severity: Minor
    Found in resources/src/jquery/jquery.makeCollapsible.js - About 1 hr to fix

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

          function toggleElement( $collapsible, expand, $defaultToggle, options ) {
              options = options || {};
      
              // Validate parameters
      
      
      Severity: Minor
      Found in resources/src/jquery/jquery.makeCollapsible.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Open

                                if ( firstval === undefined || !firstval || firstval === '-1' || firstval === -1 ) {
                                    $firstItem.prop( 'value', '1' );
                                }
        Severity: Major
        Found in resources/src/jquery/jquery.makeCollapsible.js - About 45 mins to fix

          There are no issues that match your filters.

          Category
          Status