wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Function toolbarModuleFilter has 138 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function toolbarModuleFilter(beginDetails) {
      var initialSelected = null;
      dropdownData = {
        options: beginDetails.modules.slice(),
        selectedMap: new StringMap(),
Severity: Major
Found in resources/lib/qunitjs/qunit.js - About 5 hrs to fix

    Function _create has 138 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _create: function() {
            var i, handleCount,
                o = this.options,
                existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
                handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
    Severity: Major
    Found in resources/lib/jquery.ui/jquery.ui.slider.js - About 5 hrs to fix

      Method imageHistoryLine has 138 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function imageHistoryLine( $iscur, $file, $formattedComment ) {
              $user = $this->getUser();
              $lang = $this->getLanguage();
              $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
              $timestamp = wfTimestamp( TS_MW, $file->getTimestamp() );
      Severity: Major
      Found in includes/page/ImageHistoryList.php - About 5 hrs to fix

        File RequestContext.php has 396 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/context/RequestContext.php - About 5 hrs to fix

          FSFileBackend has 41 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class FSFileBackend extends FileBackendStore {
              /** @var MapCacheLRU Cache for known prepared/usable directories */
              protected $usableDirCache;
          
              /** @var string|null Directory holding the container directories */
          Severity: Minor
          Found in includes/libs/filebackend/FSFileBackend.php - About 5 hrs to fix

            DatabaseBlock has 41 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class DatabaseBlock extends AbstractBlock {
                /** @var bool */
                private $auto;
            
                /** @var int|null */
            Severity: Minor
            Found in includes/block/DatabaseBlock.php - About 5 hrs to fix

              MessageCache has 41 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class MessageCache implements LoggerAwareInterface {
                  /**
                   * Options to be included in the ServiceOptions
                   */
                  public const CONSTRUCTOR_OPTIONS = [
              Severity: Minor
              Found in includes/language/MessageCache.php - About 5 hrs to fix

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

                    if ( previousPage ) {
                        previousPage.setActive( false );
                        // Blur anything focused if the next page doesn't have anything focusable.
                        // This is not needed if the next page has something focusable (because once it is
                        // focused this blur happens automatically). If the layout is non-continuous, this
                Severity: Major
                Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 5 hrs to fix
                resources/lib/ooui/oojs-ui-widgets.js on lines 2933..2951

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

                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

                                pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
                Severity: Major
                Found in resources/lib/jquery.ui/jquery.ui.sortable.js and 1 other location - About 5 hrs to fix
                resources/lib/jquery.ui/jquery.ui.sortable.js on lines 952..952

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

                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

                                pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
                Severity: Major
                Found in resources/lib/jquery.ui/jquery.ui.sortable.js and 1 other location - About 5 hrs to fix
                resources/lib/jquery.ui/jquery.ui.sortable.js on lines 955..955

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

                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 ( previousTabPanel ) {
                                previousTabPanel.setActive( false );
                                // Blur anything focused if the next tab panel doesn't have anything focusable.
                                // This is not needed if the next tab panel has something focusable (because once
                                // it is focused this blur happens automatically). If the layout is non-continuous,
                Severity: Major
                Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 5 hrs to fix
                resources/lib/ooui/oojs-ui-widgets.js on lines 2398..2415

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

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

                    _create: function() {
                        this.element.closest( "form" )
                            .off( "reset" + this.eventNamespace )
                            .on( "reset" + this.eventNamespace, formResetHandler );
                
                
                Severity: Major
                Found in resources/lib/jquery.ui/jquery.ui.button.js - About 5 hrs to fix

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

                      public function execute() {
                          $user = $this->getUser();
                  
                          if ( !$user->isRegistered() ) {
                              $this->dieWithError( 'watchlistanontext', 'notloggedin' );
                  Severity: Major
                  Found in includes/api/ApiSetNotificationTimestamp.php - About 5 hrs to fix

                    File Xml.php has 394 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * Methods to generate XML.
                     *
                     * This program is free software; you can redistribute it and/or modify
                    Severity: Minor
                    Found in includes/xml/Xml.php - About 5 hrs to fix

                      File SearchEngine.php has 394 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * Basic search engine
                       *
                       * This program is free software; you can redistribute it and/or modify
                      Severity: Minor
                      Found in includes/search/SearchEngine.php - About 5 hrs to fix

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

                            OO.ui.Element.static.computeNativeScrollLeft = function ( normalizedOffset, el ) {
                                // All browsers use the correct scroll type ('negative') on the root, so don't
                                // do any fixups when looking at the root element
                                const direction = isRoot( el ) ? 'ltr' : $( el ).css( 'direction' );
                        
                        
                        Severity: Major
                        Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 5 hrs to fix
                        resources/lib/ooui/oojs-ui-core.js on lines 1132..1149

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

                        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.Element.static.computeNormalizedScrollLeft = function ( nativeOffset, el ) {
                                // All browsers use the correct scroll type ('negative') on the root, so don't
                                // do any fixups when looking at the root element
                                const direction = isRoot( el ) ? 'ltr' : $( el ).css( 'direction' );
                        
                        
                        Severity: Major
                        Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 5 hrs to fix
                        resources/lib/ooui/oojs-ui-core.js on lines 1158..1175

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

                        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

                        Method showEditUserGroupsForm has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function showEditUserGroupsForm( $user, $groups, $groupMemberships ) {
                                $list = $membersList = $tempList = $tempMembersList = [];
                                foreach ( $groupMemberships as $ugm ) {
                                    $linkG = UserGroupMembership::getLinkHTML( $ugm, $this->getContext() );
                                    $linkM = UserGroupMembership::getLinkHTML( $ugm, $this->getContext(), $user->getName() );
                        Severity: Major
                        Found in includes/specials/SpecialUserRights.php - About 5 hrs to fix

                          Method doImport has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function doImport() {
                                  $isUpload = false;
                                  $request = $this->getRequest();
                                  $sourceName = $request->getVal( 'source' );
                                  $assignKnownUsers = $request->getCheck( 'assignKnownUsers' );
                          Severity: Major
                          Found in includes/specials/SpecialImport.php - About 5 hrs to fix

                            File MessagesSr_ec.php has 393 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /** Serbian (Cyrillic script) (српски (ћирилица))
                             *
                             * @file
                             * @ingroup Languages
                            Severity: Minor
                            Found in languages/messages/MessagesSr_ec.php - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language