Showing 44 of 71 total issues
Function parse_csv
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function parse_csv( $data ) {
if ( is_string( $data ) )
$data = explode( "\n", $data );
- Read upRead up
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 validate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function validate( $options ) {
//add slashes to JS selectors
$js = array ( 'nextSelector', 'navSelector', 'itemSelector', 'contentSelector' );
foreach ( $js as $field ) {
- Read upRead up
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_preset
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function get_preset( $theme = null ) {
if ( $theme == null )
$theme = get_stylesheet();
- Read upRead up
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 infscr_determinepath
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_determinepath: function infscr_determinepath(path) {
var opts = this.options;
// if behavior is defined and this function is extended, call that instead of default
Method ivanhoe_role_id_save_meta_box_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ivanhoe_role_id_save_meta_box_data($post_id=null)
{
$post_id = (is_null($post_id)) ? get_post()->ID : $post_id;
/*
Method ivanhoe_move_source_save_meta_box_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ivanhoe_move_source_save_meta_box_data($post_id=null)
{
$post_id = (is_null($post_id)) ? get_post()->ID : $post_id;
/*
Method get_preset
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_preset( $theme = null ) {
if ( $theme == null )
$theme = get_stylesheet();
Method add_rationale
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add_rationale($post)
{
$journal_entry = null;
if ($this->rationale) {
Function get_stylesheet
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function get_stylesheet( $name ) {
//pre 3.4
if ( !function_exists( 'wp_get_themes' ) ) {
- Read upRead up
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 export
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function export( $all = false ) {
$presets = array();
//if the current theme is not a known preset or they want all
- Read upRead up
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 send_to_editor
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function send_to_editor( $args ) {
global $wpdb;
if (isset($GLOBALS['HTTP_POST_FILES']['async-upload'])){
if ( $args['errors'] !== null )
return $args;
- Read upRead up
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 prepare_items
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function prepare_items() {
global $infinite_scroll;
$per_page = 25;
- Read upRead up
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
Avoid deeply nested control flow statements. Open
<?php if ( $characters->have_posts() ) : ?>
<ul class='character_list'>
<?php while ( $characters->have_posts() ) : $characters->the_post();
if ($post->ID == $role->ID) continue; ?>
<li class='role'>
Avoid deeply nested control flow statements. Open
if ( $role !== FALSE ) :
?>
<?php $ivanhoe_post_id=$post->ID; ?>
<span class="new_source btn" data-title="<?php echo get_the_title($ivanhoe_post_id); ?>" data-value="<?php echo $ivanhoe_post_id; ?>">Add to Moves</span>
Avoid deeply nested control flow statements. Open
<?php while ( $characters->have_posts() ) : $characters->the_post(); ?>
<li class='role'>
<a href="<?php echo get_permalink( $post->ID ); ?>" class="image-container"><?php echo get_the_post_thumbnail($post->ID, 'medium'); ?></a>
<a href="<?php echo get_permalink( $post->ID ); ?>"><?php echo $post->post_title; ?></a>
</li>
Avoid too many return
statements within this function. Open
return path;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $preset;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;