wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 436 of 912 total issues

Function create has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

ve.ui.MWWikitextDataTransferHandlerFactory.prototype.create = function () {
    // Parent method
    const handler = ve.ui.MWWikitextDataTransferHandlerFactory.super.prototype.create.apply( this, arguments ),
        resolve = handler.resolve.bind( handler );

Severity: Minor
Found in modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js - About 1 hr to fix

    Function runDiffTest has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            runDiffTest: function ( oldHtml, newHtml, done ) {
                const target = ve.init.target,
                    surface = target.surface;
    
                if ( target.saveDialog ) {
    Severity: Minor
    Found in build/screenshots-client/utils.js - About 1 hr to fix

      Function resetCaption has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      ve.ui.MWMediaDialog.prototype.resetCaption = function () {
          const doc = this.getFragment().getDocument();
      
          // Get existing caption. We only do this in setup, because the caption
          // should not reset to original if the image is replaced or edited.
      Severity: Minor
      Found in modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js - About 1 hr to fix

        Function setupHotkeyTriggers has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        ve.ui.MWTransclusionDialog.prototype.setupHotkeyTriggers = function () {
            // Lower-case modifier and key names as specified in {@see ve.ui.Trigger}
            const isMac = ve.getSystemPlatform() === 'mac',
                meta = isMac ? 'meta+' : 'ctrl+';
            const hotkeys = {
        Severity: Minor
        Found in modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js - About 1 hr to fix

          Function surfaceReady has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          ve.init.mw.DesktopArticleTarget.prototype.surfaceReady = function () {
              if ( !this.activating ) {
                  // Activation was aborted before we got here. Do nothing
                  // TODO are there things we need to clean up?
                  return;
          Severity: Minor
          Found in modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js - About 1 hr to fix

            Function attachImageModel has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            ve.ui.MWMediaDialog.prototype.attachImageModel = function () {
                if ( this.imageModel ) {
                    this.imageModel.disconnect( this );
                    this.sizeWidget.disconnect( this );
                }
            Severity: Minor
            Found in modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js - About 1 hr to fix

              Function removePages has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.removePages = function ( pagesNamesToRemove ) {
                  const pagesToRemove = [],
                      isCurrentParameter = this.pages[ this.currentPageName ] instanceof ve.ui.MWParameterPage;
                  let isCurrentPageRemoved = false,
                      prevSelectionCandidate, nextSelectionCandidate;
              Severity: Minor
              Found in modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js - About 1 hr to fix

                Function selectRange has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                ve.ui.MWAceEditorWidget.prototype.selectRange = function ( from, to ) {
                    this.focus();
                    this.loadingPromise.done( () => {
                        const doc = this.editor.getSession().getDocument(),
                            lines = doc.getAllLines();
                Severity: Minor
                Found in modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js - About 1 hr to fix

                  Function describeChanges has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  ve.dm.MWExtensionNode.static.describeChanges = function ( attributeChanges, attributes, element ) {
                      const descriptions = [],
                          fromBody = attributeChanges.mw.from.body,
                          toBody = attributeChanges.mw.to.body;
                  
                  
                  Severity: Minor
                  Found in modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js - About 1 hr to fix

                    Function initializeFilters has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    ve.ui.MWTransclusionOutlineTemplateWidget.prototype.initializeFilters = function () {
                        this.searchWidget = new OO.ui.SearchInputWidget( {
                            title: ve.msg( 'visualeditor-dialog-transclusion-filter-title', this.templateModel.getSpec().getLabel() ),
                            placeholder: ve.msg( 'visualeditor-dialog-transclusion-filter-placeholder' ),
                            classes: [ 've-ui-mwTransclusionOutlineTemplateWidget-searchWidget' ]

                      Function hasMatchingAncestor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      ve.dm.MWWikitextSurfaceFragment.prototype.hasMatchingAncestor = function ( type, attributes ) {
                          const nodes = this.getSelectedLeafNodes();
                      
                          let all = !!nodes.length;
                          for ( let i = 0, len = nodes.length; i < len; i++ ) {
                      Severity: Minor
                      Found in modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js - About 1 hr to fix

                        Function getCategoryWidgetFromName has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        ve.ui.MWCategoryInputWidget.prototype.getCategoryWidgetFromName = function ( name ) {
                            const cachedData = ve.init.platform.linkCache.getCached( mw.Title.newFromText(
                                name,
                                mw.config.get( 'wgNamespaceIds' ).category
                            ).getPrefixedText() );
                        Severity: Minor
                        Found in modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js - About 1 hr to fix

                          Function setTemplateData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          ve.dm.MWTemplateSpecModel.prototype.setTemplateData = function ( data ) {
                              if ( !data || !ve.isPlainObject( data ) ) {
                                  return;
                              }
                          
                          
                          Severity: Minor
                          Found in modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js - About 1 hr to fix

                            Function generateContents has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            ve.ce.MWImageNode.prototype.generateContents = function () {
                                const model = this.getModel(),
                                    height = model.getAttribute( 'height' ),
                                    mwData = model.getAttribute( 'mw' ) || {},
                                    deferred = ve.createDeferred();
                            Severity: Minor
                            Found in modules/ve-mw/ce/nodes/ve.ce.MWImageNode.js - About 1 hr to fix

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

                              ve.init.mw.DesktopArticleTarget.prototype.setupToolbar = function ( surface ) {
                                  const mode = surface.getMode(),
                                      wasSetup = !!this.toolbar;
                              
                                  ve.track( 'trace.setupToolbar.enter', { mode: mode } );
                              Severity: Minor
                              Found in modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js - About 1 hr to fix

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

                                ve.ui.MWTableDialog.prototype.initialize = function () {
                                    // Parent method
                                    ve.ui.MWTableDialog.super.prototype.initialize.call( this );
                                
                                    this.wikitableToggle = new OO.ui.ToggleSwitchWidget();
                                Severity: Minor
                                Found in modules/ve-mw/ui/dialogs/ve.ui.MWTableDialog.js - About 1 hr to fix

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

                                      const processResult = ( data ) => {
                                          const pages = ( data.query && data.query.pages ) || data.pages,
                                              processed = {};
                                  
                                          const mappedTitles = [];
                                  Severity: Minor
                                  Found in modules/ve-mw/init/apiresponsecache/ve.init.mw.ApiResponseCache.js - About 1 hr to fix

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

                                    ve.init.mw.DesktopArticleTarget.prototype.maybeShowWelcomeDialog = function () {
                                        const editorMode = this.getDefaultMode(),
                                            windowManager = this.getSurface().dialogs;
                                    
                                        this.welcomeDialogPromise = ve.createDeferred();
                                    Severity: Minor
                                    Found in modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js - About 1 hr to fix

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

                                      ve.init.mw.MobileArticleTarget.prototype.setupToolbar = function ( surface ) {
                                          const originalToolbarGroups = this.toolbarGroups;
                                      
                                          // We don't want any of these tools to show up in subordinate widgets, so we
                                          // temporarily add them here. We need to do it _here_ rather than in their
                                      Severity: Minor
                                      Found in modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js - About 1 hr to fix

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

                                        ve.init.mw.ArticleTarget.prototype.submit = function ( wikitext, fields ) {
                                            // Prevent duplicate requests
                                            if ( this.submitting ) {
                                                return false;
                                            }
                                        Severity: Minor
                                        Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language