wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method refreshCounts has 101 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function refreshCounts() {
        if ( $this->readOnlyMode->isReadOnly() ) {
            return false;
        }

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

    File MessagesDe.php has 335 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /** German (Deutsch)
     *
     * @file
     * @ingroup Languages
    Severity: Minor
    Found in languages/messages/MessagesDe.php - About 4 hrs to fix

      File HistoryAction.php has 334 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Page history
       *
       * This program is free software; you can redistribute it and/or modify
      Severity: Minor
      Found in includes/actions/HistoryAction.php - About 4 hrs to fix

        Function flip$1 has 100 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const flip$1 = function(options) {
          if (options === void 0) {
            options = {};
          }
          return {
        Severity: Major
        Found in resources/lib/codex/codex.js - About 4 hrs to fix

          Function finish has 100 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              finish: function finish() {
                config.current = this;
          
                // Release the timeout and timeout callback references to be garbage collected.
                // https://github.com/qunitjs/qunit/pull/1708
          Severity: Major
          Found in resources/lib/qunitjs/qunit.js - About 4 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                        if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
                            if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
                            inst.snapElements[i].snapping = false;
                            continue;
                        }
            Severity: Critical
            Found in resources/lib/jquery.ui/jquery.ui.draggable.js - About 4 hrs to fix

              Method __construct has 32 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      Config $config,
                      LBFactory $lbFactory,
                      NamespaceInfo $namespaceInfo,
                      WatchedItemStoreInterface $watchedItemStore,
                      RepoGroup $repoGroup,
              Severity: Major
              Found in includes/page/PageCommandFactory.php - About 4 hrs to fix

                Method checkArray has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function checkArray( array $extDependencies ) {
                        $errors = [];
                        foreach ( $extDependencies as $extension => $dependencies ) {
                            foreach ( $dependencies as $dependencyType => $values ) {
                                switch ( $dependencyType ) {
                Severity: Major
                Found in includes/registration/VersionChecker.php - About 4 hrs to fix

                  Method getContentObject has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function getContentObject( $defaultContent = null ) {
                          $services = MediaWikiServices::getInstance();
                          $request = $this->context->getRequest();
                  
                          $content = false;
                  Severity: Major
                  Found in includes/editpage/EditPage.php - About 4 hrs to fix

                    Method pageCounts has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function pageCounts() {
                            $page = $this->getWikiPage();
                            $fname = __METHOD__;
                            $config = $this->context->getConfig();
                            $cache = $this->wanObjectCache;
                    Severity: Major
                    Found in includes/actions/InfoAction.php - About 4 hrs to fix

                      AuthManagerSpecialPage has 32 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      abstract class AuthManagerSpecialPage extends SpecialPage {
                          /** @var string[] The list of actions this special page deals with. Subclasses should override
                           * this.
                           */
                          protected static $allowedActions = [
                      Severity: Minor
                      Found in includes/specialpage/AuthManagerSpecialPage.php - About 4 hrs to fix

                        ApiQueryBase has 32 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        abstract class ApiQueryBase extends ApiBase {
                            use ApiQueryBlockInfoTrait;
                        
                            private ApiQuery $mQueryModule;
                            private ?IReadableDatabase $mDb;
                        Severity: Minor
                        Found in includes/api/ApiQueryBase.php - About 4 hrs to fix

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

                              public function execute() {
                                  $this->checkUserRightsAny( 'block' );
                                  $params = $this->extractRequestParams();
                                  $this->requireOnlyOneParameter( $params, 'user', 'userid' );
                          
                          
                          Severity: Major
                          Found in includes/api/ApiBlock.php - About 4 hrs to fix

                            LocalRepo has 32 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class LocalRepo extends FileRepo {
                                /** @var callable */
                                protected $fileFactory = [ LocalFile::class, 'newFromTitle' ];
                                /** @var callable */
                                protected $fileFactoryKey = [ LocalFile::class, 'newFromKey' ];
                            Severity: Minor
                            Found in includes/filerepo/LocalRepo.php - About 4 hrs to fix

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

                                  return function () {
                                      const context = this,
                                          args = arguments,
                                          later = function () {
                                              timeout = null;
                              Severity: Major
                              Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 4 hrs to fix
                              resources/src/mediawiki.util/util.js on lines 200..216

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

                              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

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

                                      return function () {
                                          const context = this,
                                              args = arguments,
                                              later = function () {
                                                  timeout = null;
                              Severity: Major
                              Found in resources/src/mediawiki.util/util.js and 1 other location - About 4 hrs to fix
                              resources/lib/ooui/oojs-ui-core.js on lines 245..261

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

                              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 Setup.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /**
                               * The setup for all MediaWiki processes (both web-based and CLI).
                               *
                               * The entry point (such as WebStart.php and doMaintenance.php) has these responsibilities:
                              Severity: Minor
                              Found in includes/Setup.php - About 4 hrs to fix

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

                                    public function validate( $value, $alldata ) {
                                        if ( !$this->mParams['exists'] ) {
                                            return true;
                                        }
                                
                                
                                Severity: Major
                                Found in includes/htmlform/fields/HTMLUsersMultiselectField.php and 1 other location - About 4 hrs to fix
                                includes/htmlform/fields/HTMLTitlesMultiselectField.php on lines 51..75

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

                                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

                                    public function validate( $value, $alldata ) {
                                        if ( !$this->mParams['exists'] ) {
                                            return true;
                                        }
                                
                                
                                Severity: Major
                                Found in includes/htmlform/fields/HTMLTitlesMultiselectField.php and 1 other location - About 4 hrs to fix
                                includes/htmlform/fields/HTMLUsersMultiselectField.php on lines 60..84

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

                                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

                                    public function __construct(
                                        ApiQuery $query,
                                        $moduleName,
                                        RevisionStore $revisionStore,
                                        IContentHandlerFactory $contentHandlerFactory,
                                Severity: Major
                                Found in includes/api/ApiQueryAllRevisions.php and 2 other locations - About 4 hrs to fix
                                includes/api/ApiQueryAllDeletedRevisions.php on lines 75..107
                                includes/api/ApiQueryDeletedRevisions.php on lines 72..104

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

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language