wikimedia/mediawiki-core

View on GitHub

Showing 12,280 of 12,280 total issues

File ZhConversion.php has 20985 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 includes/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 vue.common.prod.unminified.js has 7890 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

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

          /*!
           * jQuery JavaScript Library v3.6.0
           * 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 6178 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

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

              /*!
               * QUnit 2.16.0
               * https://qunitjs.com/
               *
               * Copyright OpenJS Foundation and other contributors
              Severity: Major
              Found in resources/lib/qunitjs/qunit.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

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

                    /* harmony default export */ var TypeaheadSearchvue_type_script_lang_ts_ = (external_vue_default.a.extend({
                        name: 'WvuiTypeaheadSearch',
                        components: { WvuiTypeaheadSuggestion: TypeaheadSuggestion, WvuiButton: Button, WvuiInput: Input, WvuiIcon: Icon },
                        // Pass all attributes to input
                        inheritAttrs: false,
                    Severity: Major
                    Found in resources/lib/wvui/wvui-search.commonjs2.js and 1 other location - About 1 wk to fix
                    resources/lib/wvui/wvui.commonjs2.js on lines 4566..4901

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

                    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

                    /* harmony default export */ var TypeaheadSearchvue_type_script_lang_ts_ = (external_vue_default.a.extend({
                        name: 'WvuiTypeaheadSearch',
                        components: { WvuiTypeaheadSuggestion: TypeaheadSuggestion, WvuiButton: Button, WvuiInput: Input, WvuiIcon: Icon },
                        // Pass all attributes to input
                        inheritAttrs: false,
                    Severity: Major
                    Found in resources/lib/wvui/wvui.commonjs2.js and 1 other location - About 1 wk to fix
                    resources/lib/wvui/wvui-search.commonjs2.js on lines 1751..2086

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

                    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 Parser.php has 3968 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

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

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

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

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

                          File Database.php has 3629 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

                            File wvui.commonjs2.js has 3524 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            module.exports =
                            /******/ (function(modules) { // webpackBootstrap
                            /******/     // The module cache
                            /******/     var installedModules = {};
                            /******/
                            Severity: Major
                            Found in resources/lib/wvui/wvui.commonjs2.js - 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 includes/languages/LanguageKk_cyrl.php and 2 other locations - About 1 wk to fix
                              includes/languages/LanguageKk_cyrl.php on lines 302..497
                              includes/languages/LanguageKk_cyrl.php on lines 534..729

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

                              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 includes/languages/LanguageKk_cyrl.php and 2 other locations - About 1 wk to fix
                              includes/languages/LanguageKk_cyrl.php on lines 70..265
                              includes/languages/LanguageKk_cyrl.php on lines 534..729

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

                              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 includes/languages/LanguageKk_cyrl.php and 2 other locations - About 1 wk to fix
                              includes/languages/LanguageKk_cyrl.php on lines 70..265
                              includes/languages/LanguageKk_cyrl.php on lines 302..497

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

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

                              Severity
                              Category
                              Status
                              Source
                              Language