wikimedia/mediawiki-extensions-VisualEditor

View on GitHub
modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js

Summary

Maintainability
F
6 days
Test Coverage

File ve.ui.MWLanguageVariantInspector.js has 525 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * VisualEditor UserInterface LanguageVariantInspector class.
 *
 * @copyright See AUTHORS.txt
 */
Severity: Major
Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js - About 1 day to fix

    Function createItem has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    ve.ui.MWLanguageVariantOneWayInspector.prototype.createItem = function ( from, lang, to ) {
        const fromTextTarget = this.createTextTarget( OO.ui.msg(
            'visualeditor-mwlanguagevariantinspector-oneway-from-text-placeholder'
        ) );
        const languageInput = new ve.ui.LanguageInputWidget( {
    Severity: Minor
    Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js - About 1 hr to fix

      Function createItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      ve.ui.MWLanguageVariantTwoWayInspector.prototype.createItem = function ( lang, content ) {
          const languageInput = new ve.ui.LanguageInputWidget( {
              dialogManager: this.manager.getSurface().getDialogs(),
              dirInput: 'none'
          } );
      Severity: Minor
      Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js - About 1 hr to fix

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

        ve.ui.MWLanguageVariantFilterInspector.prototype.initialize = function () {
            ve.ui.MWLanguageVariantFilterInspector.super.prototype.initialize.call( this );
            this.textTarget = this.createTextTarget( OO.ui.msg(
                'visualeditor-mwlanguagevariantinspector-filter-text-placeholder'
            ) );
        Severity: Minor
        Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js - About 1 hr to fix

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

          ve.ui.MWLanguageVariantTwoWayInspector.prototype.initialize = function () {
              ve.ui.MWLanguageVariantTwoWayInspector.super.prototype.initialize.call( this );
              this.items = [];
              this.layout = new OO.ui.FieldsetLayout( { } );
              this.form.$element.append( this.layout.$element );
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 706..720

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

          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.MWLanguageVariantOneWayInspector.prototype.initialize = function () {
              ve.ui.MWLanguageVariantOneWayInspector.super.prototype.initialize.call( this );
              this.items = [];
              this.layout = new OO.ui.FieldsetLayout( { } );
              this.form.$element.append( this.layout.$element );
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 559..573

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

          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.MWLanguageVariantOneWayInspector.prototype.onClearButtonClick = function ( item ) {
              const idx = this.items.indexOf( item );
              this.items.splice( idx, 1 );
              this.layout.removeItems( [ item.layout ] );
              item.clearButton.disconnect( this );
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 672..677

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

          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.MWLanguageVariantTwoWayInspector.prototype.onClearButtonClick = function ( item ) {
              const idx = this.items.indexOf( item );
              this.items.splice( idx, 1 );
              this.layout.removeItems( [ item.layout ] );
              item.clearButton.disconnect( this );
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 827..832

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

          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.MWLanguageVariantDisabledInspector.prototype.getReadyProcess = function ( data ) {
              return ve.ui.MWLanguageVariantDisabledInspector.super.prototype.getReadyProcess.call( this, data )
                  .next( () => {
                      this.textTarget.focus();
                  } );
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 514..519

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

          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.MWLanguageVariantFilterInspector.prototype.getReadyProcess = function ( data ) {
              return ve.ui.MWLanguageVariantFilterInspector.super.prototype.getReadyProcess.call( this, data )
                  .next( () => {
                      this.textTarget.focus();
                  } );
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 337..342

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

          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.form.$element.append(
                  new OO.ui.FieldLayout( this.langWidget, {
                      align: 'top',
                      label: OO.ui.msg( 'visualeditor-mwlanguagevariantinspector-filter-langs-label' )
                  } ).$element
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 474..479

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

          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.form.$element.append(
                  new OO.ui.FieldLayout( this.textTarget, {
                      align: 'top',
                      label: OO.ui.msg( 'visualeditor-mwlanguagevariantinspector-filter-text-label' )
                  } ).$element
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 468..473

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

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

          ve.ui.MWLanguageVariantInspector = function VeUiMWLanguageVariantInspector() {
              // Parent constructor
              ve.ui.MWLanguageVariantInspector.super.apply( this, arguments );
          };
          modules/ve-mw/ce/nodes/ve.ce.MWAlienAnnotationNode.js on lines 19..22
          modules/ve-mw/ce/nodes/ve.ce.MWBlockExtensionNode.js on lines 19..22
          modules/ve-mw/ce/nodes/ve.ce.MWInlineExtensionNode.js on lines 19..22
          modules/ve-mw/ce/nodes/ve.ce.MWLanguageVariantBlockNode.js on lines 18..21
          modules/ve-mw/ce/nodes/ve.ce.MWLanguageVariantHiddenNode.js on lines 18..21
          modules/ve-mw/ce/nodes/ve.ce.MWLanguageVariantInlineNode.js on lines 19..22
          modules/ve-mw/ce/nodes/ve.ce.MWPreNode.js on lines 18..21
          modules/ve-mw/ce/nodes/ve.ce.MWPreformattedNode.js on lines 17..20
          modules/ve-mw/dm/annotations/ve.dm.MWExternalLinkAnnotation.js on lines 25..28
          modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js on lines 20..23
          modules/ve-mw/dm/annotations/ve.dm.MWNowikiAnnotation.js on lines 19..22
          modules/ve-mw/dm/metaitems/ve.dm.MWAlienMetaItem.js on lines 17..20
          modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWDefaultSortMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWDisplayTitleMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWFlaggedMetaItem.js on lines 17..20
          modules/ve-mw/dm/metaitems/ve.dm.MWHiddenCategoryMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWIndexMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWLanguageMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWNewSectionEditMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWNoContentConvertMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWNoEditSectionMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWNoGalleryMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWNoTitleConvertMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWRedirectMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWStaticRedirectMetaItem.js on lines 16..19
          modules/ve-mw/dm/metaitems/ve.dm.MWTOCMetaItem.js on lines 16..19
          modules/ve-mw/dm/models/ve.dm.MWTemplatePlaceholderModel.js on lines 18..21
          modules/ve-mw/dm/nodes/ve.dm.MWAlienAnnotationNode.js on lines 19..22
          modules/ve-mw/dm/nodes/ve.dm.MWAnnotationNode.js on lines 16..19
          modules/ve-mw/dm/nodes/ve.dm.MWBlockExtensionNode.js on lines 19..22
          modules/ve-mw/dm/nodes/ve.dm.MWEntityNode.js on lines 17..20
          modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js on lines 18..21
          modules/ve-mw/dm/nodes/ve.dm.MWHeadingNode.js on lines 18..21
          modules/ve-mw/dm/nodes/ve.dm.MWIncludesNode.js on lines 16..19
          modules/ve-mw/dm/nodes/ve.dm.MWInlineExtensionNode.js on lines 18..21
          modules/ve-mw/dm/nodes/ve.dm.MWPreNode.js on lines 17..20
          modules/ve-mw/dm/nodes/ve.dm.MWPreformattedNode.js on lines 18..21
          modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js on lines 16..19
          modules/ve-mw/ui/actions/ve.ui.MWWikitextAction.js on lines 16..19
          modules/ve-mw/ui/contextitems/ve.ui.MWAlienAnnotationContextItem.js on lines 18..21
          modules/ve-mw/ui/datatransferhandlers/ve.ui.MWMediaTransferHandler.js on lines 17..20
          modules/ve-mw/ui/datatransferhandlers/ve.ui.MWWikitextPlainTextStringTransferHandler.js on lines 26..29
          modules/ve-mw/ui/inspectors/ve.ui.MWCommentInspector.js on lines 17..20
          modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js on lines 17..20
          modules/ve-mw/ui/inspectors/ve.ui.MWMagicLinkNodeInspector.js on lines 17..20
          modules/ve-mw/ui/widgets/ve.ui.MWExternalLinkAnnotationWidget.js on lines 17..20
          modules/ve-mw/ui/widgets/ve.ui.MWInternalLinkAnnotationWidget.js on lines 17..20
          modules/ve-mw/ui/widgets/ve.ui.MWParameterCheckboxInputWidget.js on lines 16..19

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

          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.MWLanguageVariantDisabledInspector = function VeUiMWLanguageVariantDisabledInspector() {
              ve.ui.MWLanguageVariantDisabledInspector.super.apply( this, arguments );
          };
          Severity: Minor
          Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js and 1 other location - About 50 mins to fix
          modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.js on lines 17..19

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

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

          ve.ui.MWLanguageVariantOneWayInspector = function VeUiMWLanguageVariantOneWayInspector() {
              ve.ui.MWLanguageVariantOneWayInspector.super.apply( this, arguments );
          };
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 362..364
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 427..429
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 541..543

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

          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.MWLanguageVariantInspector.static.modelClasses = [
              ve.dm.MWLanguageVariantBlockNode,
              ve.dm.MWLanguageVariantInlineNode,
              ve.dm.MWLanguageVariantHiddenNode
          ];
          Severity: Minor
          Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js and 1 other location - About 45 mins to fix
          modules/ve-mw/ui/contextitems/ve.ui.MWLanguageVariantNodeContextItem.js on lines 38..42

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

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

          ve.ui.MWLanguageVariantFilterInspector = function VeUiMWLanguageVariantFilterInspector() {
              ve.ui.MWLanguageVariantFilterInspector.super.apply( this, arguments );
          };
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 362..364
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 541..543
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 688..690

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

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

          ve.ui.MWLanguageVariantTwoWayInspector = function VeUiMWLanguageVariantTwoWayInspector() {
              ve.ui.MWLanguageVariantTwoWayInspector.super.apply( this, arguments );
          };
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 362..364
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 427..429
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 688..690

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

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

          ve.ui.MWLanguageVariantNameInspector = function VeUiMWLanguageVariantNameInspector() {
              ve.ui.MWLanguageVariantNameInspector.super.apply( this, arguments );
          };
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 427..429
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 541..543
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 688..690

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

          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

              const languageInput = new ve.ui.LanguageInputWidget( {
                  dialogManager: this.manager.getSurface().getDialogs(),
                  dirInput: 'none'
              } );
          Severity: Minor
          Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js and 1 other location - About 40 mins to fix
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 751..754

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

          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

              const languageInput = new ve.ui.LanguageInputWidget( {
                  dialogManager: this.manager.getSurface().getDialogs(),
                  dirInput: 'none'
              } );
          Severity: Minor
          Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js and 1 other location - About 40 mins to fix
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 600..603

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

          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

              const clearButton = new OO.ui.ButtonInputWidget( {
                  icon: 'clear',
                  title: OO.ui.deferMsg(
                      'visualeditor-mwlanguagevariantinspector-oneway-clear-button'
                  ),
          Severity: Minor
          Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js and 1 other location - About 35 mins to fix
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 607..613

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

          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

              const clearButton = new OO.ui.ButtonInputWidget( {
                  icon: 'clear',
                  title: OO.ui.deferMsg(
                      'visualeditor-mwlanguagevariantinspector-twoway-clear-button'
                  ),
          Severity: Minor
          Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js and 1 other location - About 35 mins to fix
          modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 758..764

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

          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.MWLanguageVariantInspector.static.excludeCommands = [
              // No formatting
              'paragraph',
              'heading1',
              'heading2',
          Severity: Minor
          Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js and 1 other location - About 35 mins to fix
          modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js on lines 109..130

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

          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

          There are no issues that match your filters.

          Category
          Status