wikimedia/mediawiki-core

View on GitHub

Showing 10,690 of 10,690 total issues

File ZhConversion.php has 20772 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Simplified / Traditional Chinese conversion tables
 *
 * Automatically generated using code and data in maintenance/language/zhtable/
Severity: Major
Found in languages/data/ZhConversion.php - About 2 mos to fix

    File first-letters-root.php has 14746 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    // File created by generateCollationData.php
    return [
        0 => 'ـ',
        1 => ' ',
    Severity: Major
    Found in includes/collation/data/first-letters-root.php - About 1 mo to fix

      File vue.common.dev.js has 9311 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*!
       * Vue.js v2.6.11
       * (c) 2014-2019 Evan You
       * Released under the MIT License.
       */
      Severity: Major
      Found in resources/lib/vue/vue.common.dev.js - About 3 wks to fix

        File jquery.js has 6796 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
         * jQuery JavaScript Library v3.4.1
         * https://jquery.com/
         *
         * Includes Sizzle.js
        Severity: Major
        Found in resources/lib/jquery/jquery.js - About 2 wks to fix

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

          /*!
           * OOUI v0.39.0
           * https://www.mediawiki.org/wiki/OOUI
           *
           * Copyright 2011–2020 OOUI Team and other contributors.
          Severity: Major
          Found in resources/lib/ooui/oojs-ui-core.js - About 2 wks to fix

            File sinon.js has 4909 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * Sinon.JS 1.17.7, 2017/02/15
             *
             * @author Christian Johansen (christian@cjohansen.no)
             * @author Contributors: https://github.com/cjohansen/Sinon.JS/blob/master/AUTHORS
            Severity: Major
            Found in resources/lib/sinonjs/sinon.js - About 2 wks to fix

              File moment.js has 4564 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              //! moment.js
              //! version : 2.25.2
              //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
              //! license : MIT
              //! momentjs.com
              Severity: Major
              Found in resources/lib/moment/moment.js - About 1 wk to fix

                File qunit.js has 4276 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*!
                 * QUnit 2.10.0
                 * https://qunitjs.com/
                 *
                 * Copyright jQuery Foundation and other contributors
                Severity: Major
                Found in resources/lib/qunitjs/qunit.js - About 1 wk to fix

                  File HookRunner.php has 4043 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  namespace MediaWiki\HookContainer;
                  
                  use Config;
                  Severity: Major
                  Found in includes/HookContainer/HookRunner.php - About 1 wk to fix

                    File Parser.php has 3930 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * PHP parser that converts wiki markup to HTML.
                     *
                     * This program is free software; you can redistribute it and/or modify
                    Severity: Major
                    Found in includes/parser/Parser.php - About 1 wk to fix

                      HookRunner has 540 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class HookRunner implements
                          \MediaWiki\Auth\Hook\AuthManagerLoginAuthenticateAuditHook,
                          \MediaWiki\Auth\Hook\ExemptFromAccountCreationThrottleHook,
                          \MediaWiki\Auth\Hook\LocalUserCreatedHook,
                          \MediaWiki\Auth\Hook\ResetPasswordExpirationHook,
                      Severity: Major
                      Found in includes/HookContainer/HookRunner.php - About 1 wk to fix

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

                                switch ( $case ) {
                                    case "dc1":
                                    case "genitive": # ilik
                                        if ( in_array( $wordEnding, $Consonants ) ) {
                                            if ( in_array( $wordLastVowel, $frontVowels ) ) {
                        Severity: Major
                        Found in languages/classes/LanguageKk_cyrl.php and 2 other locations - About 1 wk to fix
                        languages/classes/LanguageKk_cyrl.php on lines 69..264
                        languages/classes/LanguageKk_cyrl.php on lines 533..728

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

                        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

                                switch ( $case ) {
                                    case "dc1":
                                    case "genitive": # ilik
                                        if ( in_array( $wordEnding, $Consonants ) ) {
                                            if ( in_array( $wordLastVowel, $frontVowels ) ) {
                        Severity: Major
                        Found in languages/classes/LanguageKk_cyrl.php and 2 other locations - About 1 wk to fix
                        languages/classes/LanguageKk_cyrl.php on lines 301..496
                        languages/classes/LanguageKk_cyrl.php on lines 533..728

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

                        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

                                switch ( $case ) {
                                    case "dc1":
                                    case "genitive": # ilik
                                        if ( in_array( $wordEnding, $Consonants ) ) {
                                            if ( in_array( $wordLastVowel, $frontVowels ) ) {
                        Severity: Major
                        Found in languages/classes/LanguageKk_cyrl.php and 2 other locations - About 1 wk to fix
                        languages/classes/LanguageKk_cyrl.php on lines 69..264
                        languages/classes/LanguageKk_cyrl.php on lines 301..496

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

                        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 Database.php has 3307 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /**
                         * @defgroup Database Database
                         *
                         * This file deals with database interface functions
                        Severity: Major
                        Found in includes/libs/rdbms/database/Database.php - About 1 wk to fix

                          Function createPatchFunction has a Cognitive Complexity of 429 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function createPatchFunction (backend) {
                            var i, j;
                            var cbs = {};
                          
                            var modules = backend.modules;
                          Severity: Minor
                          Found in resources/lib/vue/vue.common.dev.js - About 1 wk to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          File EditPage.php has 3044 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /**
                           * User interface for page editing.
                           *
                           * This program is free software; you can redistribute it and/or modify
                          Severity: Major
                          Found in includes/EditPage.php - About 1 wk to fix

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

                            /*!
                             * OOUI v0.39.0
                             * https://www.mediawiki.org/wiki/OOUI
                             *
                             * Copyright 2011–2020 OOUI Team and other contributors.
                            Severity: Major
                            Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 wk to fix

                              File Resources.php has 2761 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /**
                               * Definition of core ResourceLoader modules.
                               *
                               * This program is free software; you can redistribute it and/or modify
                              Severity: Major
                              Found in resources/Resources.php - About 1 wk to fix

                                File Language.php has 2699 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 languages/Language.php - About 1 wk to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language