WordPress/WordPress

View on GitHub

Showing 10,821 of 14,812 total issues

File H.php has 1431 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

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

    File option.php has 1427 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

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

          public function Analyze()
          {
              $info = &$this->getid3->info;
      
              // parse container
      Severity: Minor
      Found in wp-includes/ID3/module.audio-video.matroska.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

      Function editor_settings has a Cognitive Complexity of 184 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function editor_settings( $editor_id, $set ) {
              if ( empty( self::$first_init ) ) {
                  if ( is_admin() ) {
                      add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
                      add_action( 'admin_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 );
      Severity: Minor
      Found in wp-includes/class-wp-editor.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 media-template.php has 1416 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * WordPress media templates.
       *
       * @package WordPress
      Severity: Major
      Found in wp-includes/media-template.php - About 3 days to fix

        Function single_row has a Cognitive Complexity of 182 (exceeds 5 allowed). Consider refactoring.
        Open

            public function single_row( $item ) {
                global $status, $page, $s, $totals;
                static $plugin_id_attrs = array();
        
                list( $plugin_file, $plugin_data ) = $item;
        Severity: Minor
        Found in wp-admin/includes/class-wp-plugins-list-table.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 block-directory.js has 1391 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/block-directory.js - About 3 days to fix

          File format-library.js has 1360 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/format-library.js - About 3 days to fix

            Function mediaWidgets has 711 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            wp.mediaWidgets = ( function( $ ) {
                'use strict';
            
                var component = {};
            
            
            Severity: Major
            Found in wp-admin/js/widgets/media-widgets.js - About 3 days to fix

              Function jsonlint has a Cognitive Complexity of 174 (exceeds 5 allowed). Consider refactoring.
              Open

              var jsonlint = (function(){
              var parser = {trace: function trace() { },
              yy: {},
              symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
              terminals_: {2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},
              Severity: Minor
              Found in wp-includes/js/codemirror/jsonlint.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 blocks.php has 1340 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Functions related to registering and parsing blocks.
               *
               * @package WordPress
              Severity: Major
              Found in wp-includes/blocks.php - About 3 days to fix

                Method create_initial_post_types has 703 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function create_initial_post_types() {
                    WP_Post_Type::reset_default_labels();
                
                    register_post_type(
                        'post',
                Severity: Major
                Found in wp-includes/post.php - About 3 days to fix

                  File class-wp-debug-data.php has 1317 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * Class for providing debug data based on a users WordPress environment.
                   *
                   * @package WordPress
                  Severity: Major
                  Found in wp-admin/includes/class-wp-debug-data.php - About 3 days to fix

                    Function link has 690 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      File dashboard.php has 1311 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

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

                        Function ParseRIFF has a Cognitive Complexity of 168 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function ParseRIFF($startoffset, $maxoffset) {
                                $info = &$this->getid3->info;
                        
                                $RIFFchunk = array();
                                $FoundAllChunksWeNeed = false;
                        Severity: Minor
                        Found in wp-includes/ID3/module.audio-video.riff.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 pluggable.php has 1305 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /**
                         * These functions can be replaced via plugins. If plugins do not redefine these
                         * functions, then these will be used instead.
                         *
                        Severity: Major
                        Found in wp-includes/pluggable.php - About 3 days to fix

                          File theme.js has 1299 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /**
                           * @output wp-admin/js/theme.js
                           */
                          
                          /* global _wpThemeSettings, confirm, tb_position */
                          Severity: Major
                          Found in wp-admin/js/theme.js - About 3 days to fix

                            File backbone.js has 1288 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            //     Backbone.js 1.6.0
                            
                            //     (c) 2010-2024 Jeremy Ashkenas and DocumentCloud
                            //     Backbone may be freely distributed under the MIT license.
                            //     For all details and documentation:
                            Severity: Major
                            Found in wp-includes/js/backbone.js - About 3 days to fix

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

                              (function () {
                              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 3 days to fix
                                Severity
                                Category
                                Status
                                Source
                                Language