wikimedia/mediawiki-extensions-TwnMainPage

View on GitHub
resources/js/ext.translate.mainpage.signup.js

Summary

Maintainability
C
1 day
Test Coverage

Function setupSignupForm has 161 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    mw.translate.setupSignupForm = function ( $form ) {
        var $username = $form.find( 'input[name="wpName"]' ),
            $email = $form.find( 'input[name="wpEmail"]' ),
            $password = $form.find( 'input[name="wpPassword"]' ),
            $reason = $form.find( 'input[name="reason"]' );
Severity: Major
Found in resources/js/ext.translate.mainpage.signup.js - About 6 hrs to fix

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

            function handleSubmit( e ) {
                var reqCreate, codes, preferences,
                    api = new mw.Api(),
                    username = $username.val(),
                    password = $password.val(),
    Severity: Minor
    Found in resources/js/ext.translate.mainpage.signup.js - About 1 hr to fix

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

              function handleAccountCreationFailure( errorcode, result ) {
                  var $element = $( [] ),
                      $genericErrorContainer = $form.find( '.twnmp-signup-generic-error' ).last();
      
                  switch ( errorcode ) {
      Severity: Minor
      Found in resources/js/ext.translate.mainpage.signup.js - About 1 hr to fix

        Function initLanguageSelector has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function initLanguageSelector() {
                    $form.find( '.signup-language-selector' ).uls( {
                        onSelect: function ( language ) {
                            var $checkbox = $form.find( 'input[name="signuplanguage"][value="' + language + '"]' );
                            if ( $checkbox.length ) {
        Severity: Minor
        Found in resources/js/ext.translate.mainpage.signup.js - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status