wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 436 of 912 total issues

Function setup has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

ve.ui.MWAdvancedSettingsPage.prototype.setup = function ( fragment, config ) {
    this.fragment = fragment;

    // Indexing items
    const indexingField = this.indexing.getField();
Severity: Minor
Found in modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js - About 1 hr to fix

    Function getImportRules has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    ve.ui.MWGalleryDialog.static.getImportRules = function () {
        const rules = ve.copy( ve.init.target.constructor.static.importRules );
        return ve.extendObject(
            rules,
            {
    Severity: Minor
    Found in modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js - About 1 hr to fix

      Function getImageLinearData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function getImageLinearData( galleryItem ) {
              const size = scaleImage(
                  parseInt( galleryItem.height ),
                  parseInt( galleryItem.width ),
                  parseInt( mwData.attrs.heights || this.defaults.imageHeight ),
      Severity: Minor
      Found in modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js - About 1 hr to fix

        Function afterPasteInsertExternalData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        ve.ce.MWWikitextSurface.prototype.afterPasteInsertExternalData = function ( targetFragment, pastedDocumentModel, contextRange ) {
            const wasSpecial = this.pasteSpecial,
                // TODO: This check returns true if the paste contains meaningful structure (tables, lists etc.)
                // but no annotations (bold, links etc.).
                wasPlain = wasSpecial || pastedDocumentModel.data.isPlainText( contextRange, true, undefined, true );
        Severity: Minor
        Found in modules/ve-mw/ce/ve.ce.MWWikitextSurface.js - About 1 hr to fix

          Function getImportRules has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          ve.ui.MWMediaDialog.static.getImportRules = function () {
              const rules = ve.copy( ve.init.target.constructor.static.importRules );
              return ve.extendObject(
                  rules,
                  {
          Severity: Minor
          Found in modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js - About 1 hr to fix

            Function loadFail has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            ve.init.mw.DesktopArticleTarget.prototype.loadFail = function ( code, errorDetails ) {
                // Parent method
                ve.init.mw.DesktopArticleTarget.super.prototype.loadFail.apply( this, arguments );
            
                if ( this.wikitextFallbackLoading ) {
            Severity: Minor
            Found in modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js - About 1 hr to fix

              Function tryWithPreparedCacheKey has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              ve.init.mw.ArticleTarget.prototype.tryWithPreparedCacheKey = function ( doc, extraData, eventName ) {
                  if ( this.getSurface().getMode() === 'source' ) {
                      const data = ve.copy( extraData );
              
                      // TODO: This should happen in #getSaveOptions, check if moving it there breaks anything
              Severity: Minor
              Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js - About 1 hr to fix

                Function onSelect has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                ve.ui.MWFeedbackDialogTool.prototype.onSelect = function () {
                    this.setActive( false );
                
                    if ( !this.feedbackPromise ) {
                        this.feedbackPromise = mw.loader.using( 'mediawiki.feedback' ).then( () => {
                Severity: Minor
                Found in modules/ve-mw/ui/toolgroups/ve.ui.MWHelpListToolGroup.js - About 1 hr to fix

                  Function getTeardownProcess has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  ve.ui.MWLinkAnnotationInspector.prototype.getTeardownProcess = function ( data ) {
                      let fragment;
                      return ve.ui.MWLinkAnnotationInspector.super.prototype.getTeardownProcess.call( this, data )
                          .first( () => {
                              // Save the original fragment for later.
                  Severity: Minor
                  Found in modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js - About 1 hr to fix

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

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

                      Function VeUiMWTemplatesUsedPage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      ve.ui.MWTemplatesUsedPage = function VeUiMWTemplatesUsedPage() {
                          const target = ve.init.target;
                      
                          // Parent constructor
                          ve.ui.MWTemplatesUsedPage.super.apply( this, arguments );
                      Severity: Minor
                      Found in modules/ve-mw/ui/pages/ve.ui.MWTemplatesUsedPage.js - About 1 hr to fix

                        Function parseWikitextFragment has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        ve.init.mw.Target.prototype.parseWikitextFragment = function ( wikitext, pst, doc ) {
                            let abortable, aborted;
                            const abortedPromise = ve.createDeferred().reject( 'http',
                                { textStatus: 'abort', exception: 'abort' } ).promise();
                        
                        
                        Severity: Minor
                        Found in modules/ve-mw/init/targets/ve.init.mw.Target.js - About 1 hr to fix

                          Function runTests has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function runTests( lang ) {
                          
                              const runLang = runScreenshotTest.bind( this, lang );
                          
                              test.describe( 'Screenshots: ' + lang, function () {
                          Severity: Minor
                          Found in build/screenshots.userGuide.js - About 1 hr to fix

                            Function setup has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            ve.ui.MWSettingsPage.prototype.setup = function ( fragment, config ) {
                                this.fragment = fragment;
                            
                                // Table of Contents items
                                const tableOfContentsField = this.tableOfContents.getField();
                            Severity: Minor
                            Found in modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js - About 1 hr to fix

                              Function getSummaries has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              ve.ui.MWEditSummaryWidget.prototype.getSummaries = function () {
                                  const splitSummary = this.constructor.static.splitSummary.bind( this.constructor.static );
                                  if ( !this.getSummariesPromise ) {
                                      if ( mw.user.isAnon() ) {
                                          this.getSummariesPromise = ve.createDeferred().resolve( [] ).promise();
                              Severity: Minor
                              Found in modules/ve-mw/ui/widgets/ve.ui.MWEditSummaryWidget.js - About 1 hr to fix

                                Function VeUiMWTransclusionOutlineTemplateWidget has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                ve.ui.MWTransclusionOutlineTemplateWidget = function VeUiMWTransclusionOutlineTemplateWidget( template, replacesPlaceholder ) {
                                    const spec = template.getSpec();
                                
                                    // Parent constructor
                                    ve.ui.MWTransclusionOutlineTemplateWidget.super.call( this, template, {

                                  Function getLookupCacheDataFromResponse has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  ve.ui.MWCategoryInputWidget.prototype.getLookupCacheDataFromResponse = function ( data ) {
                                      const result = [],
                                          linkCacheUpdate = {},
                                          query = data.query || {};
                                  
                                  
                                  Severity: Minor
                                  Found in modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js - About 1 hr to fix

                                    Function addPartWidget has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    ve.ui.MWTransclusionOutlineWidget.prototype.addPartWidget = function ( part, newPosition, removed ) {
                                        const keys = Object.keys( this.partWidgets ),
                                            onlyPart = keys.length === 1 && this.partWidgets[ keys[ 0 ] ];
                                        if ( onlyPart instanceof ve.ui.MWTransclusionOutlineTemplateWidget ) {
                                            // To recalculate the height of the sticky header when we enter multi-part mode
                                    Severity: Minor
                                    Found in modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineWidget.js - About 1 hr to fix

                                      Function wrapText has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      ve.dm.MWWikitextSurfaceFragment.prototype.wrapText = function ( before, after, placeholder, forceWrap ) {
                                          placeholder = OO.ui.resolveMsg( placeholder );
                                      
                                          function unwrap( fragment ) {
                                              const text = fragment.getText();
                                      Severity: Minor
                                      Found in modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js - About 1 hr to fix

                                        Function setupEditor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        ve.ui.MWAceEditorWidget.prototype.setupEditor = function () {
                                            let basePath = mw.config.get( 'wgExtensionAssetsPath', '' );
                                        
                                            if ( basePath.slice( 0, 2 ) === '//' ) {
                                                // ACE uses web workers, which have importScripts, which don't like relative links.
                                        Severity: Minor
                                        Found in modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language