wikimedia/mediawiki-core

View on GitHub
resources/src/jquery/jquery.textSelection.js

Summary

Maintainability
D
1 day
Test Coverage

Function textSelection has 247 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.textSelection = function ( command, commandOptions ) {
        // Checks if you can try to use insertText (it might still fail).
        function supportsInsertText() {
            return $( this ).data( 'jquery.textSelection' ) === undefined &&
                typeof document.execCommand === 'function' &&
Severity: Major
Found in resources/src/jquery/jquery.textSelection.js - About 1 day to fix

    Function encapsulateSelection has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                encapsulateSelection: function ( options ) {
                    return this.each( function () {
                        var selText, isSample,
                            pre = options.pre,
                            post = options.post;
    Severity: Major
    Found in resources/src/jquery/jquery.textSelection.js - About 3 hrs to fix

      File jquery.textSelection.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*!
       * These plugins provide extra functionality for interaction with textareas.
       *
       * - encapsulateSelection: Ported from skins/common/edit.js by Trevor Parscal
       *   © 2009 Wikimedia Foundation (GPLv2) - https://www.wikimedia.org
      Severity: Minor
      Found in resources/src/jquery/jquery.textSelection.js - About 2 hrs to fix

        There are no issues that match your filters.

        Category
        Status