wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

Function unwrapParsoidSections has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

mw.libs.ve.unwrapParsoidSections = function ( element, keepSection ) {
    Array.prototype.forEach.call( element.querySelectorAll( 'section[data-mw-section-id]' ), ( section ) => {
        const parent = section.parentNode,
            sectionId = section.getAttribute( 'data-mw-section-id' );
        // Copy section ID to first child (should be a heading)
Severity: Minor
Found in modules/ve-mw/preinit/ve.utils.parsoid.js - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function reduplicateStyles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

mw.libs.ve.reduplicateStyles = function ( element ) {
    Array.prototype.forEach.call( element.querySelectorAll( 'link[rel~="mw-deduplicated-inline-style"]' ), ( link ) => {
        const href = link.getAttribute( 'href' );
        if ( !href || href.slice( 0, 'mw-data:'.length ) !== 'mw-data:' ) {
            return;
Severity: Minor
Found in modules/ve-mw/preinit/ve.utils.parsoid.js - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

ve.ui.commandHelpRegistry.register( 'insert', 'template', {
    sequences: [ 'wikitextTemplate' ],
    label: OO.ui.deferMsg( 'visualeditor-dialog-template-title' )
} );
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.js and 3 other locations - About 35 mins to fix
modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js on lines 56..59
modules/ve-mw/ui/ve.ui.MWSequenceRegistry.js on lines 52..55
modules/ve-mw/ui/ve.ui.MWSequenceRegistry.js on lines 56..59

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

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

    ve.ui.commandHelpRegistry.register( 'insert', 'mwSignature', {
        sequences: [ 'wikitextSignature' ],
        label: OO.ui.deferMsg( 'visualeditor-mwsignature-tool' )
    } );
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js and 3 other locations - About 35 mins to fix
modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.js on lines 87..90
modules/ve-mw/ui/ve.ui.MWSequenceRegistry.js on lines 52..55
modules/ve-mw/ui/ve.ui.MWSequenceRegistry.js on lines 56..59

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

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

ve.ui.MWCategoryWidget.prototype.onPopupClosing = function () {
    this.expandedItem.focus();
};
Severity: Major
Found in modules/ve-mw/ui/widgets/ve.ui.MWCategoryWidget.js and 3 other locations - About 35 mins to fix
modules/ve-mw/ui/inspectors/ve.ui.MWLiveExtensionInspector.js on lines 156..158
modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js on lines 262..264
modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js on lines 317..319

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

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

ve.ui.MWLiveExtensionInspector.prototype.hideGeneratedContentsError = function () {
    this.generatedContentsError.clear();
};
Severity: Major
Found in modules/ve-mw/ui/inspectors/ve.ui.MWLiveExtensionInspector.js and 3 other locations - About 35 mins to fix
modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js on lines 262..264
modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js on lines 317..319
modules/ve-mw/ui/widgets/ve.ui.MWCategoryWidget.js on lines 140..142

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

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

ve.ui.MWParameterPage.prototype.focus = function () {
    this.valueInput.focus();
};
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js and 3 other locations - About 35 mins to fix
modules/ve-mw/ui/inspectors/ve.ui.MWLiveExtensionInspector.js on lines 156..158
modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js on lines 262..264
modules/ve-mw/ui/widgets/ve.ui.MWCategoryWidget.js on lines 140..142

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

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

        this.loadFail( 've-api', { errors: [ {
            code: 've-api',
            html: mw.message( 'api-clientside-error-invalidresponse' ).parse()
        } ] } );
Severity: Minor
Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js and 1 other location - About 35 mins to fix
modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js on lines 304..307

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

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

ve.ui.MWCategoriesPage.prototype.focus = function () {
    this.categoryWidget.focus();
};
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js and 3 other locations - About 35 mins to fix
modules/ve-mw/ui/inspectors/ve.ui.MWLiveExtensionInspector.js on lines 156..158
modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js on lines 317..319
modules/ve-mw/ui/widgets/ve.ui.MWCategoryWidget.js on lines 140..142

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

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

ve.ce.MWInternalLinkAnnotation.static.getDescription = function ( model ) {
    return model.getAttribute( 'title' );
};
Severity: Minor
Found in modules/ve-mw/ce/annotations/ve.ce.MWInternalLinkAnnotation.js and 2 other locations - About 35 mins to fix
modules/ve-mw/ce/nodes/ve.ce.MWMagicLinkNode.js on lines 57..59
modules/ve-mw/ce/nodes/ve.ce.MWNumberedExternalLinkNode.js on lines 75..77

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

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

ve.dm.MWImageModel.prototype.getDefaultDimensions = function () {
    return this.scalable.getDefaultDimensions();
};
Severity: Minor
Found in modules/ve-mw/dm/models/ve.dm.MWImageModel.js and 2 other locations - About 35 mins to fix
modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js on lines 192..194
modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlinePartWidget.js on lines 112..114

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

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

ve.ui.commandHelpRegistry.register( 'insert', 'table', {
    sequences: [ 'wikitextTable' ],
    label: OO.ui.deferMsg( 'visualeditor-table-insert-table' )
} );
Severity: Major
Found in modules/ve-mw/ui/ve.ui.MWSequenceRegistry.js and 3 other locations - About 35 mins to fix
modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js on lines 56..59
modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.js on lines 87..90
modules/ve-mw/ui/ve.ui.MWSequenceRegistry.js on lines 56..59

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

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

ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.getPagesOrdered = function () {
    return this.stackLayout.getItems();
};
modules/ve-mw/dm/models/ve.dm.MWImageModel.js on lines 1046..1048
modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlinePartWidget.js on lines 112..114

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

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

ve.dm.MWMagicLinkPmidType.prototype.getHref = function () {
    return mw.msg( 'pubmedurl', this.code );
};
Severity: Minor
Found in modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js and 1 other location - About 35 mins to fix
modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 411..413

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

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

    const scriptBase = new URL( mw.config.get( 'wgScript' ), doc.baseURI ).toString().replace( /^https?:/i, '' );
Severity: Minor
Found in modules/ve-mw/preinit/ve.utils.parsoid.js and 1 other location - About 35 mins to fix
modules/ve-mw/preinit/ve.utils.parsoid.js on lines 317..317

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

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

    this.$editSummaryLabel = $( '<div>' ).addClass( 've-ui-mwSaveDialog-summaryLabel' )
        .html( ve.init.platform.getParsedMessage( 'summary' ) );
Severity: Minor
Found in modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js and 1 other location - About 35 mins to fix
modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js on lines 662..663

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

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

ve.ui.commandHelpRegistry.register( 'insert', 'comment', {
    sequences: [ 'wikitextComment' ],
    label: OO.ui.deferMsg( 'visualeditor-commentinspector-title' )
} );
Severity: Major
Found in modules/ve-mw/ui/ve.ui.MWSequenceRegistry.js and 3 other locations - About 35 mins to fix
modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js on lines 56..59
modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.js on lines 87..90
modules/ve-mw/ui/ve.ui.MWSequenceRegistry.js on lines 52..55

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

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

    const articleBase = new URL( mw.config.get( 'wgArticlePath' ), doc.baseURI ).toString().replace( /^https?:/i, '' );
Severity: Minor
Found in modules/ve-mw/preinit/ve.utils.parsoid.js and 1 other location - About 35 mins to fix
modules/ve-mw/preinit/ve.utils.parsoid.js on lines 309..309

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

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

    this.$conflict = $( '<div>' ).addClass( 've-ui-mwSaveDialog-conflict' )
        .html( ve.init.platform.getParsedMessage( 'visualeditor-editconflict' ) );
Severity: Minor
Found in modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js and 1 other location - About 35 mins to fix
modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js on lines 534..535

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

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

        this.loadFail( 've-api', { errors: [ {
            code: 've-api',
            html: mw.message( 'api-clientside-error-invalidresponse' ).parse()
        } ] } );
Severity: Minor
Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js and 1 other location - About 35 mins to fix
modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js on lines 363..366

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

Severity
Category
Status
Source
Language