wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

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

    public function execute() {
        $pages = $this->getPageSet()->getGoodPages();
        if ( $pages === [] ) {
            return;
        }
Severity: Major
Found in includes/api/ApiQueryLangLinks.php - About 3 hrs to fix

    Method extractRequestParams has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function extractRequestParams( $options = [] ) {
            if ( is_bool( $options ) ) {
                $options = [ 'parseLimit' => $options ];
            }
            $options += [
    Severity: Major
    Found in includes/api/ApiBase.php - About 3 hrs to fix

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

          public function execute( $par ) {
              $out = $this->getOutput();
      
              $this->setHeaders();
      
      
      Severity: Major
      Found in includes/specials/SpecialAllMessages.php - About 3 hrs to fix

        Method findOrphanBlobs has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function findOrphanBlobs() {
                if ( !extension_loaded( 'gmp' ) ) {
                    echo "Can't find orphan blobs, need bitfield support provided by GMP.\n";
        
                    return;
        Severity: Major
        Found in maintenance/storage/trackBlobs.php - About 3 hrs to fix

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

              public function execute() {
                  $force = $this->hasOption( 'force' );
                  $brokenOnly = $this->hasOption( 'broken-only' );
                  $verbose = $this->hasOption( 'verbose' );
                  $start = $this->getOption( 'start', false );
          Severity: Major
          Found in maintenance/refreshImageMetadata.php - About 3 hrs to fix

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

                public function execute() {
                    global $IP;
            
                    if ( $this->hasOption( 'help' ) ) {
                        $this->maybeHelp();
            Severity: Major
            Found in maintenance/install.php - About 3 hrs to fix

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

                                  [
                                      'name' => 'hidenewpages',
                                      'label' => 'rcfilters-filter-newpages-label',
                                      'description' => 'rcfilters-filter-newpages-description',
                                      'default' => false,
              Severity: Major
              Found in includes/specialpage/ChangesListSpecialPage.php and 2 other locations - About 3 hrs to fix
              includes/specialpage/ChangesListSpecialPage.php on lines 421..436
              includes/specialpage/ChangesListSpecialPage.php on lines 456..471

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

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

                                  [
                                      'name' => 'hidelog',
                                      'label' => 'rcfilters-filter-logactions-label',
                                      'description' => 'rcfilters-filter-logactions-description',
                                      'default' => false,
              Severity: Major
              Found in includes/specialpage/ChangesListSpecialPage.php and 2 other locations - About 3 hrs to fix
              includes/specialpage/ChangesListSpecialPage.php on lines 421..436
              includes/specialpage/ChangesListSpecialPage.php on lines 437..452

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

              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

                  final public function getFileList( array $params ) {
                      [ $fullCont, $dir, $shard ] = $this->resolveStoragePath( $params['dir'] );
                      if ( $dir === null ) {
                          return self::LIST_ERROR; // invalid storage path
                      }
              Severity: Major
              Found in includes/libs/filebackend/FileBackendStore.php and 1 other location - About 3 hrs to fix
              includes/libs/filebackend/FileBackendStore.php on lines 1123..1139

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

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

                                  [
                                      'name' => 'hidepageedits',
                                      'label' => 'rcfilters-filter-pageedits-label',
                                      'description' => 'rcfilters-filter-pageedits-description',
                                      'default' => false,
              Severity: Major
              Found in includes/specialpage/ChangesListSpecialPage.php and 2 other locations - About 3 hrs to fix
              includes/specialpage/ChangesListSpecialPage.php on lines 437..452
              includes/specialpage/ChangesListSpecialPage.php on lines 456..471

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

              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

                  final public function getDirectoryList( array $params ) {
                      [ $fullCont, $dir, $shard ] = $this->resolveStoragePath( $params['dir'] );
                      if ( $dir === null ) {
                          return self::EXISTENCE_ERROR; // invalid storage path
                      }
              Severity: Major
              Found in includes/libs/filebackend/FileBackendStore.php and 1 other location - About 3 hrs to fix
              includes/libs/filebackend/FileBackendStore.php on lines 1153..1169

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

              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

              ImagePage has 28 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class ImagePage extends Article {
                  use MediaFileTrait;
              
                  /** @var File|false Only temporary false, most code can assume this is a File */
                  private $displayImg;
              Severity: Minor
              Found in includes/page/ImagePage.php - About 3 hrs to fix

                ExtensionProcessor has 28 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class ExtensionProcessor implements Processor {
                
                    /**
                     * Keys that should be set to $GLOBALS
                     *
                Severity: Minor
                Found in includes/registration/ExtensionProcessor.php - About 3 hrs to fix

                  ExtensionRegistry has 28 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class ExtensionRegistry {
                  
                      /**
                       * "requires" key that applies to MediaWiki core
                       */
                  Severity: Minor
                  Found in includes/registration/ExtensionRegistry.php - About 3 hrs to fix

                    MessageValue has 28 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class MessageValue implements JsonDeserializable {
                        use JsonDeserializableTrait;
                    
                        /** @var string */
                        private $key;
                    Severity: Minor
                    Found in includes/libs/Message/MessageValue.php - About 3 hrs to fix

                      DeleteAction has 28 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class DeleteAction extends FormAction {
                      
                          /**
                           * Constants used to localize form fields
                           */
                      Severity: Minor
                      Found in includes/actions/DeleteAction.php - About 3 hrs to fix

                        FauxRequest has 28 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class FauxRequest extends WebRequest {
                            private bool $wasPosted;
                            private ?string $requestUrl = null;
                            private array $serverInfo;
                        
                        
                        Severity: Minor
                        Found in includes/Request/FauxRequest.php - About 3 hrs to fix

                          JobQueueFederated has 28 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class JobQueueFederated extends JobQueue {
                              /** @var HashRing */
                              protected $partitionRing;
                              /** @var JobQueue[] (partition name => JobQueue) reverse sorted by weight */
                              protected $partitionQueues = [];
                          Severity: Minor
                          Found in includes/jobqueue/JobQueueFederated.php - About 3 hrs to fix

                            ManualLogEntry has 28 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class ManualLogEntry extends LogEntryBase implements Taggable {
                                /** @var string Type of log entry */
                                protected $type;
                            
                                /** @var string Sub type of log entry */
                            Severity: Minor
                            Found in includes/logging/ManualLogEntry.php - About 3 hrs to fix

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

                              function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
                                const _component_cdx_select = resolveComponent("cdx-select");
                                const _component_cdx_icon = resolveComponent("cdx-icon");
                                const _component_cdx_button = resolveComponent("cdx-button");
                                return openBlock(), createElementBlock("div", _hoisted_1$7, [
                              Severity: Major
                              Found in resources/lib/codex/codex.js - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language