WordPress/WordPress

View on GitHub

Showing 10,393 of 14,522 total issues

Method wp_print_media_templates has 1279 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function wp_print_media_templates() {
    $class = 'media-modal wp-core-ui';

    $alt_text_description = sprintf(
        /* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */
Severity: Major
Found in wp-includes/media-template.php - About 6 days to fix

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

    <?php
    
    if (class_exists('ParagonIE_Sodium_Core32_Curve25519', false)) {
        return;
    }
    Severity: Major
    Found in wp-includes/sodium_compat/src/Core32/Curve25519.php - About 6 days to fix

      Function media has 1266 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var media = (function () {
          'use strict';
      
          var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
      
      
      Severity: Major
      Found in wp-includes/js/tinymce/plugins/media/plugin.js - About 6 days to fix

        Function charmap has 1256 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var charmap = (function () {
            'use strict';
        
            var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
        
        
        Severity: Major
        Found in wp-includes/js/tinymce/plugins/charmap/plugin.js - About 6 days to fix

          File customize-nav-menus.js has 2252 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * @output wp-admin/js/customize-nav-menus.js
           */
          
          /* global _wpCustomizeNavMenusSettings, wpNavMenu, console */
          Severity: Major
          Found in wp-admin/js/customize-nav-menus.js - About 6 days to fix

            File class-wp-theme-json.php has 2209 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * WP_Theme_JSON class
             *
             * @package WordPress
            Severity: Major
            Found in wp-includes/class-wp-theme-json.php - About 6 days to fix

              File data.js has 2197 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /******/ (() => { // webpackBootstrap
              /******/     "use strict";
              /******/     var __webpack_modules__ = ({
              
              /***/ 66:
              Severity: Major
              Found in wp-includes/js/dist/data.js - About 6 days to fix

                File upgrade.php has 2194 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * WordPress Upgrade API
                 *
                 * Most of the functions are pluggable and can be overwritten.
                Severity: Major
                Found in wp-admin/includes/upgrade.php - About 6 days to fix

                  File user.php has 2181 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * Core User API
                   *
                   * @package WordPress
                  Severity: Major
                  Found in wp-includes/user.php - About 6 days to fix

                    File taxonomy.php has 2177 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * Core Taxonomy API
                     *
                     * @package WordPress
                    Severity: Major
                    Found in wp-includes/taxonomy.php - About 6 days to fix

                      Function Analyze has a Cognitive Complexity of 289 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function Analyze() {
                              $info = &$this->getid3->info;
                      
                              // Shortcuts
                              $thisfile_audio = &$info['audio'];
                      Severity: Minor
                      Found in wp-includes/ID3/module.audio-video.asf.php - About 5 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

                      Function image has 1174 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var image = (function (domGlobals) {
                          'use strict';
                      
                          var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
                      
                      
                      Severity: Major
                      Found in wp-includes/js/tinymce/plugins/image/plugin.js - About 5 days to fix

                        File customize-widgets.js has 2118 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /******/ (() => { // webpackBootstrap
                        /******/     var __webpack_modules__ = ({
                        
                        /***/ 5755:
                        /***/ ((module, exports) => {
                        Severity: Major
                        Found in wp-includes/js/dist/customize-widgets.js - About 5 days to fix

                          File updates.js has 2088 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /**
                           * Functions for ajaxified updates, deletions and installs inside the WordPress admin.
                           *
                           * @version 4.2.0
                           * @output wp-admin/js/updates.js
                          Severity: Major
                          Found in wp-admin/js/updates.js - About 5 days to fix

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

                            (function () {
                            var lists = (function (domGlobals) {
                                'use strict';
                            
                                var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
                            Severity: Major
                            Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 5 days to fix

                              File class-wp-rest-posts-controller.php has 2052 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /**
                               * REST API: WP_REST_Posts_Controller class
                               *
                               * @package WordPress
                              Severity: Major
                              Found in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php - About 5 days to fix

                                Method debug_data has 1122 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public static function debug_data() {
                                        global $wpdb, $_wp_theme_features;
                                
                                        // Save few function calls.
                                        $upload_dir             = wp_upload_dir();
                                Severity: Major
                                Found in wp-admin/includes/class-wp-debug-data.php - About 5 days to fix

                                  File script-loader.php has 2007 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  <?php
                                  /**
                                   * WordPress scripts and styles default loader.
                                   *
                                   * Several constants are used to manage the loading, concatenating and compression of scripts and CSS:
                                  Severity: Major
                                  Found in wp-includes/script-loader.php - About 5 days to fix

                                    Function Analyze has a Cognitive Complexity of 268 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function Analyze() {
                                            $info = &$this->getid3->info;
                                    
                                            ///AH
                                            $info['ac3']['raw']['bsi'] = array();
                                    Severity: Minor
                                    Found in wp-includes/ID3/module.audio.ac3.php - About 5 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

                                    Method ParseID3v2Frame has 1101 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function ParseID3v2Frame(&$parsedFrame) {
                                    
                                            // shortcuts
                                            $info = &$this->getid3->info;
                                            $id3v2_majorversion = $info['id3v2']['majorversion'];
                                    Severity: Major
                                    Found in wp-includes/ID3/module.tag.id3v2.php - About 5 days to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language