wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

RequestContext has 38 functions (exceeds 20 allowed). Consider refactoring.
Open

class RequestContext implements IContextSource, MutableContext {
    use NonSerializableTrait;

    /**
     * @var WebRequest
Severity: Minor
Found in includes/context/RequestContext.php - About 5 hrs to fix

    Method statelessFetchTemplate has 125 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function statelessFetchTemplate( $page, $parser = false ) {
            $title = Title::castFromLinkTarget( $page ); // for compatibility with return type
            $text = $skip = false;
            $finalTitle = $title;
            $deps = [];
    Severity: Major
    Found in includes/parser/Parser.php - About 5 hrs to fix

      LogFormatter has 38 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class LogFormatter {
          // Audience options for viewing usernames, comments, and actions
          public const FOR_PUBLIC = 1;
          public const FOR_THIS_USER = 2;
      
      
      Severity: Minor
      Found in includes/logging/LogFormatter.php - About 5 hrs to fix

        LinksTable has 38 functions (exceeds 20 allowed). Consider refactoring.
        Open

        abstract class LinksTable {
            /** Link type: Inserted (added) links */
            public const INSERTED = 1;
        
            /** Link type: Deleted (removed) links */
        Severity: Minor
        Found in includes/deferred/LinksUpdate/LinksTable.php - About 5 hrs to fix

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

              function translatePast(output) {
                  var time = output;
                  time =
                      output.indexOf('jaj') !== -1
                          ? time.slice(0, -3) + 'Hu’'
          Severity: Major
          Found in resources/lib/moment/locale/tlh.js and 1 other location - About 5 hrs to fix
          resources/lib/moment/locale/tlh.js on lines 16..27

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

          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

              function translateFuture(output) {
                  var time = output;
                  time =
                      output.indexOf('jaj') !== -1
                          ? time.slice(0, -3) + 'leS'
          Severity: Major
          Found in resources/lib/moment/locale/tlh.js and 1 other location - About 5 hrs to fix
          resources/lib/moment/locale/tlh.js on lines 29..40

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

          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

                      'TrxProfilerLimits' => [
                          'GET' => [
                              'masterConns' => 0,
                              'writes' => 0,
                              'readQueryTime' => 5,
          Severity: Major
          Found in includes/config-schema.php and 1 other location - About 5 hrs to fix
          includes/MainConfigSchema.php on lines 9651..9702

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

          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

                  'default' => [
                      // HTTP GET/HEAD requests.
                      // Primary queries should not happen on GET requests
                      'GET' => [
                          'masterConns' => 0,
          Severity: Major
          Found in includes/MainConfigSchema.php and 1 other location - About 5 hrs to fix
          includes/config-schema.php on lines 1852..1894

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

          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 HookContainer.php has 374 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/HookContainer/HookContainer.php - About 5 hrs to fix

            Method generateContentOutput has 124 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function generateContentOutput(
                    Authority $performer,
                    ParserOptions $parserOptions,
                    int $oldid,
                    OutputPage $outputPage,
            Severity: Major
            Found in includes/page/Article.php - About 4 hrs to fix

              Method showMissingArticle has 124 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function showMissingArticle() {
                      $context = $this->getContext();
                      $send404Code = $context->getConfig()->get( MainConfigNames::Send404Code );
              
                      $outputPage = $context->getOutput();
              Severity: Major
              Found in includes/page/Article.php - About 4 hrs to fix

                Method collectMetadata has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function collectMetadata( ContentMetadataCollector $metadata ): void {
                        // Uniform handling of all boolean flags: they are OR'ed together.
                        $flags = array_keys(
                            $this->mFlags + array_flip( ParserOutputFlags::cases() )
                        );
                Severity: Major
                Found in includes/parser/ParserOutput.php - About 4 hrs to fix

                  File MergeHistory.php has 373 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * Copyright © 2015 Geoffrey Mon <geofbot@gmail.com>
                   *
                  Severity: Minor
                  Found in includes/page/MergeHistory.php - About 4 hrs to fix

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

                        function relativeTimeWithPlural(number, withoutSuffix, key) {
                            var format = {
                                ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
                                mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
                                hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
                    Severity: Major
                    Found in resources/lib/moment/locale/uk.js and 1 other location - About 4 hrs to fix
                    resources/lib/moment/locale/be.js on lines 24..40

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

                    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

                        function relativeTimeWithPlural(number, withoutSuffix, key) {
                            var format = {
                                ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
                                mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
                                hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
                    Severity: Major
                    Found in resources/lib/moment/locale/be.js and 1 other location - About 4 hrs to fix
                    resources/lib/moment/locale/uk.js on lines 23..39

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

                    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

                    <?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: Major
                    Found in includes/specials/redirects/SpecialMytalk.php and 1 other location - About 4 hrs to fix
                    includes/specials/redirects/SpecialMypage.php on lines 1..78

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

                    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

                    <?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: Major
                    Found in includes/specials/redirects/SpecialMypage.php and 1 other location - About 4 hrs to fix
                    includes/specials/redirects/SpecialMytalk.php on lines 1..77

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

                    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 extractRowInfo has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function extractRowInfo( $row ) {
                            /* Determine the title of the page that has been changed. */
                            $title = Title::makeTitle( $row->rc_namespace, $row->rc_title );
                            $user = $this->getUser();
                    
                    
                    Severity: Major
                    Found in includes/api/ApiQueryRecentChanges.php - About 4 hrs to fix

                      Method showChunk has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function showChunk(
                              $namespace = NS_MAIN, $from = null, $to = null, $hideredirects = false
                          ) {
                              $output = $this->getOutput();
                      
                      
                      Severity: Major
                      Found in includes/specials/SpecialAllPages.php - About 4 hrs to fix

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

                            protected function getFormFields() {
                                $fields = [];
                        
                                if ( $this->par !== null ) {
                                    $this->botPassword = BotPassword::newFromCentralId( $this->userId, $this->par );
                        Severity: Major
                        Found in includes/specials/SpecialBotPasswords.php - About 4 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language