wikimedia/mediawiki-core

View on GitHub

Showing 11,773 of 11,773 total issues

File apisandbox.js has 1648 lines of code (exceeds 250 allowed). Consider refactoring.
Open

( function () {
    'use strict';
    var ApiSandbox, Util, WidgetMethods, Validators,
        windowManager,
        formatDropdown,
Severity: Major
Found in resources/src/mediawiki.special.apisandbox/apisandbox.js - About 4 days to fix

    MediaWikiServices has 220 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class MediaWikiServices extends ServiceContainer {
        use NonSerializableTrait;
    
        /**
         * @var bool
    Severity: Major
    Found in includes/MediaWikiServices.php - About 4 days to fix

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

      ;(function (global, factory) {
         typeof exports === 'object' && typeof module !== 'undefined'
             && typeof require === 'function' ? factory(require('../moment')) :
         typeof define === 'function' && define.amd ? define(['../moment'], factory) :
         factory(global.moment)
      Severity: Major
      Found in resources/lib/moment/locale/me.js and 2 other locations - About 4 days to fix
      resources/lib/moment/locale/sr-cyrl.js on lines 5..126
      resources/lib/moment/locale/sr.js on lines 5..128

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

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

      ;(function (global, factory) {
         typeof exports === 'object' && typeof module !== 'undefined'
             && typeof require === 'function' ? factory(require('../moment')) :
         typeof define === 'function' && define.amd ? define(['../moment'], factory) :
         factory(global.moment)
      Severity: Major
      Found in resources/lib/moment/locale/sr.js and 2 other locations - About 4 days to fix
      resources/lib/moment/locale/me.js on lines 5..129
      resources/lib/moment/locale/sr-cyrl.js on lines 5..126

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

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

      ;(function (global, factory) {
         typeof exports === 'object' && typeof module !== 'undefined'
             && typeof require === 'function' ? factory(require('../moment')) :
         typeof define === 'function' && define.amd ? define(['../moment'], factory) :
         factory(global.moment)
      Severity: Major
      Found in resources/lib/moment/locale/sr-cyrl.js and 2 other locations - About 4 days to fix
      resources/lib/moment/locale/me.js on lines 5..129
      resources/lib/moment/locale/sr.js on lines 5..128

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

      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

      $specialPageAliases = [
          'Allmessages'               => [ 'Барлық_хабарлар' ],
          'Allpages'                  => [ 'Барлық_беттер' ],
          'Ancientpages'              => [ 'Ескі_беттер' ],
          'Block'                     => [ 'Жайды_бұғаттау', 'IP_бұғаттау' ],
      Severity: Major
      Found in languages/messages/MessagesKk_cyrl.php and 1 other location - About 4 days to fix
      languages/messages/MessagesKk_latn.php on lines 261..340

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

      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

      $specialPageAliases = [
          'Allmessages'               => [ 'Barlıq_xabarlar' ],
          'Allpages'                  => [ 'Barlıq_better' ],
          'Ancientpages'              => [ 'Eski_better' ],
          'Block'                     => [ 'Jaýdı_buğattaw', 'IP_buğattaw' ],
      Severity: Major
      Found in languages/messages/MessagesKk_latn.php and 1 other location - About 4 days to fix
      languages/messages/MessagesKk_cyrl.php on lines 271..350

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

      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

      Database has 206 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAwareInterface {
          /** @var CriticalSectionProvider|null */
          protected $csProvider;
          /** @var LoggerInterface */
          protected $logger;
      Severity: Major
      Found in includes/libs/rdbms/database/Database.php - About 4 days to fix

        File oojs-ui-windows.js has 1541 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
         * OOUI v0.49.1
         * https://www.mediawiki.org/wiki/OOUI
         *
         * Copyright 2011–2024 OOUI Team and other contributors.
        Severity: Major
        Found in resources/lib/ooui/oojs-ui-windows.js - About 4 days to fix

          Method makeFormattedData has 822 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function makeFormattedData( $tags ) {
                  $resolutionunit = !isset( $tags['ResolutionUnit'] ) || $tags['ResolutionUnit'] == 2 ? 2 : 3;
                  unset( $tags['ResolutionUnit'] );
          
                  // Ignore these complex values
          Severity: Major
          Found in includes/media/FormatMetadata.php - About 4 days to fix

            File DefaultPreferencesFactory.php has 1521 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: Major
            Found in includes/preferences/DefaultPreferencesFactory.php - About 4 days to fix

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

              ;(function (global, factory) {
                 typeof exports === 'object' && typeof module !== 'undefined'
                     && typeof require === 'function' ? factory(require('../moment')) :
                 typeof define === 'function' && define.amd ? define(['../moment'], factory) :
                 factory(global.moment)
              Severity: Major
              Found in resources/lib/moment/locale/es-do.js and 1 other location - About 4 days to fix
              resources/lib/moment/locale/es-us.js on lines 6..115

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

              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

              ;(function (global, factory) {
                 typeof exports === 'object' && typeof module !== 'undefined'
                     && typeof require === 'function' ? factory(require('../moment')) :
                 typeof define === 'function' && define.amd ? define(['../moment'], factory) :
                 factory(global.moment)
              Severity: Major
              Found in resources/lib/moment/locale/es-us.js and 1 other location - About 4 days to fix
              resources/lib/moment/locale/es-do.js on lines 4..113

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

              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 jquery.ui.datepicker.js has 1518 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*!
               * jQuery UI Datepicker 1.9.2
               * http://jqueryui.com
               *
               * Copyright 2012 jQuery Foundation and other contributors
              Severity: Major
              Found in resources/lib/jquery.ui/jquery.ui.datepicker.js - About 4 days to fix

                File SpecialPageFactory.php has 1509 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Factory for handling the special page list and generating SpecialPage objects.
                 *
                 * This program is free software; you can redistribute it and/or modify
                Severity: Major
                Found in includes/specialpage/SpecialPageFactory.php - About 4 days to fix

                  File LocalFile.php has 1498 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: Major
                  Found in includes/filerepo/file/LocalFile.php - About 3 days to fix

                    OutputPage has 199 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class OutputPage extends ContextSource {
                        use ProtectedHookAccessorTrait;
                    
                        /** Output CSP policies as headers */
                        public const CSP_HEADERS = 'headers';
                    Severity: Major
                    Found in includes/Output/OutputPage.php - About 3 days to fix

                      File Linker.php has 1475 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * Methods to make links and related items.
                       *
                       * This program is free software; you can redistribute it and/or modify
                      Severity: Major
                      Found in includes/linker/Linker.php - About 3 days to fix

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

                        ;(function (global, factory) {
                           typeof exports === 'object' && typeof module !== 'undefined'
                               && typeof require === 'function' ? factory(require('../moment')) :
                           typeof define === 'function' && define.amd ? define(['../moment'], factory) :
                           factory(global.moment)
                        Severity: Major
                        Found in resources/lib/moment/locale/zh-tw.js and 2 other locations - About 3 days to fix
                        resources/lib/moment/locale/zh-hk.js on lines 8..112
                        resources/lib/moment/locale/zh-mo.js on lines 7..111

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

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

                        ;(function (global, factory) {
                           typeof exports === 'object' && typeof module !== 'undefined'
                               && typeof require === 'function' ? factory(require('../moment')) :
                           typeof define === 'function' && define.amd ? define(['../moment'], factory) :
                           factory(global.moment)
                        Severity: Major
                        Found in resources/lib/moment/locale/zh-mo.js and 2 other locations - About 3 days to fix
                        resources/lib/moment/locale/zh-hk.js on lines 8..112
                        resources/lib/moment/locale/zh-tw.js on lines 6..110

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

                        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