Showing 39 of 43 total issues
Method get_context
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_context() {
global $content_width;
if ( class_exists( 'Easy_Digital_Downloads' ) ) {
Method purchase_variable_pricing
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function purchase_variable_pricing( $download_id ) {
$variable_pricing = edd_has_variable_prices( $download_id );
if ( ! $variable_pricing ) {
Function form
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function form( $instance ) {
$defaults = array(
'title' => 'Latest Articles',
'post_type' => '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 colorposts_build_css
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function colorposts_build_css( $styles ) {
$src = $this->custom_header_url();
if ( $src && get_template_directory_uri() . '/core-shell/assets/images/grid-back.png' != $src ) {
- 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
Method context
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function context() {
global $wp_query;
$context = Maera()->cache->get_context();
Function colors
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function colors() {
$thumb_id = get_post_thumbnail_id( $this->post_id );
$thumb_url = wp_get_attachment_image_src( $thumb_id );
$thumb_url = $thumb_url[0];
- 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 cache_mode
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function cache_mode() {
$options = get_option( 'maera_admin_options', array() );
$cache_mode = isset( $options['cache_mode'] ) ? $options['cache_mode'] : 'default';
- 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 widget_areas
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function widget_areas() {
$areas = $this->extra_widget_areas_array();
$class = apply_filters( 'maera/widgets/class', '' );
- 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 admin_page
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function admin_page() {
global $pagenow;
$tabs = $this->tabs();
- 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 context
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function context() {
global $wp_query;
$context = Maera()->cache->get_context();
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
function validate( $settings ) {
// Import the imported options
if ( isset( $settings['import_data'] ) && ! empty( $settings['import_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
Consider simplifying this complex logical expression. Open
if (isset($params[2])
&& !is_int($params[2])
&& !is_float($params[2])
&& !is_string($params[2])
&& !(is_object($params[2]) && method_exists($params[2], '__toString'))
Consider simplifying this complex logical expression. Open
if (!is_int($params[1])
&& !is_float($params[1])
&& !is_string($params[1])
&& $params[1] !== null
&& !(is_object($params[1]) && method_exists($params[1], '__toString'))
Function extra_widget_areas_wrapper
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function extra_widget_areas_wrapper( $area = null, $class = '' ) {
// Do not proceed if we have not specified an area
if ( is_null( $area ) ) {
return;
- 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 $resultArray;
Function custom_css_cached
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function custom_css_cached() {
if ( Maera()->dev->dev_mode() ) {
// Get our styles using the maera/styles filter
$data = apply_filters( 'maera/styles', null );
- 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 test_missing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function test_missing() {
$plugins = apply_filters( 'maera/plugins/required', array() );
$status = get_transient( 'maera_required_plugins_status' );
- 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 twig_locations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function twig_locations() {
$locations = array();
$location_roots = array();
- 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 required_plugins_notices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function required_plugins_notices() {
$plugin_messages = array();
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
- 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"