wikimedia/mediawiki-core

View on GitHub
resources/src/mediawiki.Uri/Uri.js

Summary

Maintainability
C
1 day
Test Coverage

Function UriRelative has 162 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    mw.UriRelative = function ( documentLocation ) {
        var getDefaultUri = ( function () {
            // Cache
            var href, uri;

Severity: Major
Found in resources/src/mediawiki.Uri/Uri.js - About 6 hrs to fix

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

            function Uri( uri, options ) {
                var prop, hrefCur,
                    hasOptions = ( options !== undefined ),
                    defaultUri = getDefaultUri();
    
    
    Severity: Minor
    Found in resources/src/mediawiki.Uri/Uri.js - About 1 hr to fix

      Function parse has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  parse: function ( str, options ) {
                      var q, matches,
                          uri = this,
                          hasOwn = Object.prototype.hasOwnProperty;
      
      
      Severity: Minor
      Found in resources/src/mediawiki.Uri/Uri.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Open

                                        if ( Array.isArray( q[ k ] ) ) {
                                            q[ k ].push( v );
                                        }
        Severity: Major
        Found in resources/src/mediawiki.Uri/Uri.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                          if ( typeof q[ k ] === 'string' ) {
                                              q[ k ] = [ q[ k ] ];
                                          }
          Severity: Major
          Found in resources/src/mediawiki.Uri/Uri.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ( Array.isArray( uri[ prop ] ) || $.isPlainObject( uri[ prop ] ) ) {
                                            this[ prop ] = $.extend( true, {}, uri[ prop ] );
                                        } else {
                                            this[ prop ] = uri[ prop ];
                                        }
            Severity: Major
            Found in resources/src/mediawiki.Uri/Uri.js - About 45 mins to fix

              There are no issues that match your filters.

              Category
              Status