wikimedia/mediawiki-core

View on GitHub

Showing 8,790 of 10,731 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 6014 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
           * OOUI v0.39.1
           * 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 4074 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 3951 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 544 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

                        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 3018 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 2782 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /*!
                             * OOUI v0.39.1
                             * 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 2757 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 2716 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

                                  Function Sizzle has 1459 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  (function( window ) {
                                  
                                  var i,
                                      support,
                                      Expr,
                                  Severity: Major
                                  Found in resources/lib/jquery/jquery.js - About 1 wk to fix

                                    File User.php has 2360 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    <?php
                                    /**
                                     * Implements the User class for the %MediaWiki software.
                                     *
                                     * This program is free software; you can redistribute it and/or modify
                                    Severity: Major
                                    Found in includes/user/User.php - About 6 days to fix

                                      File Title.php has 2311 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      <?php
                                      /**
                                       * Representation of a title within MediaWiki.
                                       *
                                       * See Title.md
                                      Severity: Major
                                      Found in includes/Title.php - About 6 days to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language