WordPress/WordPress

View on GitHub

Showing 10,370 of 14,330 total issues

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

/******/ (() => { // webpackBootstrap
/******/     "use strict";
/******/     var __webpack_modules__ = ({

/***/ 6689:
Severity: Major
Found in wp-includes/js/dist/core-data.js - About 1 wk to fix

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

    <?php
    /**
     * Main WordPress API
     *
     * @package WordPress
    Severity: Major
    Found in wp-includes/functions.php - About 1 wk to fix

      Function paste has 2316 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function ParseID3v2Frame has a Cognitive Complexity of 556 (exceeds 5 allowed). Consider refactoring.
        Open

            public function ParseID3v2Frame(&$parsedFrame) {
        
                // shortcuts
                $info = &$this->getid3->info;
                $id3v2_majorversion = $info['id3v2']['majorversion'];
        Severity: Minor
        Found in wp-includes/ID3/module.tag.id3v2.php - 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 class-wp-xmlrpc-server.php has 3831 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * XML-RPC protocol support for WordPress.
         *
         * @package WordPress
        Severity: Major
        Found in wp-includes/class-wp-xmlrpc-server.php - About 1 wk to fix

          File post.php has 3830 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Core Post API
           *
           * @package WordPress
          Severity: Major
          Found in wp-includes/post.php - About 1 wk to fix

            Function QuicktimeParseAtom has a Cognitive Complexity of 522 (exceeds 5 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: Minor
            Found in wp-includes/ID3/module.audio-video.quicktime.php - 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

            Function get_posts has a Cognitive Complexity of 522 (exceeds 5 allowed). Consider refactoring.
            Open

                public function get_posts() {
                    global $wpdb;
            
                    $this->parse_query();
            
            
            Severity: Minor
            Found in wp-includes/class-wp-query.php - 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 class-wp-customize-manager.php has 3719 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * WordPress Customize Manager classes
             *
             * @package WordPress
            Severity: Major
            Found in wp-includes/class-wp-customize-manager.php - About 1 wk to fix

              Function lists has 2057 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              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 1 wk to fix

                File ajax-actions.php has 3576 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Administration API: Core Ajax handlers
                 *
                 * @package WordPress
                Severity: Major
                Found in wp-admin/includes/ajax-actions.php - About 1 wk to fix

                  File mediaelement.js has 3230 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*!
                   * MediaElement.js
                   * http://www.mediaelementjs.com/
                   *
                   * Wrapper that mimics native HTML5 MediaElement (audio and video)
                  Severity: Major
                  Found in wp-includes/js/mediaelement/mediaelement.js - About 1 wk to fix

                    File edit-widgets.js has 3077 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/edit-widgets.js - About 1 wk to fix

                      File formatting.php has 3067 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * Main WordPress Formatting API.
                       *
                       * Handles many functions for formatting output.
                      Severity: Major
                      Found in wp-includes/formatting.php - About 1 wk to fix

                        Method get_enclosures has 1683 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function get_enclosures()
                            {
                                if (!isset($this->data['enclosures']))
                                {
                                    $this->data['enclosures'] = array();
                        Severity: Major
                        Found in wp-includes/SimplePie/Item.php - About 1 wk to fix

                          File class-pclzip.php has 2961 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          // --------------------------------------------------------------------------------
                          // PhpConcept Library - Zip Module 2.8.2
                          // --------------------------------------------------------------------------------
                          // License GNU/LGPL - Vincent Blavet - August 2009
                          Severity: Major
                          Found in wp-admin/includes/class-pclzip.php - About 1 wk to fix

                            File PHPMailer.php has 2926 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            
                            /**
                             * PHPMailer - PHP email creation and transport class.
                             * PHP Version 5.5.
                            Severity: Major
                            Found in wp-includes/PHPMailer/PHPMailer.php - About 1 wk to fix

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

                                  public function Analyze() {
                                      $info = &$this->getid3->info;
                              
                                      // initialize these values to an empty array, otherwise they default to NULL
                                      // and you can't append array values to a NULL value
                              Severity: Minor
                              Found in wp-includes/ID3/module.audio-video.riff.php - 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 compose.js has 2904 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

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

                                <?php
                                /**
                                 * WordPress API for media display.
                                 *
                                 * @package WordPress
                                Severity: Major
                                Found in wp-includes/media.php - About 1 wk to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language