wikimedia/mediawiki-extensions-VisualEditor

View on GitHub
modules/ve-mw/preinit/ve.init.mw.ArticleTargetLoader.js

Summary

Maintainability
D
1 day
Test Coverage

Function requestParsoidData has 154 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        requestParsoidData: function ( pageName, options, noRestbase, noMetadata ) {
            const section = options.section !== undefined ? options.section : null,
                useRestbase = !noRestbase && ( conf.fullRestbaseUrl || conf.restbaseUrl ) && section === null;

            options = options || {};
Severity: Major
Found in modules/ve-mw/preinit/ve.init.mw.ArticleTargetLoader.js - About 6 hrs to fix

    File ve.init.mw.ArticleTargetLoader.js has 346 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * VisualEditor MediaWiki ArticleTargetLoader.
     *
     * @copyright See AUTHORS.txt
     * @license The MIT License (MIT); see LICENSE.txt
    Severity: Minor
    Found in modules/ve-mw/preinit/ve.init.mw.ArticleTargetLoader.js - About 4 hrs to fix

      Function createCheckboxFields has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              createCheckboxFields: function ( checkboxesDef, widgetConfig ) {
                  const checkboxFields = [],
                      checkboxesByName = {};
      
                  if ( checkboxesDef ) {
      Severity: Minor
      Found in modules/ve-mw/preinit/ve.init.mw.ArticleTargetLoader.js - About 1 hr to fix

        Function requestPageData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                requestPageData: function ( mode, pageName, options ) {
                    options = options || {};
                    const apiRequest = mode === 'source' ?
                        this.requestWikitext.bind( this, pageName, options ) :
                        this.requestParsoidData.bind( this, pageName, options );
        Severity: Minor
        Found in modules/ve-mw/preinit/ve.init.mw.ArticleTargetLoader.js - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                                          if ( confirmed ) {
                                              return dataPromise;
                                          } else {
                                              // If they requested the latest version, invalidate the autosave state
                                              mw.storage.session.remove( 've-docstate' );
          Severity: Major
          Found in modules/ve-mw/preinit/ve.init.mw.ArticleTargetLoader.js - About 45 mins to fix

            There are no issues that match your filters.

            Category
            Status