wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Function exports has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = ( function () {

    /**
     * @classdesc Interact with the API of another MediaWiki site. mw.Foreign API creates
     * an object like {@link mw.Api}, but automatically handle everything required to communicate
Severity: Minor
Found in resources/src/mediawiki.ForeignApi/mediawiki.ForeignApi.core.js - About 1 hr to fix

    Function _sfc_render$v has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_cdx_icon = resolveComponent("cdx-icon");
      const _component_cdx_button = resolveComponent("cdx-button");
      return openBlock(), createElementBlock(
        "details",
    Severity: Minor
    Found in resources/lib/codex/codex.js - About 1 hr to fix

      Function _createForOfIteratorHelper has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function _createForOfIteratorHelper(o, allowArrayLike) {
          var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
          if (!it) {
            if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
              if (it) o = it;
      Severity: Minor
      Found in resources/lib/qunitjs/qunit.js - About 1 hr to fix

        Function deepEqual has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                sinon.deepEqual = function deepEqual(a, b) {
                    if (sinon.match && sinon.match.isMatcher(a)) {
                        return a.test(b);
                    }
        
        
        Severity: Minor
        Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

          Function diffCleanupEfficiency has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              DiffMatchPatch.prototype.diffCleanupEfficiency = function (diffs) {
                var changes, equalities, equalitiesLength, lastequality, pointer, preIns, preDel, postIns, postDel;
                changes = false;
                equalities = []; // Stack of indices where equalities are found.
                equalitiesLength = 0; // Keeping our own length var is faster in JS.
          Severity: Minor
          Found in resources/lib/qunitjs/qunit.js - About 1 hr to fix

            Function OoUiDropdownWidget has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            OO.ui.DropdownWidget = function OoUiDropdownWidget( config ) {
                // Configuration initialization
                config = Object.assign( { indicator: 'down' }, config );
            
                // Parent constructor
            Severity: Minor
            Found in resources/lib/ooui/oojs-ui-core.js - About 1 hr to fix

              Function OoUiIndexLayout has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              OO.ui.IndexLayout = function OoUiIndexLayout( config ) {
                  // Configuration initialization
                  config = Object.assign( {}, config, { menuPosition: 'top' } );
              
                  // Parent constructor
              Severity: Minor
              Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

                Function blind has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                $.effects.effect.blind = function( o, done ) {
                    // Create element
                    var el = $( this ),
                        props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
                        mode = $.effects.setMode( el, o.mode || "hide" ),
                Severity: Minor
                Found in resources/lib/jquery.ui/jquery.ui.effect-blind.js - About 1 hr to fix

                  Function _contactContainers has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _contactContainers: function(event) {
                  
                          // get innermost container that intersects with item
                          var innermostContainer = null, innermostIndex = null;
                  
                  
                  Severity: Minor
                  Found in resources/lib/jquery.ui/jquery.ui.sortable.js - About 1 hr to fix

                    Method show has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function show( $err = null ) {
                            $out = $this->mOut;
                            $out->setRobotPolicy( 'noindex,nofollow' );
                            $out->addBacklinkSubtitle( $this->mTitle );
                    
                    
                    Severity: Minor
                    Found in includes/page/ProtectionForm.php - About 1 hr to fix

                      Method showDiff has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function showDiff() {
                              $oldtitlemsg = 'currentrev';
                              # if message does not exist, show diff against the preloaded default
                              if ( $this->mTitle->getNamespace() === NS_MEDIAWIKI && !$this->mTitle->exists() ) {
                                  $oldtext = $this->mTitle->getDefaultMessageText();
                      Severity: Minor
                      Found in includes/editpage/EditPage.php - About 1 hr to fix

                        Method notifyOnPageChange has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function notifyOnPageChange(
                                Authority $editor,
                                $title,
                                $timestamp,
                                $summary,
                        Severity: Minor
                        Found in includes/mail/EmailNotification.php - About 1 hr to fix

                          Method ensureRevisionRowMatchesPage has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function ensureRevisionRowMatchesPage( $row, PageIdentity $page, $context = [] ) {
                                  $revId = (int)( $row->rev_id ?? 0 );
                                  $revPageId = (int)( $row->rev_page ?? 0 ); // XXX: also check $row->page_id?
                                  $expectedPageId = $page->getId( $this->wikiId );
                                  // Avoid fatal error when the Title's ID changed, T246720
                          Severity: Minor
                          Found in includes/Revision/RevisionStore.php - About 1 hr to fix

                            Method doCopyInternal has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function doCopyInternal( array $params ) {
                                    $status = $this->newStatus();
                            
                                    $fsSrcPath = $this->resolveToFSPath( $params['src'] );
                                    if ( $fsSrcPath === null ) {
                            Severity: Minor
                            Found in includes/libs/filebackend/FSFileBackend.php - About 1 hr to fix

                              Method placeBlock has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function placeBlock( bool $reblock = false ): Status {
                                      $priorBlock = $this->blockStore
                                          ->newFromTarget( $this->target, null, /*fromPrimary=*/true );
                                      $priorHideUser = $priorBlock instanceof DatabaseBlock && $priorBlock->getHideName();
                                      if (
                              Severity: Minor
                              Found in includes/block/BlockUser.php - About 1 hr to fix

                                Method getInputHTMLForKey has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function getInputHTMLForKey( $key, array $values ) {
                                        $displayFormat = $this->mParams['format'] ?? $this->mParent->getDisplayFormat();
                                
                                        // Conveniently, PHP method names are case-insensitive.
                                        $getFieldHtmlMethod = $displayFormat == 'table' ? 'getTableRow' : ( 'get' . $displayFormat );
                                Severity: Minor
                                Found in includes/htmlform/fields/HTMLFormFieldCloner.php - About 1 hr to fix

                                  Method datetimePreferences has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function datetimePreferences(
                                          User $user, IContextSource $context, &$defaultPreferences
                                      ) {
                                          $dateOptions = $this->getDateOptions( $context );
                                          if ( $dateOptions ) {
                                  Severity: Minor
                                  Found in includes/preferences/DefaultPreferencesFactory.php - About 1 hr to fix

                                    Method refreshAndReplaceInternal has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function refreshAndReplaceInternal( string $code, array $replacements ) {
                                            // Allow one caller at a time to avoid race conditions
                                            [ $scopedLock ] = $this->getReentrantScopedLock( $code );
                                            if ( !$scopedLock ) {
                                                foreach ( $replacements as [ $title ] ) {
                                    Severity: Minor
                                    Found in includes/language/MessageCache.php - About 1 hr to fix

                                      Method getLanguageNamesUncached has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private function getLanguageNamesUncached( $inLanguage, $include ) {
                                              // If passed an invalid language code to use, fallback to en
                                              if ( $inLanguage !== self::AUTONYMS && !$this->isValidCode( $inLanguage ) ) {
                                                  $inLanguage = 'en';
                                              }
                                      Severity: Minor
                                      Found in includes/language/LanguageNameUtils.php - About 1 hr to fix

                                        Method execute has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            protected function execute() {
                                                global $wgTitle;
                                        
                                                $context = $this->getContext();
                                                $request = $this->getRequest();
                                        Severity: Minor
                                        Found in includes/api/ApiEntryPoint.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language