wikimedia/mediawiki-core

View on GitHub

Showing 9,426 of 11,461 total issues

File ZhConversion.php has 19848 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 codex.js has 7385 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var __defProp = Object.defineProperty;
      var __defProps = Object.defineProperties;
      var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
      var __getOwnPropSymbols = Object.getOwnPropertySymbols;
      var __hasOwnProp = Object.prototype.hasOwnProperty;
      Severity: Major
      Found in resources/lib/codex/codex.js - About 3 wks to fix

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

        /*!
         * jQuery JavaScript Library v3.7.1
         * https://jquery.com/
         *
         * Copyright OpenJS Foundation and other contributors
        Severity: Major
        Found in resources/lib/jquery/jquery.js - About 2 wks to fix

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

          /*!
           * OOUI v0.49.2
           * https://www.mediawiki.org/wiki/OOUI
           *
           * Copyright 2011–2024 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 5437 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*!
             * QUnit 2.20.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

                  File MainConfigSchema.php has 4115 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * This file contains schema declarations for all configuration variables
                   * known to MediaWiki core.
                   *
                  Severity: Major
                  Found in includes/MainConfigSchema.php - About 1 wk to fix

                    File Parser.php has 4067 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 4035 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 527 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 config-schema.php has 3422 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          // This file is automatically generated using maintenance/generateConfigSchema.php.
                          // Do not modify this file manually, edit includes/MainConfigSchema.php instead.
                          // phpcs:disable Generic.Files.LineLength
                          return [
                          Severity: Major
                          Found in includes/config-schema.php - About 1 wk to fix

                            File autoload.php has 3421 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            // This file is generated by maintenance/generateLocalAutoload.php, do not adjust manually
                            // phpcs:disable Generic.Files.LineLength
                            global $wgAutoloadLocalClasses;
                            
                            
                            Severity: Major
                            Found in autoload.php - About 1 wk to fix

                              Function Pinia has a Cognitive Complexity of 464 (exceeds 5 allowed). Consider refactoring.
                              Open

                              var Pinia = (function (exports, vueDemi) {
                                'use strict';
                              
                                /**
                                 * setActivePinia must be called to handle SSR at the top of functions like
                              Severity: Minor
                              Found in resources/lib/pinia/pinia.iife.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 Resources.php has 3154 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 EditPage.php has 3015 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/editpage/EditPage.php - About 1 wk to fix

                                  Function Pinia has 1684 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  var Pinia = (function (exports, vueDemi) {
                                    'use strict';
                                  
                                    /**
                                     * setActivePinia must be called to handle SSR at the top of functions like
                                  Severity: Major
                                  Found in resources/lib/pinia/pinia.iife.js - About 1 wk to fix

                                    File Language.php has 2559 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/language/Language.php - About 1 wk to fix

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

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