WordPress/WordPress

View on GitHub

Showing 10,370 of 14,330 total issues

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

<?php
/**
 * WordPress Link Template Functions
 *
 * @package WordPress
Severity: Major
Found in wp-includes/link-template.php - About 5 days to fix

    Function getOnlyMPEGaudioInfo has a Cognitive Complexity of 260 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getOnlyMPEGaudioInfo($avdataoffset, $BitrateHistogram=false) {
            // looks for synch, decodes MPEG audio header
    
            $info = &$this->getid3->info;
    
    
    Severity: Minor
    Found in wp-includes/ID3/module.audio.mp3.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 13 has a Cognitive Complexity of 258 (exceeds 5 allowed). Consider refactoring.
    Open

    },{"16":16,"2":2,"26":26,"30":30}],13:[function(_dereq_,module,exports){
    'use strict';
    
    var _document = _dereq_(2);
    
    
    Severity: Minor
    Found in wp-includes/js/mediaelement/mediaelement-and-player.js - 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 encoding has 1060 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function encoding($charset)
        {
            // Normalization from UTS #22
            switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset)))
            {
    Severity: Major
    Found in wp-includes/SimplePie/Misc.php - About 5 days to fix

      Function Scanner has 1054 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var Scanner = (function () {
              function Scanner(code, handler) {
                  this.source = code;
                  this.errorHandler = handler;
                  this.trackComment = false;
      Severity: Major
      Found in wp-includes/js/codemirror/esprima.js - About 5 days to fix

        Function getDefaultCharMap has 1050 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var getDefaultCharMap = function () {
              return [
                [
                  '160',
                  'no-break space'
        Severity: Major
        Found in wp-includes/js/tinymce/plugins/charmap/plugin.js - About 5 days to fix

          Method get_posts has 1027 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function get_posts() {
                  global $wpdb;
          
                  $this->parse_query();
          
          
          Severity: Major
          Found in wp-includes/class-wp-query.php - About 5 days to fix

            File rest-api.php has 1823 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * REST API functions.
             *
             * @package WordPress
            Severity: Major
            Found in wp-includes/rest-api.php - About 4 days to fix

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

              <?php
              if ( ! class_exists( 'SimplePie', false ) ) :
              
              // Load classes we will need.
              require ABSPATH . WPINC . '/SimplePie/Misc.php';
              Severity: Major
              Found in wp-includes/class-simplepie.php - About 4 days to fix

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

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

                  File comment.php has 1794 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * Core Comment API
                   *
                   * @package WordPress
                  Severity: Major
                  Found in wp-includes/comment.php - About 4 days to fix

                    File Misc.php has 1777 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/Misc.php - About 4 days to fix

                      File module.tag.id3v2.php has 1773 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.tag.id3v2.php - About 4 days to fix

                        File datepicker.js has 1749 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /* eslint-disable max-len, camelcase */
                        /*!
                         * jQuery UI Datepicker 1.13.3
                         * https://jqueryui.com
                         *
                        Severity: Major
                        Found in wp-includes/js/jquery/ui/datepicker.js - About 4 days to fix

                          File module.audio-video.riff.php has 1729 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.riff.php - About 4 days to fix

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

                            <?php
                            /**
                             * WordPress database access abstraction class.
                             *
                             * Original code from {@link http://php.justinvincent.com Justin Vincent (justin@visunet.ie)}
                            Severity: Major
                            Found in wp-includes/class-wpdb.php - About 4 days to fix

                              Function decodeMPEGaudioHeader has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function decodeMPEGaudioHeader($offset, &$info, $recursivesearch=true, $ScanAsCBR=false, $FastMPEGheaderScan=false) {
                                      static $MPEGaudioVersionLookup;
                                      static $MPEGaudioLayerLookup;
                                      static $MPEGaudioBitrateLookup;
                                      static $MPEGaudioFrequencyLookup;
                              Severity: Minor
                              Found in wp-includes/ID3/module.audio.mp3.php - About 4 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 Analyze has 913 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function Analyze() {
                                      $info = &$this->getid3->info;
                              
                                      // Shortcuts
                                      $thisfile_audio = &$info['audio'];
                              Severity: Major
                              Found in wp-includes/ID3/module.audio-video.asf.php - About 4 days to fix

                                Function 6 has a Cognitive Complexity of 215 (exceeds 5 allowed). Consider refactoring.
                                Open

                                },{"18":18,"7":7,"9":9}],6:[function(_dereq_,module,exports){
                                'use strict';
                                
                                Object.defineProperty(exports, "__esModule", {
                                    value: true
                                Severity: Minor
                                Found in wp-includes/js/mediaelement/mediaelement.js - About 4 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 6 has a Cognitive Complexity of 215 (exceeds 5 allowed). Consider refactoring.
                                Open

                                },{"15":15,"27":27,"7":7}],6:[function(_dereq_,module,exports){
                                'use strict';
                                
                                Object.defineProperty(exports, "__esModule", {
                                    value: true
                                Severity: Minor
                                Found in wp-includes/js/mediaelement/mediaelement-and-player.js - About 4 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

                                Severity
                                Category
                                Status
                                Source
                                Language