wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method getLanguages has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getLanguages() {
        if ( $this->getConfig()->get( MainConfigNames::HideInterlanguageLinks ) ) {
            return [];
        }
        if ( $this->languageLinks === null ) {
Severity: Major
Found in includes/skins/Skin.php - About 3 hrs to fix

    Method search has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function search( $search, array $params ) {
            $searchEngine = $this->buildSearchEngine( $params );
            $titles = $searchEngine->extractTitles( $searchEngine->completionSearchWithVariants( $search ) );
            $results = [];
    
    
    Severity: Major
    Found in includes/api/ApiOpenSearch.php - About 3 hrs to fix

      Method extractRowInfo has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function extractRowInfo( $row ) {
              $vals = [];
              $anyHidden = false;
      
              if ( $row->rev_deleted & RevisionRecord::DELETED_TEXT ) {
      Severity: Major
      Found in includes/api/ApiQueryUserContribs.php - About 3 hrs to fix

        Method closePrinter has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function closePrinter() {
                if ( $this->mDisabled ) {
                    return;
                }
        
        
        Severity: Major
        Found in includes/api/ApiFormatBase.php - About 3 hrs to fix

          Method recycleAndDeleteStaleJobs has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function recycleAndDeleteStaleJobs() {
                  $now = time();
                  $count = 0; // affected rows
                  $dbw = $this->getPrimaryDB();
          
          
          Severity: Major
          Found in includes/jobqueue/JobQueueDB.php - About 3 hrs to fix

            Method validateAttributes has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function validateAttributes( array $attribs, array $allowed ): array {
                    if ( isset( $allowed[0] ) ) {
                        // Calling this function with a sequential array is
                        // deprecated.  For now just convert it.
                        wfDeprecated( __METHOD__ . ' with sequential array', '1.35' );
            Severity: Major
            Found in includes/parser/Sanitizer.php - About 3 hrs to fix

              File LocalFileMoveBatch.php has 295 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/filerepo/file/LocalFileMoveBatch.php - About 3 hrs to fix

                Method rebuildRecentChangesTablePass3 has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function rebuildRecentChangesTablePass3() {
                        global $wgLogRestrictions, $wgFilterLogTypes;
                
                        $dbw = $this->getDB( DB_PRIMARY );
                        $commentStore = $this->getServiceContainer()->getCommentStore();
                Severity: Major
                Found in maintenance/rebuildrecentchanges.php - About 3 hrs to fix

                  File MessagesId.php has 295 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /** Indonesian (Bahasa Indonesia)
                   *
                   * @file
                   * @ingroup Languages
                  Severity: Minor
                  Found in languages/messages/MessagesId.php - About 3 hrs to fix

                    File ApiQueryAllPages.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
                     *
                     * This program is free software; you can redistribute it and/or modify
                    Severity: Minor
                    Found in includes/api/ApiQueryAllPages.php - About 3 hrs to fix

                      File updateCollation.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * Find all rows in the categorylinks table whose collation is out-of-date
                       * (cl_collation != $wgCategoryCollation) and repopulate cl_sortkey
                       * using the page title and cl_sortkey_prefix.
                      Severity: Minor
                      Found in maintenance/updateCollation.php - About 3 hrs to fix

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

                            if ( item ) {
                                if ( this.isVisible() && item.constructor.static.highlightable ) {
                                    this.highlightItem( item );
                                } else {
                                    if ( this.screenReaderMode ) {
                        Severity: Major
                        Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 3 hrs to fix
                        resources/lib/ooui/oojs-ui-core.js on lines 7479..7489

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

                        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

                                plurals = {
                                    s: [
                                        'أقل من ثانية',
                                        'ثانية واحدة',
                                        ['ثانيتان', 'ثانيتين'],
                        Severity: Major
                        Found in resources/lib/moment/locale/ar-ly.js and 1 other location - About 3 hrs to fix
                        resources/lib/moment/locale/ar.js on lines 53..102

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

                        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

                                var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
                                    '<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click"' +
                                    ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
                                    (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>'));
                        Severity: Major
                        Found in resources/lib/jquery.ui/jquery.ui.datepicker.js and 1 other location - About 3 hrs to fix
                        resources/lib/jquery.ui/jquery.ui.datepicker.js on lines 1495..1498

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

                        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.OptionWidget.prototype.setPressed = function ( state ) {
                            if ( this.constructor.static.pressable ) {
                                this.pressed = !!state;
                                this.$element.toggleClass( 'oo-ui-optionWidget-pressed', state );
                                this.updateThemeClasses();
                        Severity: Major
                        Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 3 hrs to fix
                        resources/lib/ooui/oojs-ui-core.js on lines 7039..7046

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

                        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

                                plurals = {
                                    s: [
                                        'أقل من ثانية',
                                        'ثانية واحدة',
                                        ['ثانيتان', 'ثانيتين'],
                        Severity: Major
                        Found in resources/lib/moment/locale/ar.js and 1 other location - About 3 hrs to fix
                        resources/lib/moment/locale/ar-ly.js on lines 39..88

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

                        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

                                var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
                                    '<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click"' +
                                    ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
                                    (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>'));
                        Severity: Major
                        Found in resources/lib/jquery.ui/jquery.ui.datepicker.js and 1 other location - About 3 hrs to fix
                        resources/lib/jquery.ui/jquery.ui.datepicker.js on lines 1487..1490

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

                        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.OptionWidget.prototype.setHighlighted = function ( state ) {
                            if ( this.constructor.static.highlightable ) {
                                this.highlighted = !!state;
                                this.$element.toggleClass( 'oo-ui-optionWidget-highlighted', state );
                                this.updateThemeClasses();
                        Severity: Major
                        Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 3 hrs to fix
                        resources/lib/ooui/oojs-ui-core.js on lines 7058..7065

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

                        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 ( nextItem ) {
                                    if ( this.isVisible() && nextItem.constructor.static.highlightable ) {
                                        this.highlightItem( nextItem );
                                    } else {
                                        if ( this.screenReaderMode ) {
                        Severity: Major
                        Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 3 hrs to fix
                        resources/lib/ooui/oojs-ui-core.js on lines 7585..7595

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

                        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 initializeFilters has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        FilterGroup.prototype.initializeFilters = function ( filterDefinition, groupDefault ) {
                            let defaultParam;
                            const supersetMap = {},
                                model = this,
                                items = [];
                        Severity: Major
                        Found in resources/src/mediawiki.rcfilters/dm/FilterGroup.js - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language