wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

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

    public function execute( $subPage ) {
        $this->setHeaders();
        $this->loadAuth( $subPage );

        if ( !$this->isActionAllowed( $this->authAction ) ) {
Severity: Minor
Found in includes/specials/SpecialLinkAccounts.php - About 1 hr to fix

    Method doAck has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function doAck( RunnableJob $job ) {
            $uuid = $job->getMetadata( 'uuid' );
            if ( $uuid === null ) {
                throw new UnexpectedValueException( "Job of type '{$job->getType()}' has no UUID." );
            }
    Severity: Minor
    Found in includes/jobqueue/JobQueueRedis.php - About 1 hr to fix

      Method getFlatSectionInfo has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getFlatSectionInfo( $text ) {
              $magicScopeVariable = $this->lock();
              $this->startParse(
                  null,
                  ParserOptions::newFromUser( RequestContext::getMain()->getUser() ),
      Severity: Minor
      Found in includes/parser/Parser.php - About 1 hr to fix

        Method parse has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function parse(
                $text, PageReference $page, ParserOptions $options,
                bool $linestart = true, bool $clearState = true, ?int $revId = null,
                ?ParserOutput $previousOutput = null
            ): ParserOutput {
        Severity: Minor
        Found in includes/parser/Parsoid/ParsoidParser.php - About 1 hr to fix

          Method newUnsavedBotPassword has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function newUnsavedBotPassword(
                  array $data,
                  int $flags = IDBAccessObject::READ_NORMAL
              ): ?BotPassword {
                  if ( isset( $data['user'] ) && ( !$data['user'] instanceof UserIdentity ) ) {
          Severity: Minor
          Found in includes/user/BotPasswordStore.php - About 1 hr to fix

            Method setSessionStatus has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function setSessionStatus( UserIdentity $user, $statusKey, $value ) {
                    $store = self::getUploadSessionStore();
                    $key = self::getUploadSessionKey( $store, $user, $statusKey );
                    $logger = LoggerFactory::getInstance( 'upload' );
            
            
            Severity: Minor
            Found in includes/upload/UploadBase.php - About 1 hr to fix

              Method addOlds has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function addOlds() {
                      $archiveBase = 'archive';
                      $this->olds = [];
                      $this->oldCount = 0;
                      $archiveNames = [];
              Severity: Minor
              Found in includes/filerepo/file/LocalFileMoveBatch.php - About 1 hr to fix

                Method doIncrementalUpdate has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function doIncrementalUpdate() {
                        $services = MediaWikiServices::getInstance();
                        $config = $services->getMainConfig();
                        $dbProvider = $services->getConnectionProvider();
                        $batchSize = $config->get( MainConfigNames::UpdateRowsPerQuery );
                Severity: Minor
                Found in includes/deferred/LinksUpdate/LinksDeletionUpdate.php - About 1 hr to fix

                  Method deprecatedMsg has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function deprecatedMsg( $msg, $version = false,
                          $component = false, $callerOffset = 2
                      ) {
                          if ( $callerOffset === false ) {
                              $callerFunc = '';
                  Severity: Minor
                  Found in includes/debug/MWDebug.php - About 1 hr to fix

                    Method __construct has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function __construct( array $params ) {
                            $params += [
                                'service' => 'etcd',
                                'port' => null,
                                'protocol' => 'http',
                    Severity: Minor
                    Found in includes/config/EtcdConfig.php - About 1 hr to fix

                      Method insertDiffHist has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function insertDiffHist( &$s, &$rc, $unpatrolled = null ) {
                              # Diff link
                              if (
                                  $rc->mAttribs['rc_type'] == RC_NEW ||
                                  $rc->mAttribs['rc_type'] == RC_LOG ||
                      Severity: Minor
                      Found in includes/recentchanges/ChangesList.php - About 1 hr to fix

                        Method openSpawn has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function openSpawn() {
                                global $IP;
                        
                                $wiki = WikiMap::getCurrentWikiId();
                                if ( count( $this->php ) == 2 ) {
                        Severity: Minor
                        Found in maintenance/includes/TextPassDumper.php - About 1 hr to fix

                          Method doPopulate has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function doPopulate( array $data, $force ) {
                                  $dbw = $this->getPrimaryDB();
                          
                                  if ( !$force ) {
                                      $row = $dbw->newSelectQueryBuilder()
                          Severity: Minor
                          Found in maintenance/populateInterwiki.php - About 1 hr to fix

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

                                                if (resultsLen < limit) {
                                                  q.add(objResults);
                                                  ++resultsLen;
                                                } else {
                                                  ++limitedCount;
                            Severity: Major
                            Found in resources/lib/qunitjs/qunit.js and 1 other location - About 1 hr to fix
                            resources/lib/qunitjs/qunit.js on lines 4440..4446

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

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

                                            subpages.forEach( ( subpage ) => {
                                                if ( Object.prototype.hasOwnProperty.call( pages, subpage.key ) ) {
                                                    checkPages.push( pages[ subpage.key ] );
                                                }
                                            } );
                            Severity: Major
                            Found in resources/src/mediawiki.special.apisandbox/apisandbox.js and 3 other locations - About 1 hr to fix
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 925..929
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 1253..1257
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 1274..1278

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

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

                                            subpages.forEach( ( subpage ) => {
                                                if ( Object.prototype.hasOwnProperty.call( pages, subpage.key ) ) {
                                                    checkPages.push( pages[ subpage.key ] );
                                                }
                                            } );
                            Severity: Major
                            Found in resources/src/mediawiki.special.apisandbox/apisandbox.js and 3 other locations - About 1 hr to fix
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 246..250
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 1253..1257
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 1274..1278

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

                            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

                                            if (resultsLen < limit) {
                                              q.add(objResults);
                                              ++resultsLen;
                                            } else {
                                              ++limitedCount;
                            Severity: Major
                            Found in resources/lib/qunitjs/qunit.js and 1 other location - About 1 hr to fix
                            resources/lib/qunitjs/qunit.js on lines 4561..4567

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

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

                                            subpages.forEach( ( subpage ) => {
                                                if ( Object.prototype.hasOwnProperty.call( pages, subpage.key ) ) {
                                                    checkPages.push( pages[ subpage.key ] );
                                                }
                                            } );
                            Severity: Major
                            Found in resources/src/mediawiki.special.apisandbox/apisandbox.js and 3 other locations - About 1 hr to fix
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 246..250
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 925..929
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 1253..1257

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

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

                                            subpages.forEach( ( subpage ) => {
                                                if ( Object.prototype.hasOwnProperty.call( pages, subpage.key ) ) {
                                                    checkPages.push( pages[ subpage.key ] );
                                                }
                                            } );
                            Severity: Major
                            Found in resources/src/mediawiki.special.apisandbox/apisandbox.js and 3 other locations - About 1 hr to fix
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 246..250
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 925..929
                            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 1274..1278

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

                            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

                                    left: function() {
                                        $.ui.position.flip.left.apply( this, arguments );
                                        $.ui.position.fit.left.apply( this, arguments );
                                    },
                            Severity: Major
                            Found in resources/lib/jquery.ui/jquery.ui.position.js and 1 other location - About 1 hr to fix
                            resources/lib/jquery.ui/jquery.ui.position.js on lines 440..443

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

                            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