Showing 427 of 427 total issues
Function get_all_post_priority_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function get_all_post_priority_data( $include = 'any', $status = 'publish', $page = 0 ) {
$posts = $page_query = Array();
if ( $this->paginate )
$page_query = Array( 'offset' => $page * $this->max_posts );
if ( ( $status == 'publish' ) && ( $include == 'attachment' ) ) $status = 'inherit';
- 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_archive_permalinks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function get_archive_permalinks( $posts ) {
$links = Array();
$archives = Array();
if (is_array( $posts) )
foreach ( $posts as $post ) {
- 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_author_permalinks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function get_author_permalinks( $posts ) {
$links = Array();
$authors = Array();
if (is_array( $posts) )
foreach ( $posts as $post )
- 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 set_post_args
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function set_post_args( $args ) {
if ( $this->option_isset( 'excl_categories' ) ) {
$cats = Array();
foreach( $this->options[ $this->prefix . 'excl_categories'] as $c ) $cats[] = -$c;
$args['category'] = implode( ',', $cats );
- 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 sitemap_warning
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function sitemap_warning( $files ) {
$msg = '';
$conflict = false;
$problem_files = $this->get_problem_files( $files, $msg );
if ( !empty( $problem_files ) ) $conflict = true;
- 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 blocked_message
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function blocked_message( $msg ) {
if ( empty( $this->options["{$this->prefix}blocked_log"] ) ) $this->options["{$this->prefix}blocked_log"] = '';
$this->options["{$this->prefix}blocked_log"] = date( 'Y-m-d H:i:s' ) . " {$msg}\n" . $this->options["{$this->prefix}blocked_log"];
if ( $this->strlen( $this->options["{$this->prefix}blocked_log"] ) > 4096 ) {
$end = $this->strrpos( $this->options["{$this->prefix}blocked_log"], "\n" );
- 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 debug_message
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function debug_message( $msg ) {
if ( empty( $this->options["{$this->prefix}debug"] ) ) $this->options["{$this->prefix}debug"] = '';
$this->options["{$this->prefix}debug"] = date( 'Y-m-d H:i:s' ) . " {$msg}\n" . $this->options["{$this->prefix}debug"];
if ( $this->strlen( $this->options["{$this->prefix}debug"] ) > 2048 ) {
$end = $this->strrpos( $this->options["{$this->prefix}debug"], "\n" );
- 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 too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
? 'null'
: new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
Avoid too many return
statements within this method. Open
if ( $post === null ) return false;
Avoid too many return
statements within this method. Open
return $title;
Avoid too many return
statements within this method. Open
return $title;
Avoid too many return
statements within this method. Open
return '{' . join(',', $properties) . '}';
Avoid too many return
statements within this method. Open
return $utf8;
Avoid too many return
statements within this method. Open
return $obj;
Avoid too many return
statements within this method. Open
return '{' . join(',', $properties) . '}';
Avoid too many return
statements within this method. Open
return $property;
Avoid too many return
statements within this method. Open
return $new_title;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $arr;