wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method appendGeneralInfo has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function appendGeneralInfo( $property ) {
        $config = $this->getConfig();
        $mainPage = Title::newMainPage();
        $logo = SkinModule::getAvailableLogos( $config, $this->getLanguage()->getCode() );

Severity: Major
Found in includes/api/ApiQuerySiteinfo.php - About 4 hrs to fix

    Method registerFilters has 117 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function registerFilters() {
            parent::registerFilters();
    
            // legacy 'extended' filter
            $this->registerFilterGroup( new ChangesListBooleanFilterGroup( [
    Severity: Major
    Found in includes/specials/SpecialWatchlist.php - About 4 hrs to fix

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

          public function execute() {
              $mcc = new MemcachedClient( [
                  'persistent' => true,
                  'debug' => $this->hasOption( 'debug' ),
              ] );
      Severity: Major
      Found in maintenance/mcc.php - About 4 hrs to fix

        PermissionManager has 36 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class PermissionManager {
        
            /** @var string Does cheap permission checks from replica DBs (usable for GUI creation) */
            public const RIGOR_QUICK = 'quick';
        
        
        Severity: Minor
        Found in includes/Permissions/PermissionManager.php - About 4 hrs to fix

          SessionProvider has 36 functions (exceeds 20 allowed). Consider refactoring.
          Open

          abstract class SessionProvider implements Stringable, SessionProviderInterface {
          
              /** @var LoggerInterface */
              protected $logger;
          
          
          Severity: Minor
          Found in includes/session/SessionProvider.php - About 4 hrs to fix

            SkinTemplate has 36 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class SkinTemplate extends Skin {
                /**
                 * @var string For QuickTemplate, the name of the subclass which will
                 *   actually fill the template.
                 */
            Severity: Minor
            Found in includes/skins/SkinTemplate.php - About 4 hrs to fix

              Html has 36 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Html {
                  /** @var bool[] List of void elements from HTML5, section 8.1.2 as of 2016-09-19 */
                  private static $voidElements = [
                      'area' => true,
                      'base' => true,
              Severity: Minor
              Found in includes/Html/Html.php - About 4 hrs to fix

                Xml has 36 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Xml {
                    /**
                     * Format an XML element with given attributes and, optionally, text content.
                     * Element and attribute names are assumed to be ready for literal inclusion.
                     * Strings are assumed to not contain XML-illegal characters; special
                Severity: Minor
                Found in includes/xml/Xml.php - About 4 hrs to fix

                  SpecialVersion has 36 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class SpecialVersion extends SpecialPage {
                  
                      /**
                       * @var string The current rev id/SHA hash of MediaWiki core
                       */
                  Severity: Minor
                  Found in includes/specials/SpecialVersion.php - About 4 hrs to fix

                    FileBackendDBRepoWrapper has 36 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class FileBackendDBRepoWrapper extends FileBackend {
                        /** @var FileBackend */
                        protected $backend;
                        /** @var string */
                        protected $repoName;
                    Severity: Minor
                    Found in includes/filerepo/FileBackendDBRepoWrapper.php - About 4 hrs to fix

                      File MysqlReplicationReporter.php has 361 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/rdbms/database/replication/MysqlReplicationReporter.php - About 4 hrs to fix

                        File ApiQueryAllUsers.php has 361 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /**
                         * Copyright © 2007 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
                         *
                         * This program is free software; you can redistribute it and/or modify
                        Severity: Minor
                        Found in includes/api/ApiQueryAllUsers.php - About 4 hrs to fix

                          File UserOptionsManager.php has 361 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/user/Options/UserOptionsManager.php - About 4 hrs to fix

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

                                  if (s.lookahead >= MIN_MATCH) {
                                    /*** INSERT_STRING(s, s.strstart, hash_head); ***/
                                    s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);
                                    hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
                                    s.head[s.ins_h] = s.strstart;
                            Severity: Major
                            Found in resources/lib/pako/pako_deflate.js and 1 other location - About 4 hrs to fix
                            resources/lib/pako/pako_deflate.js on lines 2118..2124

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

                            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 ( clipWidth ) {
                                    // The hacks below are no longer needed for Firefox and Chrome after T349034,
                                    // but may still be needed for Safari. TODO: Test and maybe remove them.
                            
                                    // Set overflow to 'scroll' first to avoid browser bugs causing bogus scrollbars (T67059),
                            Severity: Major
                            Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 4 hrs to fix
                            resources/lib/ooui/oojs-ui-core.js on lines 5815..5841

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

                            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 ( clipHeight ) {
                                    // The hacks below are no longer needed for Firefox and Chrome after T349034,
                                    // but may still be needed for Safari. TODO: Test and maybe remove them.
                            
                                    // Set overflow to 'scroll' first to avoid browser bugs causing bogus scrollbars (T67059),
                            Severity: Major
                            Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 4 hrs to fix
                            resources/lib/ooui/oojs-ui-core.js on lines 5788..5814

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

                            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 (s.lookahead >= MIN_MATCH) {
                                    /*** INSERT_STRING(s, s.strstart, hash_head); ***/
                                    s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);
                                    hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
                                    s.head[s.ins_h] = s.strstart;
                            Severity: Major
                            Found in resources/lib/pako/pako_deflate.js and 1 other location - About 4 hrs to fix
                            resources/lib/pako/pako_deflate.js on lines 2248..2254

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

                            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

                            Method view has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function view() {
                                    $context = $this->getContext();
                                    $useFileCache = $context->getConfig()->get( MainConfigNames::UseFileCache );
                            
                                    # Get variables from query string
                            Severity: Major
                            Found in includes/page/Article.php - About 4 hrs to fix

                              File MysqlInstaller.php has 360 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              
                              /**
                               * MySQL-specific installer.
                               *
                              Severity: Minor
                              Found in includes/installer/MysqlInstaller.php - About 4 hrs to fix

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

                                    public function execute( $par ) {
                                        $this->useTransactionalTimeLimit();
                                
                                        $this->checkPermissions();
                                        $this->checkReadOnly();
                                Severity: Major
                                Found in includes/specials/SpecialRevisionDelete.php - About 4 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language