wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

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

ve.ui.MWMediaDialog.prototype.switchPanels = function ( panel, noFocus ) {
    switch ( panel ) {
        case 'edit':
            this.setSize( this.constructor.static.size );
            // Set the edit panel
Severity: Minor
Found in modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js - About 1 hr to fix

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

    ve.ui.MWGalleryDialog.prototype.getTeardownProcess = function ( data ) {
        return ve.ui.MWGalleryDialog.super.prototype.getTeardownProcess.call( this, data )
            .first( () => {
                // Layouts
                this.indexLayout.setTabPanel( 'images' );
    Severity: Minor
    Found in modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js - About 1 hr to fix

      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

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            ve.dm.MWTransclusionNode.prototype.getWikitext = function () {
                                return this.constructor.static.getWikitext( this.getAttribute( 'mw' ) );
                            };
                            Severity: Major
                            Found in modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js and 1 other location - About 1 hr to fix
                            modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js on lines 207..209

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 59.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            ve.ui.MWFeedbackDialogTool = function VeUiMWFeedbackDialogTool() {
                                ve.ui.MWFeedbackDialogTool.super.apply( this, arguments );
                            
                                this.setDisabled( false );
                            };
                            Severity: Major
                            Found in modules/ve-mw/ui/toolgroups/ve.ui.MWHelpListToolGroup.js and 1 other location - About 1 hr to fix
                            modules/ve-mw/ui/toolgroups/ve.ui.MWHelpListToolGroup.js on lines 108..112

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 59.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            ve.ui.MWUserGuideTool = function VeUiMWUserGuideTool() {
                                ve.ui.MWUserGuideTool.super.apply( this, arguments );
                            
                                this.setDisabled( false );
                            };
                            Severity: Major
                            Found in modules/ve-mw/ui/toolgroups/ve.ui.MWHelpListToolGroup.js and 1 other location - About 1 hr to fix
                            modules/ve-mw/ui/toolgroups/ve.ui.MWHelpListToolGroup.js on lines 148..152

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 59.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                function onImportChange() {
                                    importInput.getValidity().then( () => {
                                        importButton.setDisabled( false );
                                    }, () => {
                                        importButton.setDisabled( true );
                            Severity: Major
                            Found in modules/ve-mw-collab/ve.init.mw.CollabTarget.init.js and 1 other location - About 1 hr to fix
                            modules/ve-mw-collab/ve.init.mw.CollabTarget.init.js on lines 248..254

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 59.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            ve.ui.MWTransclusionDialog.prototype.addWikitext = function () {
                                this.addPart( new ve.dm.MWTransclusionContentModel( this.transclusionModel ) );
                            };
                            Severity: Major
                            Found in modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js and 1 other location - About 1 hr to fix
                            modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js on lines 125..127

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 59.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                function onNameChange() {
                                    documentNameInput.getValidity().then( () => {
                                        documentNameButton.setDisabled( false );
                                    }, () => {
                                        documentNameButton.setDisabled( true );
                            Severity: Major
                            Found in modules/ve-mw-collab/ve.init.mw.CollabTarget.init.js and 1 other location - About 1 hr to fix
                            modules/ve-mw-collab/ve.init.mw.CollabTarget.init.js on lines 279..285

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 59.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            ve.dm.MWInternalLinkAnnotation.prototype.getFragment = function () {
                                return this.constructor.static.getFragment( this.getAttribute( 'normalizedTitle' ) );
                            };
                            modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js on lines 493..495

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 59.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language