Showing 153 of 194 total issues
Function __call
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __call( $method, $args ) {
switch ( $method ) {
case 'register_main_assets':
case 'disable_special_page_styles':
case 'print_detect_js_svg_support_script':
- 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 add_dropdown_icon_to_menu_link
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function add_dropdown_icon_to_menu_link( $title, $item, $args ) {
if ( in_array( $args->theme_location, array( 'primary', 'primary_df' ), true ) ) {
foreach ( $item->classes as $value ) {
if ( 'menu-item-has-children' === $value || 'page_item_has_children' === $value ) {
$title .= $this->get_dependency( 'icons' )->get_svg( 'angle-down' );
- 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 register_widget_areas
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function register_widget_areas( $widgets ) {
$widgets->register_widget_area( new Super_Awesome_Theme_Widget_Area(
'primary',
array(
Super_Awesome_Theme_Widget_Area::PROP_TITLE => __( 'Primary Sidebar', 'super-awesome-theme' ),
- 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
if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
continue;
} else if (i > 0) {
name.splice(i - 1, 2);
i -= 2;
Function get_jed_locale_data_for_domain
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function get_jed_locale_data_for_domain( $domain ) {
$translations = get_translations_for_domain( $domain );
$locale = array(
'' => 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function render( array $instance ) {
$login_url = '';
$login_label = '';
$register_url = '';
$register_label = '';
- 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 super_awesome_theme_infinite_scroll_render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function super_awesome_theme_infinite_scroll_render() {
while ( have_posts() ) {
the_post();
if ( is_search() ) :
get_template_part( 'template-parts/content', 'search' );
- 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 add_size
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function add_size( $slug, $width, $height, $crop = false, $selectable = false ) {
Function initializeDropdownMenus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
initializeDropdownMenus( menu ) {
const options = this.options;
let parentLinks;
- 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_svg
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function get_svg( $icon, array $args = array() ) {
$this->needs_svg = true;
$args = wp_parse_args( $args, array(
'title' => '',
- 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 initializeMenuFocus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
initializeMenuFocus( menu ) {
let links;
if ( ! menu ) {
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
Function super_awesome_theme_get_template_part
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function super_awesome_theme_get_template_part( $slug, $name = null, $data = null ) {
global $wp_query;
$do_change = false;
if ( null !== $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 add_menu_social_icons
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function add_menu_social_icons( $item_output, $item, $depth, $args ) {
if ( $this->link_before === $args->link_before && $this->link_after === $args->link_after ) {
$social_icons = $this->get_social_links_icons();
foreach ( $social_icons as $attr => $value ) {
- 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 function. Open
return method;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return reset( $taxonomy->object_type );
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return null;