WordPress/WordPress

View on GitHub

Showing 10,393 of 14,522 total issues

File commands.js has 2846 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/******/ (() => { // webpackBootstrap
/******/     var __webpack_modules__ = ({

/***/ 5755:
/***/ ((module, exports) => {
Severity: Major
Found in wp-includes/js/dist/commands.js - About 1 wk to fix

    File compose.js has 2841 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /******/ (() => { // webpackBootstrap
    /******/     var __webpack_modules__ = ({
    
    /***/ 6689:
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    Severity: Major
    Found in wp-includes/js/dist/compose.js - About 1 wk to fix

      Method QuicktimeParseAtom has 1581 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {
              // http://developer.apple.com/techpubs/quicktime/qtdevdocs/APIREF/INDEX/atomalphaindex.htm
              // https://code.google.com/p/mp4v2/wiki/iTunesMetadata
      
              $info = &$this->getid3->info;
      Severity: Major
      Found in wp-includes/ID3/module.audio-video.quicktime.php - About 1 wk to fix

        Function 16 has 1513 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{}],16:[function(_dereq_,module,exports){
        'use strict';
        
        Object.defineProperty(exports, "__esModule", {
            value: true
        Severity: Major
        Found in wp-includes/js/mediaelement/mediaelement-and-player.js - About 1 wk to fix

          File Curve25519.php has 2654 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          if (class_exists('ParagonIE_Sodium_Core_Curve25519', false)) {
              return;
          }
          Severity: Major
          Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 1 wk to fix

            Function 6 has 1491 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            },{"../util/SyntaxUnit":26,"./Parser":6}],6:[function(require,module,exports){
            "use strict";
            
            module.exports = Parser;
            
            
            Severity: Major
            Found in wp-includes/js/codemirror/csslint.js - About 1 wk to fix

              Function prototype has 1458 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Parser.prototype = function() {
              
                  var proto = new EventTarget(),  //new prototype
                      prop,
                      additions =  {
              Severity: Major
              Found in wp-includes/js/codemirror/csslint.js - About 1 wk to fix

                File class-wp-query.php has 2554 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Query API: WP_Query class
                 *
                 * @package WordPress
                Severity: Major
                Found in wp-includes/class-wp-query.php - About 1 wk to fix

                  Function MediaElementPlayer has 1420 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var MediaElementPlayer = function () {
                      function MediaElementPlayer(node, o) {
                          _classCallCheck(this, MediaElementPlayer);
                  
                          var t = this,
                  Severity: Major
                  Found in wp-includes/js/mediaelement/mediaelement-and-player.js - About 1 wk to fix

                    File deprecated.php has 2494 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * Deprecated functions from past WordPress versions. You shouldn't use these
                     * functions and look for the alternatives instead. The functions will be
                     * removed in a later version.
                    Severity: Major
                    Found in wp-includes/deprecated.php - About 6 days to fix

                      File general-template.php has 2476 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * General template tags that can go anywhere in a template.
                       *
                       * @package WordPress
                      Severity: Major
                      Found in wp-includes/general-template.php - About 6 days to fix

                        Function redirect_canonical has a Cognitive Complexity of 334 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function redirect_canonical( $requested_url = null, $do_redirect = true ) {
                            global $wp_rewrite, $is_IIS, $wp_query, $wpdb, $wp;
                        
                            if ( isset( $_SERVER['REQUEST_METHOD'] ) && ! in_array( strtoupper( $_SERVER['REQUEST_METHOD'] ), array( 'GET', 'HEAD' ), true ) ) {
                                return;
                        Severity: Minor
                        Found in wp-includes/canonical.php - About 6 days 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 module.audio-video.quicktime.php has 2439 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        /////////////////////////////////////////////////////////////////
                        /// getID3() by James Heinrich <info@getid3.org>               //
                        //  available at https://github.com/JamesHeinrich/getID3       //
                        Severity: Major
                        Found in wp-includes/ID3/module.audio-video.quicktime.php - About 6 days to fix

                          File theme.php has 2426 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /**
                           * Theme, template, and stylesheet functions.
                           *
                           * @package WordPress
                          Severity: Major
                          Found in wp-includes/theme.php - About 6 days to fix

                            File Item.php has 2388 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /**
                             * SimplePie
                             *
                             * A PHP-Based RSS and Atom Feed Framework.
                            Severity: Major
                            Found in wp-includes/SimplePie/Item.php - About 6 days to fix

                              File class-wp-site-health.php has 2352 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /**
                               * Class for looking up a site's health based on a user's WordPress environment.
                               *
                               * @package WordPress
                              Severity: Major
                              Found in wp-admin/includes/class-wp-site-health.php - About 6 days to fix

                                File media.php has 2344 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                /**
                                 * WordPress Administration Media API.
                                 *
                                 * @package WordPress
                                Severity: Major
                                Found in wp-admin/includes/media.php - About 6 days to fix

                                  File plugin.js has 2321 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  (function () {
                                  var paste = (function (domGlobals) {
                                      'use strict';
                                  
                                      var Cell = function (initial) {
                                  Severity: Major
                                  Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 6 days to fix

                                    Function parseEBML has a Cognitive Complexity of 312 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        private function parseEBML(&$info) {
                                            // http://www.matroska.org/technical/specs/index.html#EBMLBasics
                                            $this->current_offset = $info['avdataoffset'];
                                    
                                            while ($this->getEBMLelement($top_element, $info['avdataend'])) {
                                    Severity: Minor
                                    Found in wp-includes/ID3/module.audio-video.matroska.php - About 6 days 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 Compat.php has 2301 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    <?php
                                    
                                    /**
                                     * Libsodium compatibility layer
                                     *
                                    Severity: Major
                                    Found in wp-includes/sodium_compat/src/Compat.php - About 6 days to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language