wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method convertGrammar has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function convertGrammar( $word, $case ) {
        $lord = strtolower( $word );
        $gender = 'm'; // Nuutnaarel // default
        if ( preg_match( '/wiki$/', $lord ) ) {
            $gender = 'n'; // Dat xyz-wiki
Severity: Major
Found in includes/languages/LanguageKsh.php - About 2 hrs to fix

    Method insertRevisionOn has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function insertRevisionOn( RevisionRecord $rev, IDatabase $dbw ) {
            // TODO: pass in a DBTransactionContext instead of a database connection.
            $this->checkDatabaseDomain( $dbw );
    
            $slotRoles = $rev->getSlotRoles();
    Severity: Major
    Found in includes/Revision/RevisionStore.php - About 2 hrs to fix

      Method getFormFields has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getFormFields(): array {
              $user = $this->getUser();
              $title = $this->getTitle();
              $article = $this->getArticle();
      
      
      Severity: Major
      Found in includes/actions/DeleteAction.php - About 2 hrs to fix

        Method flattenArrayReal has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function flattenArrayReal( $vals, $type = 'ul', $noHtml = false ) {
                if ( !is_array( $vals ) ) {
                    return $vals; // do nothing if not an array;
                }
        
        
        Severity: Major
        Found in includes/media/FormatMetadata.php - About 2 hrs to fix

          Method submit has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function submit() {
                  $this->parent->setVarsFromRequest( [ '_RightsProfile', '_LicenseCode',
                      'wgEnableEmail', 'wgPasswordSender', 'wgEnableUploads',
                      '_Logo1x', '_LogoWordmark', '_LogoTagline', '_LogoIcon',
                      'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist',
          Severity: Major
          Found in includes/installer/WebInstallerOptions.php - About 2 hrs to fix

            Method addExtensionOptions has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function addExtensionOptions(): void {
                    global $wgLang;
            
                    $extensions = $this->parent->findExtensions()->value;
                    '@phan-var array[] $extensions';
            Severity: Major
            Found in includes/installer/WebInstallerOptions.php - About 2 hrs to fix

              Method runFirstQuery has 74 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function runFirstQuery( $resultPageSet = null ) {
                      $this->addTables( [ $this->bl_table, 'page' ] );
                      $this->addWhere( "{$this->bl_from}=page_id" );
                      if ( $resultPageSet === null ) {
                          $this->addFields( [ 'page_id', 'page_title', 'page_namespace' ] );
              Severity: Major
              Found in includes/api/ApiQueryBacklinks.php - About 2 hrs to fix

                Method doMainQuery has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function doMainQuery( $tables, $fields, $conds, $query_options,
                        $join_conds, FormOptions $opts
                    ) {
                        $dbr = $this->getDB();
                        $user = $this->getUser();
                Severity: Major
                Found in includes/specials/SpecialWatchlist.php - About 2 hrs to fix

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

                      public function execute( $par ) {
                          $this->setHeaders();
                          $this->outputHeader();
                          $this->addHelpLink( 'Help:Tracking categories' );
                          $this->getOutput()->setPreventClickjacking( false );
                  Severity: Major
                  Found in includes/specials/SpecialTrackingCategories.php - About 2 hrs to fix

                    Method reportPage has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function reportPage( ?PageIdentity $pageIdentity, $foreignTitle, $revisionCount,
                                $successCount, $pageInfo ) {
                            call_user_func_array( $this->mOriginalPageOutCallback, func_get_args() );
                    
                            if ( $pageIdentity === null ) {
                    Severity: Major
                    Found in includes/specials/helpers/ImportReporter.php - About 2 hrs to fix

                      Method getRecognizedTagData has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getRecognizedTagData( array $extratags = [], array $removetags = [] ): array {
                              static $commonCase, $staticInitialised = false;
                              $isCommonCase = ( $extratags === [] && $removetags === [] );
                              if ( $staticInitialised && $isCommonCase && $commonCase ) {
                                  return $commonCase;
                      Severity: Major
                      Found in includes/parser/Sanitizer.php - About 2 hrs to fix

                        Method main has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function main() {
                                $services = $this->getServiceContainer();
                                $contLang = $services->getContentLanguage();
                                $langConverter = $services->getLanguageConverterFactory()->getLanguageConverter( $contLang );
                                $serverUrl = $services->getUrlUtils()->getServer( PROTO_CANONICAL ) ?? '';
                        Severity: Major
                        Found in maintenance/generateSitemap.php - About 2 hrs to fix

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

                              return {
                                input,
                                inputWrapper,
                                menu,
                                menuId,
                          Severity: Major
                          Found in resources/lib/codex/codex.js and 1 other location - About 2 hrs to fix
                          resources/lib/codex/codex.js on lines 8811..8830

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

                          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 ( Array.isArray( colProps ) ) {
                                  for ( i = 0, len = colProps.length; i < len; i++ ) {
                                      this.cols.push( {
                                          index: i,
                                          key: colProps[ i ].key,
                          resources/src/mediawiki.widgets/Table/mw.widgets.TableWidgetModel.js on lines 157..165

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

                          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 ( Array.isArray( rowProps ) ) {
                                  for ( i = 0, len = rowProps.length; i < len; i++ ) {
                                      this.rows.push( {
                                          index: i,
                                          key: rowProps[ i ].key,
                          resources/src/mediawiki.widgets/Table/mw.widgets.TableWidgetModel.js on lines 167..175

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

                          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

                              return {
                                activeTab,
                                activeTabIndex,
                                activeTabId,
                                currentDirection,
                          Severity: Major
                          Found in resources/lib/codex/codex.js and 1 other location - About 2 hrs to fix
                          resources/lib/codex/codex.js on lines 5301..5320

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

                          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

                          File jquery.ui.tooltip.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /*!
                           * jQuery UI Tooltip 1.9.2
                           * http://jqueryui.com
                           *
                           * Copyright 2012 jQuery Foundation and other contributors
                          Severity: Minor
                          Found in resources/lib/jquery.ui/jquery.ui.tooltip.js - About 2 hrs to fix

                            File StatusValue.php has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /**
                             * This program is free software; you can redistribute it and/or modify
                             * it under the terms of the GNU General Public License as published by
                             * the Free Software Foundation; either version 2 of the License, or
                            Severity: Minor
                            Found in includes/libs/StatusValue.php - About 2 hrs to fix

                              File ApiOpenSearch.php has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /**
                               * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
                               * Copyright © 2008 Brooke Vibber <bvibber@wikimedia.org>
                               * Copyright © 2014 Wikimedia Foundation and contributors
                              Severity: Minor
                              Found in includes/api/ApiOpenSearch.php - About 2 hrs to fix

                                File SpecialLog.php has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                /**
                                 * This program is free software; you can redistribute it and/or modify
                                 * it under the terms of the GNU General Public License as published by
                                 * the Free Software Foundation; either version 2 of the License, or
                                Severity: Minor
                                Found in includes/specials/SpecialLog.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language