wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method toHTML has 191 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function toHTML() {
        $resolveFilesViaParser = $this->mParser instanceof Parser;
        if ( $resolveFilesViaParser ) {
            $parserOutput = $this->mParser->getOutput();
            $repoGroup = null;
Severity: Major
Found in includes/gallery/TraditionalImageGallery.php - About 7 hrs to fix

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

        public function execute() {
            $user = $this->getUser();
            $db = $this->getDB();
    
            $params = $this->extractRequestParams();
    Severity: Major
    Found in includes/api/ApiQueryFilearchive.php - About 7 hrs to fix

      Method run has 190 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function run( ApiPageSet $resultPageSet = null ) {
              $settings = self::$settings[$this->getModuleName()];
      
              $db = $this->getDB();
              $params = $this->extractRequestParams();
      Severity: Major
      Found in includes/api/ApiQueryBacklinksprop.php - About 7 hrs to fix

        Method makeImageLink has 190 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function makeImageLink( Parser $parser, LinkTarget $title,
                $file, $frameParams = [], $handlerParams = [], $time = false,
                $query = '', $widthOption = null
            ) {
                $title = Title::newFromLinkTarget( $title );
        Severity: Major
        Found in includes/linker/Linker.php - About 7 hrs to fix

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

          jQuery(function($){
              $.datepicker.regional['ro'] = {
                  closeText: 'Închide',
                  prevText: '« Luna precedentă',
                  nextText: 'Luna următoare »',
          Severity: Major
          Found in resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ro.js and 3 other locations - About 7 hrs to fix
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-de-AT.js on lines 2..22
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-de-CH.js on lines 2..22
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-pt.js on lines 2..22

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

          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 4 locations. Consider refactoring.
          Open

          jQuery(function($){
              $.datepicker.regional['pt'] = {
                  closeText: 'Fechar',
                  prevText: '<Anterior',
                  nextText: 'Seguinte',
          Severity: Major
          Found in resources/lib/jquery.ui/i18n/jquery.ui.datepicker-pt.js and 3 other locations - About 7 hrs to fix
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-de-AT.js on lines 2..22
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-de-CH.js on lines 2..22
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ro.js on lines 6..26

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

          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 4 locations. Consider refactoring.
          Open

          jQuery(function($){
              $.datepicker.regional['de-AT'] = {
                  closeText: 'schließen',
                  prevText: '<zurück',
                  nextText: 'Vor>',
          Severity: Major
          Found in resources/lib/jquery.ui/i18n/jquery.ui.datepicker-de-AT.js and 3 other locations - About 7 hrs to fix
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-de-CH.js on lines 2..22
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-pt.js on lines 2..22
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ro.js on lines 6..26

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

          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 4 locations. Consider refactoring.
          Open

          jQuery(function($){
              $.datepicker.regional['de-CH'] = {
                  closeText: 'schliessen',
                  prevText: '<zurück',
                  nextText: 'Vor>',
          Severity: Major
          Found in resources/lib/jquery.ui/i18n/jquery.ui.datepicker-de-CH.js and 3 other locations - About 7 hrs to fix
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-de-AT.js on lines 2..22
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-pt.js on lines 2..22
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ro.js on lines 6..26

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

          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

          Function checkActionPermissions has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
          Open

              private function checkActionPermissions(
                  $action,
                  User $user,
                  PermissionStatus $status,
                  $rigor,
          Severity: Minor
          Found in includes/Permissions/PermissionManager.php - About 7 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function run has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
          Open

              private function run( $resultPageSet = null ) {
                  $params = $this->extractRequestParams();
          
                  $user = $this->getUser();
                  $wlowner = $this->getWatchlistUser( $params );
          Severity: Minor
          Found in includes/api/ApiQueryWatchlist.php - About 7 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function execute has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
          Open

              public function execute() {
                  $params = $this->extractRequestParams();
                  $db = $this->getDB();
                  $this->requireMaxOneParameter( $params, 'title', 'prefix', 'namespace' );
          
          
          Severity: Minor
          Found in includes/api/ApiQueryLogEvents.php - About 7 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function appendExtensions has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function appendExtensions( $property ) {
                  $data = [];
                  $credits = SpecialVersion::getCredits(
                      ExtensionRegistry::getInstance(),
                      $this->getConfig()
          Severity: Minor
          Found in includes/api/ApiQuerySiteinfo.php - About 7 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function getIRCActionText has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getIRCActionText() {
                  $this->plaintext = true;
                  $this->irctext = true;
          
                  $entry = $this->entry;
          Severity: Minor
          Found in includes/logging/LogFormatter.php - About 7 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function execute has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
          Open

              public function execute() {
                  /** @var Language $wgLang */
                  global $wgLang;
          
                  $repo = $this->file->getRepo();
          Severity: Minor
          Found in includes/filerepo/file/LocalFileRestoreBatch.php - About 7 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          File LBFactory.php has 482 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/lbfactory/LBFactory.php - About 7 hrs to fix

            Method recache has 189 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function recache( $code ) {
                    if ( !$code ) {
                        throw new InvalidArgumentException( "Invalid language code requested" );
                    }
                    $this->recachedLangs[ $code ] = true;
            Severity: Major
            Found in includes/language/LocalisationCache.php - About 7 hrs to fix

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

              /**
               * Provides a {@link jQuery} plugin that add suggestions to a text box.
               *
               * @module jquery.suggestions
               */
              Severity: Minor
              Found in resources/src/jquery/jquery.suggestions.js - About 7 hrs to fix

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

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

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

                      public function execute() {
                          $params = $this->extractRequestParams();
                          $db = $this->getDB();
                          $this->requireMaxOneParameter( $params, 'title', 'prefix', 'namespace' );
                  
                  
                  Severity: Major
                  Found in includes/api/ApiQueryLogEvents.php - About 7 hrs to fix

                    File ApiQueryDeletedrevs.php has 480 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * Copyright © 2007 Roan Kattouw <roan.kattouw@gmail.com>
                     *
                     * This program is free software; you can redistribute it and/or modify
                    Severity: Minor
                    Found in includes/api/ApiQueryDeletedrevs.php - About 7 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language