Showing 133 of 2,608 total issues
Function save_post
has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring. Open
public function save_post( $post_id, $post ) {
// Skip revisions and autosaves.
if ( wp_is_post_revision( $post_id ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) {
return;
}
- Read upRead up
- Create a ticketCreate a ticket
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 mesh_section_background
has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring. Open
function mesh_section_background( $post_id = 0, $echo = true, $size_large = 'large', $size_medium = 'large', $size_xlarge = 'large', $size_small = 'small' ) {
global $post;
if ( empty( $post_id ) ) {
- Read upRead up
- Create a ticketCreate a ticket
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.mesh.php
has 748 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Meat of most of Mesh Functionality
*
* @since 1.0
- Create a ticketCreate a ticket
File admin-mesh-core.js
has 651 lines of code (exceeds 250 allowed). Consider refactoring. Open
var mesh = mesh || {};
mesh.integrations = mesh.integrations || {}; // @since 1.2 store integrations.
mesh.admin = function ($) {
- Create a ticketCreate a ticket
Method save_post
has 257 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save_post( $post_id, $post ) {
// Skip revisions and autosaves.
if ( wp_is_post_revision( $post_id ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) {
return;
}
- Create a ticketCreate a ticket
File utilities.php
has 503 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file includes useful utility / middle man methods used within Mesh
* or by developers looking for more advanced implementations of Mesh
*
- Create a ticketCreate a ticket
File admin-mesh-blocks.js
has 475 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Controls Block Administration
*
* @since 0.4.1
*/
- Create a ticketCreate a ticket
Method settings_init
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function settings_init() {
register_setting( self::$settings_page, 'mesh_settings' );
register_setting( self::$settings_page, 'mesh_post_types', array( 'Mesh_Settings', 'validate_mesh_post_types' ) );
- Create a ticketCreate a ticket
Method mesh_section_controls
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mesh_section_controls( $section, $blocks, $visible = false ) {
$controls = array(
'visible_options' => array(
'template' => array(
- Create a ticketCreate a ticket
Function exports
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
// Load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
- Create a ticketCreate a ticket
Method mesh_block_controls
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mesh_block_controls( $block, $section_blocks ) {
$controls = array(
'css-class' => array(
'label' => esc_html__( 'CSS Class', 'mesh' ),
- Create a ticketCreate a ticket
Function mesh_block_controls
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function mesh_block_controls( $block, $section_blocks ) {
$controls = array(
'css-class' => array(
'label' => esc_html__( 'CSS Class', 'mesh' ),
- Read upRead up
- Create a ticketCreate a ticket
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 mesh_section_background
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mesh_section_background( $post_id = 0, $echo = true, $size_large = 'large', $size_medium = 'large', $size_xlarge = 'large', $size_small = 'small' ) {
global $post;
if ( empty( $post_id ) ) {
- Create a ticketCreate a ticket
Method mesh_get_allowed_html
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mesh_get_allowed_html() {
$mesh_allowed = apply_filters( 'mesh_default_allowed_html', array(
'iframe' => array(
'src' => true,
'style' => true,
- Create a ticketCreate a ticket
File class.mesh-controls.php
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Handle displaying controls within sections and blocks
*
* @package Mesh
- Create a ticketCreate a ticket
File class.mesh-settings.php
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Control all of our plugin Settings
*
* @since 1.0.0
- Create a ticketCreate a ticket
Method init
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init() {
$labels = array(
'name' => esc_html_x( 'Mesh Templates', 'Mesh Templates', 'mesh' ),
'singular_name' => esc_html_x( 'Mesh Template', 'Mesh Template', 'mesh' ),
- Create a ticketCreate a ticket
File mesh.php
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Plugin Name: Mesh
* Plugin URI: https://meshplugin.com?utm_source=mesh&utm_medium=plugin-admin-page&utm_campaign=wp-plugin
* Description: Adds multiple sections for content on a post by post basis. Mesh also has settings to enable it for specific post types
- Create a ticketCreate a ticket
Method get_grid_systems
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get_grid_systems() {
self::$grid_systems = array(
'css' => array( // @since 1.2.5
'columns' => array(
- Create a ticketCreate a ticket
Function rerender_blocks
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
rerender_blocks: function ( $tinymce_editors ) {
$tinymce_editors.each(function () {
var editor_id = $(this).prop('id'),
proto_id = 'content',
- Create a ticketCreate a ticket