Showing 19 of 27 total issues
Function edit
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
edit( { attributes, className, setAttributes } ) {
const {
title,
body,
backgroundImage,
Method custom_post_type
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function custom_post_type()
{
/**
* Add the post types and their details
*/
File cta.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
const { registerBlockType } = wp.blocks;
const {
PlainText,
RichText,
MediaUpload,
Method register
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register( $wp_customize )
{
$wp_customize->add_section( 'awps_header_section' , array(
'title' => __( 'Header', 'awps' ),
'description' => __( 'Customize the Header' ),
Function mix
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function mix($path, $manifestDirectory = '')
{
if (! $manifestDirectory) {
//Setup path for standard AWPS-Folder-Structure
$manifestDirectory = "assets/dist/";
- 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 save
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
save( { attributes } ) {
const {
title,
body,
titleColor,
Method start_el
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
{
$indent = ($depth) ? str_repeat("\t", $depth) : '';
$li_attributes = '';
Function display_element
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output)
{
if (!$element) {
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
Method register
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register( $wp_customize )
{
$wp_customize->add_section( 'awps_footer_section' , array(
'title' => __( 'Footer', 'awps' ),
'description' => __( 'Customize the Footer' ),
Function admin_scripts
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function admin_scripts( $hook )
{
// dd( $hook );
$this->enqueue_on_pages = ( !empty( $this->enqueue_on_pages ) ) ? $this->enqueue_on_pages : array( $hook );
- 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 gutenberg_init
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function gutenberg_init()
{
add_theme_support( 'gutenberg', array(
// Theme supports responsive video embeds
'responsive-embeds' => true,
Method display_element
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output)
{
if (!$element) {
return;
}
Method setup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setup()
{
/*
* You can activate this if you're planning to build a multilingual theme
*/
Method mix
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mix($path, $manifestDirectory = '')
{
if (! $manifestDirectory) {
//Setup path for standard AWPS-Folder-Structure
$manifestDirectory = "assets/dist/";
Function entry_footer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function entry_footer()
{
// Hide category and tag text for pages.
if ('post' === get_post_type()) {
- 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 display_element
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output)
Function start_el
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
{
$indent = ($depth) ? str_repeat("\t", $depth) : '';
$li_attributes = '';
- 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 start_el
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
Function starts_with
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function starts_with($haystack, $needles)
{
foreach ((array) $needles as $needle) {
if ($needle != '' && substr($haystack, 0, strlen($needle)) === (string) $needle) {
return 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"