WordPress/WordPress

View on GitHub

Showing 10,370 of 14,330 total issues

File plugin.php has 1260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

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

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

      Function 13 has 650 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{"16":16,"2":2,"26":26,"30":30}],13:[function(_dereq_,module,exports){
      'use strict';
      
      var _document = _dereq_(2);
      
      
      Severity: Major
      Found in wp-includes/js/mediaelement/mediaelement-and-player.js - About 3 days to fix

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

            public function Analyze() {
                $info = &$this->getid3->info;
        
                //    Overall tag structure:
                //        +-----------------------------+
        Severity: Minor
        Found in wp-includes/ID3/module.tag.id3v2.php - About 3 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 update-core.php has 1241 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * WordPress core upgrade functionality.
         *
         * @package WordPress
        Severity: Major
        Found in wp-admin/includes/update-core.php - About 3 days to fix

          File ms-functions.php has 1238 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Multisite WordPress API
           *
           * @package WordPress
          Severity: Major
          Found in wp-includes/ms-functions.php - About 3 days to fix

            Consider simplifying this complex logical expression.
            Open

                    if (isset($parsedFrame['datalength']) && ($parsedFrame['datalength'] == 0)) {
            
                        $warning = 'Frame "'.$parsedFrame['frame_name'].'" at offset '.$parsedFrame['dataoffset'].' has no data portion';
                        switch ($parsedFrame['frame_name']) {
                            case 'WCOM':
            Severity: Critical
            Found in wp-includes/ID3/module.tag.id3v2.php - About 3 days to fix

              Function themePluginEditor has a Cognitive Complexity of 157 (exceeds 5 allowed). Consider refactoring.
              Open

              wp.themePluginEditor = (function( $ ) {
                  'use strict';
                  var component, TreeLinks,
                      __ = wp.i18n.__, _n = wp.i18n._n, sprintf = wp.i18n.sprintf;
              
              
              Severity: Minor
              Found in wp-admin/js/theme-plugin-editor.js - About 3 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 class-wp-posts-list-table.php has 1229 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * List Table API: WP_Posts_List_Table class
               *
               * @package WordPress
              Severity: Major
              Found in wp-admin/includes/class-wp-posts-list-table.php - About 3 days to fix

                Function mediaWidgets has a Cognitive Complexity of 155 (exceeds 5 allowed). Consider refactoring.
                Open

                wp.mediaWidgets = ( function( $ ) {
                    'use strict';
                
                    var component = {};
                
                
                Severity: Minor
                Found in wp-admin/js/widgets/media-widgets.js - About 3 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 core.js has 1212 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*! jQuery UI - v1.13.3 - 2024-04-26
                * https://jqueryui.com
                * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
                * Copyright jQuery Foundation and other contributors; Licensed MIT */
                ( function( factory ) {
                Severity: Major
                Found in wp-includes/js/jquery/ui/core.js - About 3 days to fix

                  Function wp_mail has a Cognitive Complexity of 154 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
                          // Compact the input, apply the filters, and extract them back out.
                  
                          /**
                           * Filters the wp_mail() arguments.
                  Severity: Minor
                  Found in wp-includes/pluggable.php - About 3 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 widgets.js has 1197 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /******/ (() => { // webpackBootstrap
                  /******/     "use strict";
                  /******/     // The require scope
                  /******/     var __webpack_require__ = {};
                  /******/     
                  Severity: Major
                  Found in wp-includes/js/dist/widgets.js - About 3 days to fix

                    Function themePluginEditor has 618 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    wp.themePluginEditor = (function( $ ) {
                        'use strict';
                        var component, TreeLinks,
                            __ = wp.i18n.__, _n = wp.i18n._n, sprintf = wp.i18n.sprintf;
                    
                    
                    Severity: Major
                    Found in wp-admin/js/theme-plugin-editor.js - About 3 days to fix

                      File class-wp-html-tag-processor.php has 1194 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * HTML API: WP_HTML_Tag_Processor class
                       *
                       * Scans through an HTML document to find specific tags, then
                      Severity: Major
                      Found in wp-includes/html-api/class-wp-html-tag-processor.php - About 3 days to fix

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

                        <?php
                        /**
                         * Facilitates adding of the WordPress editor as used on the Write and Edit screens.
                         *
                         * @package WordPress
                        Severity: Major
                        Found in wp-includes/class-wp-editor.php - About 3 days to fix

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

                          (function () {
                          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 3 days to fix

                            Function CopyTagsToComments has a Cognitive Complexity of 149 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function CopyTagsToComments(&$ThisFileInfo, $option_tags_html=true) {
                                    // Copy all entries from ['tags'] into common ['comments']
                                    if (!empty($ThisFileInfo['tags'])) {
                            
                                        // Some tag types can only support limited character sets and may contain data in non-standard encoding (usually ID3v1)
                            Severity: Minor
                            Found in wp-includes/ID3/getid3.lib.php - About 3 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 common.js has 1177 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /**
                             * @output wp-admin/js/common.js
                             */
                            
                            /* global setUserSetting, ajaxurl, alert, confirm, pagenow */
                            Severity: Major
                            Found in wp-admin/js/common.js - About 3 days to fix

                              Method register_controls has 606 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function register_controls() {
                              
                                      /* Themes (controls are loaded via ajax) */
                              
                                      $this->add_panel(
                              Severity: Major
                              Found in wp-includes/class-wp-customize-manager.php - About 3 days to fix
                                Severity
                                Category
                                Status
                                Source
                                Language