wikimedia/mediawiki-extensions-VisualEditor

View on GitHub
modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js

Summary

Maintainability
C
1 day
Test Coverage

File ve.dm.MWTransclusionModel.js has 330 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * VisualEditor DataModel MWTransclusionModel class.
 *
 * @copyright See AUTHORS.txt
 * @license The MIT License (MIT); see LICENSE.txt
Severity: Minor
Found in modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js - About 3 hrs to fix

    Function insertTransclusionNode has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        ve.dm.MWTransclusionModel.prototype.insertTransclusionNode = function ( surfaceFragment, forceType ) {
            const deferred = ve.createDeferred(),
                baseNodeClass = ve.dm.MWTransclusionNode;
    
            const insertNode = ( isInline, generatedContents ) => {
    Severity: Minor
    Found in modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js - About 1 hr to fix

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

          ve.dm.MWTransclusionModel.prototype.resolveChangeQueue = function ( queue ) {
              const resolveQueue = [];
      
              for ( let i = 0; i < queue.length; i++ ) {
                  const item = queue[ i ];
      Severity: Minor
      Found in modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js - About 1 hr to fix

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

            ve.dm.MWTransclusionModel.prototype.processChangeQueue = function () {
                const templateNamespaceId = mw.config.get( 'wgNamespaceIds' ).template,
                    titles = [];
        
                if ( !this.changeQueue.length ) {
        Severity: Minor
        Found in modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js - About 1 hr to fix

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

              ve.dm.MWTransclusionModel.prototype.load = function ( data ) {
                  const promises = [];
          
                  // Convert single part format to multi-part format
                  // Parsoid doesn't use this format any more, but we accept it for backwards compatibility
          Severity: Minor
          Found in modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status