wikimedia/mediawiki-extensions-VisualEditor

View on GitHub
modules/ve-mw/ce/ve.ce.MWWikitextSurface.js

Summary

Maintainability
A
2 hrs
Test Coverage

Function onCopy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

ve.ce.MWWikitextSurface.prototype.onCopy = function ( e ) {
    const clipboardData = e.originalEvent.clipboardData,
        text = this.getModel().getFragment().getText( true ).replace( /\n\n/g, '\n' );

    if ( !text ) {
Severity: Minor
Found in modules/ve-mw/ce/ve.ce.MWWikitextSurface.js - About 1 hr to fix

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

    ve.ce.MWWikitextSurface.prototype.afterPasteInsertExternalData = function ( targetFragment, pastedDocumentModel, contextRange ) {
        const wasSpecial = this.pasteSpecial,
            // TODO: This check returns true if the paste contains meaningful structure (tables, lists etc.)
            // but no annotations (bold, links etc.).
            wasPlain = wasSpecial || pastedDocumentModel.data.isPlainText( contextRange, true, undefined, true );
    Severity: Minor
    Found in modules/ve-mw/ce/ve.ce.MWWikitextSurface.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status