wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

SessionManager has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

class SessionManager implements SessionManagerInterface {
    /** @var SessionManager|null */
    private static $instance = null;

    /** @var Session|null */
Severity: Minor
Found in includes/session/SessionManager.php - About 3 hrs to fix

    SvgHandler has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SvgHandler extends ImageHandler {
        public const SVG_METADATA_VERSION = 2;
    
        private const SVG_DEFAULT_RENDER_LANG = 'en';
    
    
    Severity: Minor
    Found in includes/media/SvgHandler.php - About 3 hrs to fix

      SpecialUndelete has 29 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class SpecialUndelete extends SpecialPage {
      
          /**
           * Limit of revisions (Page history) to display.
           * (If there are more items to display - "Load more" button will appear).
      Severity: Minor
      Found in includes/specials/SpecialUndelete.php - About 3 hrs to fix

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

        OO.ui.RadioInputWidget.static.gatherPreInfuseState = function ( node, config ) {
            const state = OO.ui.RadioInputWidget.super.static.gatherPreInfuseState( node, config );
            if ( config.$input ) {
                state.checked = config.$input.prop( 'checked' );
            }
        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 10415..10421

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

        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.CheckboxInputWidget.static.gatherPreInfuseState = function ( node, config ) {
            const state = OO.ui.CheckboxInputWidget.super.static.gatherPreInfuseState( node, config );
            if ( config.$input ) {
                state.checked = config.$input.prop( 'checked' );
            }
        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 10920..10926

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

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

        $namespaceAliases = [
            # Aliases to Cyrillic (crh-cyrl) namespaces
            "Медиа"                  => NS_MEDIA,
            "Махсус"                 => NS_SPECIAL,
            "Музакере"               => NS_TALK,
        Severity: Major
        Found in languages/messages/MessagesCrh_latn.php and 4 other locations - About 3 hrs to fix
        languages/messages/MessagesCrh_cyrl.php on lines 31..51
        languages/messages/MessagesKl.php on lines 35..54
        languages/messages/MessagesSr_ec.php on lines 56..75
        languages/messages/MessagesUk.php on lines 83..103

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

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

        $namespaceAliases = [
            'Спеціальні' => NS_SPECIAL,
            'Зображення' => NS_FILE,
            'Обговорення_зображення' => NS_FILE_TALK,
            'Обговорення_шаблона' => NS_TEMPLATE_TALK,
        Severity: Major
        Found in languages/messages/MessagesUk.php and 4 other locations - About 3 hrs to fix
        languages/messages/MessagesCrh_cyrl.php on lines 31..51
        languages/messages/MessagesCrh_latn.php on lines 29..49
        languages/messages/MessagesKl.php on lines 35..54
        languages/messages/MessagesSr_ec.php on lines 56..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 152.

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

        $namespaceAliases = [
            'Speciel' => NS_SPECIAL,
            'Diskussion' => NS_TALK,
            'Bruger' => NS_USER,
            'Brugerdiskussion' => NS_USER_TALK,
        Severity: Major
        Found in languages/messages/MessagesKl.php and 4 other locations - About 3 hrs to fix
        languages/messages/MessagesCrh_cyrl.php on lines 31..51
        languages/messages/MessagesCrh_latn.php on lines 29..49
        languages/messages/MessagesSr_ec.php on lines 56..75
        languages/messages/MessagesUk.php on lines 83..103

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

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

        $namespaceAliases = [
            # Aliases of Latin (crh-latn) namespaces
            "Media"                 => NS_MEDIA,
            "Mahsus"                => NS_SPECIAL,
            "Muzakere"              => NS_TALK,
        Severity: Major
        Found in languages/messages/MessagesCrh_cyrl.php and 4 other locations - About 3 hrs to fix
        languages/messages/MessagesCrh_latn.php on lines 29..49
        languages/messages/MessagesKl.php on lines 35..54
        languages/messages/MessagesSr_ec.php on lines 56..75
        languages/messages/MessagesUk.php on lines 83..103

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

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

        $namespaceAliases = [
            'Медија'                  => NS_MEDIA,
            'Специјално'              => NS_SPECIAL,
            'Сарадник'                => NS_USER,
            'Сурадник'                => NS_USER,
        Severity: Major
        Found in languages/messages/MessagesSr_ec.php and 4 other locations - About 3 hrs to fix
        languages/messages/MessagesCrh_cyrl.php on lines 31..51
        languages/messages/MessagesCrh_latn.php on lines 29..49
        languages/messages/MessagesKl.php on lines 35..54
        languages/messages/MessagesUk.php on lines 83..103

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

        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 ( !empty( $params['async'] ) ) { // deferred
                    $cmd = $this->makeMoveCommand( $fsSrcPath, $fsDstPath, $ignoreMissing );
                    $handler = function ( $errors, StatusValue $status, array $params, $cmd ) {
                        if ( $errors !== '' && !( $this->os === 'Windows' && $errors[0] === " " ) ) {
                            $status->fatal( 'backend-fail-move', $params['src'], $params['dst'] );
        Severity: Major
        Found in includes/libs/filebackend/FSFileBackend.php and 1 other location - About 3 hrs to fix
        includes/libs/filebackend/FSFileBackend.php on lines 359..395

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

        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 ( !empty( $params['async'] ) ) { // deferred
                    $cmd = $this->makeCopyCommand( $fsSrcPath, $fsDstPath, $ignoreMissing );
                    $handler = function ( $errors, StatusValue $status, array $params, $cmd ) {
                        if ( $errors !== '' && !( $this->os === 'Windows' && $errors[0] === " " ) ) {
                            $status->fatal( 'backend-fail-copy', $params['src'], $params['dst'] );
        Severity: Major
        Found in includes/libs/filebackend/FSFileBackend.php and 1 other location - About 3 hrs to fix
        includes/libs/filebackend/FSFileBackend.php on lines 423..444

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

        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 mw.widgets.TitleWidget.js has 312 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
         * MediaWiki Widgets - TitleWidget class.
         *
         * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
         * @license The MIT License (MIT); see LICENSE.txt
        Severity: Minor
        Found in resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js - About 3 hrs to fix

          File AbstractTemporaryPasswordPrimaryAuthenticationProvider.php has 312 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

            File ApiQueryAllLinks.php has 312 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/ApiQueryAllLinks.php - About 3 hrs to fix

              File MessagesKk_cyrl.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /** Kazakh (Cyrillic script) (қазақша (кирил))
               *
               * @file
               * @ingroup Languages
              Severity: Minor
              Found in languages/messages/MessagesKk_cyrl.php - About 3 hrs to fix

                File MessagesSah.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /** Sakha (Yakut, саха)
                 *
                 * @file
                 * @ingroup Languages
                Severity: Minor
                Found in languages/messages/MessagesSah.php - About 3 hrs to fix

                  Function MwRcfiltersUiFilterMenuHeaderWidget has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const FilterMenuHeaderWidget = function MwRcfiltersUiFilterMenuHeaderWidget( controller, model, config ) {
                      config = config || {};
                  
                      this.controller = controller;
                      this.model = model;
                  Severity: Major
                  Found in resources/src/mediawiki.rcfilters/ui/FilterMenuHeaderWidget.js - About 3 hrs to fix

                    Function TestReport has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      var TestReport = /*#__PURE__*/function () {
                        function TestReport(name, suite, options) {
                          _classCallCheck(this, TestReport);
                          this.name = name;
                          this.suiteName = suite.name;
                    Severity: Major
                    Found in resources/lib/qunitjs/qunit.js - About 3 hrs to fix

                      Method continueAccountLink has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function continueAccountLink( array $reqs ) {
                              $session = $this->request->getSession();
                              try {
                                  if ( !$this->canLinkAccounts() ) {
                                      // Caller should have called canLinkAccounts()
                      Severity: Major
                      Found in includes/auth/AuthManager.php - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language