wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

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

ve.dm.MWTemplateSpecModel.prototype.getParameterAliases = function ( name ) {
    const param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
    return param && param.aliases || [];
};
Severity: Major
Found in modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js and 1 other location - About 2 hrs to fix
modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js on lines 327..330

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

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

    if ( this.isActive && !this.trackedInternalLinkInputChange && !this.switchingLinkTypes ) {
        ve.track( 'activity.' + this.constructor.static.name, { action: 'search-pages-input' } );
        this.trackedInternalLinkInputChange = true;
    }
modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js on lines 327..330

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

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

ve.dm.MWMagicLinkNode = function VeDmMWMagicLinkNode() {
    // Parent constructor
    ve.dm.MWMagicLinkNode.super.apply( this, arguments );

    // Mixin constructors
Severity: Major
Found in modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js and 11 other locations - About 2 hrs to fix
modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

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

ve.ui.MWExtensionInspector = function VeUiMWExtensionInspector() {
    // Parent constructor
    ve.ui.MWExtensionInspector.super.apply( this, arguments );

    // Mixin constructors
Severity: Major
Found in modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js and 11 other locations - About 2 hrs to fix
modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25

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

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

ve.dm.MWNumberedExternalLinkNode = function VeDmMWNumberedExternalLinkNode() {
    // Parent constructor
    ve.dm.MWNumberedExternalLinkNode.super.apply( this, arguments );

    // Mixin constructors
Severity: Major
Found in modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js and 11 other locations - About 2 hrs to fix
modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

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

ve.dm.MWGalleryNode = function VeDmMWGalleryNode() {
    // Parent constructor
    ve.dm.MWGalleryNode.super.apply( this, arguments );

    // Mixin constructors
Severity: Major
Found in modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js and 11 other locations - About 2 hrs to fix
modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

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.MWTemplateSpecModel.prototype.getParameterSuggestedValues = function ( name ) {
    const param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
    return param && param.suggestedvalues || [];
};
Severity: Major
Found in modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js and 1 other location - About 2 hrs to fix
modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js on lines 381..384

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

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.enableRedirectField = new OO.ui.FieldLayout(
        this.enableRedirectInput,
        {
            $overlay: config.$overlay,
            classes: [ 've-test-page-settings-enable-redirect' ],
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js and 1 other location - About 2 hrs to fix
modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js on lines 89..98

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

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

ve.ce.MWImageCaptionNode = function VeCeMWImageCaptionNode() {
    // Parent constructor
    ve.ce.MWImageCaptionNode.super.apply( this, arguments );

    // Mixin constructor
Severity: Major
Found in modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js and 11 other locations - About 2 hrs to fix
modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

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

    formulaTeardown: function () {
        const done = arguments[ arguments.length - 1 ],
            surface = ve.init.target.surface;
        surface.dialogs.currentWindow.close().closed.then( done );
    },
Severity: Major
Found in build/screenshots-client/userGuide.js and 1 other location - About 2 hrs to fix
build/screenshots-client/userGuide.js on lines 130..134

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

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

    if ( this.isActive && !this.trackedExternalLinkInputChange && !this.switchingLinkTypes ) {
        ve.track( 'activity.' + this.constructor.static.name, { action: 'external-link-input' } );
        this.trackedExternalLinkInputChange = true;
    }
modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js on lines 274..277

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

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

ve.ce.MWAlienBlockExtensionNode = function VeCeMWAlienBlockExtensionNode() {
    // Parent constructor
    ve.ce.MWAlienBlockExtensionNode.super.apply( this, arguments );

    // Mixin constructors
Severity: Major
Found in modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js and 11 other locations - About 2 hrs to fix
modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

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.enableStaticRedirectField = new OO.ui.FieldLayout(
        this.enableStaticRedirectInput,
        {
            $overlay: config.$overlay,
            classes: [ 've-test-page-settings-prevent-redirect' ],
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js and 1 other location - About 2 hrs to fix
modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js on lines 67..76

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

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 onAttributeChange has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

ve.ce.MWBlockImageNode.prototype.onAttributeChange = function ( key, from, to ) {
    // Mixin method
    ve.ce.MWImageNode.prototype.onAttributeChange.apply( this, arguments );

    if ( key === 'height' || key === 'width' ) {
Severity: Major
Found in modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js - About 2 hrs to fix

    Function generateBody has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    ve.ui.MWInternalLinkContextItem.static.generateBody = function ( linkCache, model, htmlDoc, context ) {
        const lookupTitle = model.getAttribute( 'lookupTitle' ),
            normalizedTitle = model.getAttribute( 'normalizedTitle' ),
            href = model.getHref(),
            title = mw.Title.newFromText( mw.libs.ve.normalizeParsoidResourceName( href ) ),
    Severity: Minor
    Found in modules/ve-mw/ui/contextitems/ve.ui.MWInternalLinkContextItem.js - About 2 hrs to fix

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

      ve.ce.MWBlockImageNode.prototype.onSetup = function () {
          // Parent method
          ve.ce.MWBlockImageNode.super.prototype.onSetup.call( this );
      
          this.updateClasses();
      Severity: Major
      Found in modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js and 2 other locations - About 2 hrs to fix
      modules/ve-mw/ui/dialogs/ve.ui.MWExtensionPreviewDialog.js on lines 79..84
      modules/ve-mw/ui/inspectors/ve.ui.MWLiveExtensionInspector.js on lines 118..123

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

      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.MWTemplateSpecModel.prototype.isParameterRequired = function ( name ) {
          const param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
          return !!( param && param.required );
      };
      Severity: Major
      Found in modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js and 1 other location - About 2 hrs to fix
      modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js on lines 411..414

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

      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.MWTemplateSpecModel.prototype.isParameterSuggested = function ( name ) {
          const param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
          return !!( param && param.suggested );
      };
      Severity: Major
      Found in modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js and 1 other location - About 2 hrs to fix
      modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js on lines 402..405

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

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

      ve.dm.MWTemplateSpecModel.prototype.getParameterAutoValue = function ( name ) {
          const param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
          return param && param.autovalue || '';
      };
      Severity: Major
      Found in modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js and 2 other locations - About 2 hrs to fix
      modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js on lines 339..342
      modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js on lines 370..373

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

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

      ve.ui.MWExtensionPreviewDialog.prototype.onChange = function () {
          // Parent method
          ve.ui.MWExtensionPreviewDialog.super.prototype.onChange.call( this );
      
          this.updatePreviewDebounced();
      Severity: Major
      Found in modules/ve-mw/ui/dialogs/ve.ui.MWExtensionPreviewDialog.js and 2 other locations - About 2 hrs to fix
      modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js on lines 207..212
      modules/ve-mw/ui/inspectors/ve.ui.MWLiveExtensionInspector.js on lines 118..123

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

      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