modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js
File ve.dm.MWTransclusionModel.js
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* VisualEditor DataModel MWTransclusionModel class.
*
* @copyright See AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
Function insertTransclusionNode
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.dm.MWTransclusionModel.prototype.insertTransclusionNode = function ( surfaceFragment, forceType ) {
const deferred = ve.createDeferred(),
baseNodeClass = ve.dm.MWTransclusionNode;
const insertNode = ( isInline, generatedContents ) => {
Function resolveChangeQueue
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.dm.MWTransclusionModel.prototype.resolveChangeQueue = function ( queue ) {
const resolveQueue = [];
for ( let i = 0; i < queue.length; i++ ) {
const item = queue[ i ];
Function processChangeQueue
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.dm.MWTransclusionModel.prototype.processChangeQueue = function () {
const templateNamespaceId = mw.config.get( 'wgNamespaceIds' ).template,
titles = [];
if ( !this.changeQueue.length ) {
Function load
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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