wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method invalidateTitles has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function invalidateTitles( array $pages ) {
        // Get all page IDs in this query into an array
        $pageIds = array_keys( $pages );
        if ( !$pageIds ) {
            return;
Severity: Minor
Found in includes/jobqueue/jobs/HTMLCacheUpdateJob.php - About 1 hr to fix

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

        public function run() {
            $ok = true;
    
            if ( !empty( $this->params['recursive'] ) ) {
                // Job to update all (or a range of) backlink pages for a page
    Severity: Minor
    Found in includes/jobqueue/jobs/RefreshLinksJob.php - About 1 hr to fix

      Method doParsoidCacheUpdate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function doParsoidCacheUpdate() {
              $page = $this->pageLookup->getPageById( $this->params['pageId'] );
              $revId = $this->params['revId'];
      
              if ( $page === null ) {
      Severity: Minor
      Found in includes/jobqueue/jobs/ParsoidCachePrewarmJob.php - About 1 hr to fix

        Method internalRemoveHtmlTags has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function internalRemoveHtmlTags( string $text, ?callable $processCallback = null,
                $args = [], array $extratags = [], array $removetags = []
            ): string {
                $tagData = self::getRecognizedTagData( $extratags, $removetags );
                $htmlsingle = $tagData['htmlsingle'];
        Severity: Minor
        Found in includes/parser/Sanitizer.php - About 1 hr to fix

          Method resolveRevision has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function resolveRevision( PageIdentity $page, $revision, bool $lenientRevHandling = false ): array {
                  $uncacheable = false;
                  if ( !$page instanceof PageRecord ) {
                      $name = "$page";
                      $page = $this->pageLookup->getPageByReference( $page );
          Severity: Minor
          Found in includes/parser/Parsoid/ParsoidOutputAccess.php - About 1 hr to fix

            Method createFromException has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function createFromException( Throwable $exception, array $extraData = [] ) {
                    if ( $exception instanceof LocalizedHttpException ) {
                        $response = $this->createLocalizedHttpError(
                            $exception->getCode(),
                            $exception->getMessageValue(),
            Severity: Minor
            Found in includes/Rest/ResponseFactory.php - About 1 hr to fix

              Method buildModuleMap has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function buildModuleMap(): array {
                      $modules = [];
                      $noPrefixFiles = [];
                      $id = ''; // should not be used, make Phan happy
              
              
              Severity: Minor
              Found in includes/Rest/Router.php - About 1 hr to fix

                Method flatten has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected static function flatten( $item ) {
                        if ( $item === null ) {
                            return '[Null]';
                        }
                
                
                Severity: Minor
                Found in includes/debug/logger/LegacyLogger.php - About 1 hr to fix

                  Method shortDialogHtml has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function shortDialogHtml(
                          $profile,
                          $term,
                          $numResults,
                          $totalResults,
                  Severity: Minor
                  Found in includes/search/searchwidgets/SearchFormWidget.php - About 1 hr to fix

                    Method processUsers has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function processUsers( array $userBatch, IDatabase $dbw ) {
                            if ( !$userBatch ) {
                                return;
                            }
                            if ( $this->getOption( 'delete' ) ) {
                    Severity: Minor
                    Found in maintenance/includes/DeleteLocalPasswords.php - About 1 hr to fix

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

                          public function execute() {
                              global $IP;
                      
                              $data = [];
                      
                      
                      Severity: Minor
                      Found in maintenance/mediawiki.Title/generatePhpCharToUpperMappings.php - About 1 hr to fix

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

                            public function execute() {
                                $dbw = $this->getPrimaryDB();
                        
                                $lastId = 0;
                                do {
                        Severity: Minor
                        Found in maintenance/fixUserRegistration.php - About 1 hr to fix

                          Method populateSearchIndex has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function populateSearchIndex() {
                                  $dbw = $this->getPrimaryDB();
                                  $res = $dbw->newSelectQueryBuilder()
                                      ->select( [ 'count' => 'MAX(page_id)' ] )
                                      ->from( 'page' )
                          Severity: Minor
                          Found in maintenance/rebuildtextindex.php - About 1 hr to fix

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

                                public function execute() {
                                    global $wgHTCPRouting;
                            
                                    if ( $this->hasOption( 'htcp-dest' ) ) {
                                        $parts = explode( ':', $this->getOption( 'htcp-dest' ), 2 );
                            Severity: Minor
                            Found in maintenance/purgeChangedFiles.php - About 1 hr to fix

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

                                              if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
                              Severity: Major
                              Found in resources/lib/jquery.ui/jquery.ui.sortable.js and 3 other locations - About 1 hr to fix
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 944..944
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 945..945
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 947..947

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

                              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

                                              if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
                              Severity: Major
                              Found in resources/lib/jquery.ui/jquery.ui.sortable.js and 3 other locations - About 1 hr to fix
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 944..944
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 945..945
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 946..946

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

                              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

                                              if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
                              Severity: Major
                              Found in resources/lib/jquery.ui/jquery.ui.sortable.js and 3 other locations - About 1 hr to fix
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 944..944
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 946..946
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 947..947

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

                              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

                                              if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
                              Severity: Major
                              Found in resources/lib/jquery.ui/jquery.ui.sortable.js and 3 other locations - About 1 hr to fix
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 945..945
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 946..946
                              resources/lib/jquery.ui/jquery.ui.sortable.js on lines 947..947

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

                              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

                              OO.ui.MenuLayout.prototype.setMenuPanel = function ( menuPanel ) {
                                  this.menuPanel = menuPanel;
                                  this.$menu.append( this.menuPanel.$element );
                              };
                              Severity: Major
                              Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                              resources/lib/ooui/oojs-ui-widgets.js on lines 1828..1831

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

                              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

                                              if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
                              Severity: Major
                              Found in resources/lib/jquery.ui/jquery.ui.draggable.js and 1 other location - About 1 hr to fix
                              resources/lib/jquery.ui/jquery.ui.draggable.js on lines 794..794

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

                              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