wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

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

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

          toolbarTemplate: function () {
              seleniumUtils.runMenuTask( arguments[ arguments.length - 1 ], ve.init.target.toolbar.tools.transclusion, false, true );
          },
      Severity: Major
      Found in build/screenshots-client/userGuide.js and 6 other locations - About 1 hr to fix
      build/screenshots-client/userGuide.js on lines 82..84
      build/screenshots-client/userGuide.js on lines 88..90
      build/screenshots-client/userGuide.js on lines 91..93
      build/screenshots-client/userGuide.js on lines 94..96
      build/screenshots-client/userGuide.js on lines 102..104
      build/screenshots-client/userGuide.js on lines 105..107

      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 56.

      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 7 locations. Consider refactoring.
      Open

          toolbarCategory: function () {
              seleniumUtils.runMenuTask( arguments[ arguments.length - 1 ], ve.init.target.toolbar.tools.categories, false, true );
          },
      Severity: Major
      Found in build/screenshots-client/userGuide.js and 6 other locations - About 1 hr to fix
      build/screenshots-client/userGuide.js on lines 82..84
      build/screenshots-client/userGuide.js on lines 85..87
      build/screenshots-client/userGuide.js on lines 88..90
      build/screenshots-client/userGuide.js on lines 91..93
      build/screenshots-client/userGuide.js on lines 94..96
      build/screenshots-client/userGuide.js on lines 102..104

      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 56.

      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 7 locations. Consider refactoring.
      Open

          toolbarFormula: function () {
              seleniumUtils.runMenuTask( arguments[ arguments.length - 1 ], ve.init.target.toolbar.tools.math, true, true );
          },
      Severity: Major
      Found in build/screenshots-client/userGuide.js and 6 other locations - About 1 hr to fix
      build/screenshots-client/userGuide.js on lines 82..84
      build/screenshots-client/userGuide.js on lines 85..87
      build/screenshots-client/userGuide.js on lines 88..90
      build/screenshots-client/userGuide.js on lines 94..96
      build/screenshots-client/userGuide.js on lines 102..104
      build/screenshots-client/userGuide.js on lines 105..107

      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 56.

      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 7 locations. Consider refactoring.
      Open

          toolbarMedia: function () {
              seleniumUtils.runMenuTask( arguments[ arguments.length - 1 ], ve.init.target.toolbar.tools.media, false, true );
          },
      Severity: Major
      Found in build/screenshots-client/userGuide.js and 6 other locations - About 1 hr to fix
      build/screenshots-client/userGuide.js on lines 85..87
      build/screenshots-client/userGuide.js on lines 88..90
      build/screenshots-client/userGuide.js on lines 91..93
      build/screenshots-client/userGuide.js on lines 94..96
      build/screenshots-client/userGuide.js on lines 102..104
      build/screenshots-client/userGuide.js on lines 105..107

      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 56.

      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

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

                  ve.ui.DiffElement.static.compareAttributes( attributeChanges.mw.from.attrs || {}, attributeChanges.mw.to.attrs || {} ),
      Severity: Major
      Found in modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js and 1 other location - About 1 hr to fix
      modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 86..86

      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 56.

      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 7 locations. Consider refactoring.
      Open

          toolbarTable: function () {
              seleniumUtils.runMenuTask( arguments[ arguments.length - 1 ], ve.init.target.toolbar.tools.insertTable, false, true );
          },
      Severity: Major
      Found in build/screenshots-client/userGuide.js and 6 other locations - About 1 hr to fix
      build/screenshots-client/userGuide.js on lines 82..84
      build/screenshots-client/userGuide.js on lines 85..87
      build/screenshots-client/userGuide.js on lines 91..93
      build/screenshots-client/userGuide.js on lines 94..96
      build/screenshots-client/userGuide.js on lines 102..104
      build/screenshots-client/userGuide.js on lines 105..107

      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 56.

      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

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

                  ve.ui.DiffElement.static.compareAttributes( attributeChanges.mw.from.attrs || {}, attributeChanges.mw.to.attrs || {} ),
      Severity: Major
      Found in modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js and 1 other location - About 1 hr to fix
      modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js on lines 178..178

      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 56.

      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 7 locations. Consider refactoring.
      Open

          toolbarPageSettings: function () {
              seleniumUtils.runMenuTask( arguments[ arguments.length - 1 ], ve.init.target.toolbar.tools.settings, false, true );
          },
      Severity: Major
      Found in build/screenshots-client/userGuide.js and 6 other locations - About 1 hr to fix
      build/screenshots-client/userGuide.js on lines 82..84
      build/screenshots-client/userGuide.js on lines 85..87
      build/screenshots-client/userGuide.js on lines 88..90
      build/screenshots-client/userGuide.js on lines 91..93
      build/screenshots-client/userGuide.js on lines 94..96
      build/screenshots-client/userGuide.js on lines 105..107

      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 56.

      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 7 locations. Consider refactoring.
      Open

          toolbarReferences: function () {
              seleniumUtils.runMenuTask( arguments[ arguments.length - 1 ], ve.init.target.toolbar.tools.referencesList, true, true );
          },
      Severity: Major
      Found in build/screenshots-client/userGuide.js and 6 other locations - About 1 hr to fix
      build/screenshots-client/userGuide.js on lines 82..84
      build/screenshots-client/userGuide.js on lines 85..87
      build/screenshots-client/userGuide.js on lines 88..90
      build/screenshots-client/userGuide.js on lines 91..93
      build/screenshots-client/userGuide.js on lines 102..104
      build/screenshots-client/userGuide.js on lines 105..107

      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 56.

      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.init.mw.ArticleTarget.prototype.saveErrorUnknown = function ( data ) {
          this.showSaveError( this.extractErrorMessages( data ) );
      };
      Severity: Major
      Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js and 1 other location - About 1 hr to fix
      modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js on lines 870..872

      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 56.

      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.init.mw.ArticleTarget.prototype.saveErrorHookAborted = function ( data ) {
          this.showSaveError( this.extractErrorMessages( data ) );
      };
      Severity: Major
      Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js and 1 other location - About 1 hr to fix
      modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js on lines 898..900

      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 56.

      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

          this.upButton = new OO.ui.ButtonWidget( {
              framed: false,
              icon: 'upTriangle',
              title: OO.ui.msg( 'ooui-outline-control-move-up' ),
              disabled: true
      modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineControlsWidget.js on lines 39..44

      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 56.

      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

          this.downButton = new OO.ui.ButtonWidget( {
              framed: false,
              icon: 'downTriangle',
              title: OO.ui.msg( 'ooui-outline-control-move-down' ),
              disabled: true
      modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineControlsWidget.js on lines 33..38

      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 56.

      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

      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
                Severity
                Category
                Status
                Source
                Language