Showing 45 of 45 total issues
Function fill_external_data
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
Open
public function fill_external_data( $attr ) {
foreach ( $this->callbacks as $identifier => $params ) {
if ( isset( $attr[ $identifier ] ) ) {
continue;
}
- 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 wp_shortcode_cache_register_edd_support
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function wp_shortcode_cache_register_edd_support() {
wp_shortcode_cache_register_external_data_values( 'purchase_link', array(
'id' => array(
'name' => 'post',
'type' => 'global',
Method fill_external_data
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function fill_external_data( $attr ) {
foreach ( $this->callbacks as $identifier => $params ) {
if ( isset( $attr[ $identifier ] ) ) {
continue;
}
Function register_external_data_values
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function register_external_data_values( $external_data ) {
$error = new WP_Error();
foreach ( $external_data as $identifier => $params ) {
if ( is_string( $params ) ) {
- 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 wp_shortcode_cache_register_external_data_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function wp_shortcode_cache_register_external_data_value( $tag, $data_identifier, $data_name, $data_type = 'global', $data_args = array() ) {
Method register_external_data_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function register_external_data_value( $tag, $data_identifier, $data_name, $data_type = 'global', $data_args = array() ) {
Processing form data without nonce verification. Open
Open
if ( isset( $_POST[ $params['name'] ] ) ) {
- Exclude checks
Processing form data without nonce verification. Open
Open
$attr[ $identifier ] = $_POST[ $params['name'] ];
- Exclude checks
You must use "/**" style comments for a file comment Open
Open
/*
- Exclude checks
Missing wp_unslash() before sanitization. Open
Open
$attr[ $identifier ] = $_POST[ $params['name'] ];
- Exclude checks
Empty line required before block comment Open
Open
/*
- Exclude checks
Detected usage of a non-sanitized input variable: $_POST Open
Open
$attr[ $identifier ] = $_POST[ $params['name'] ];
- Exclude checks
Opening PHP tag must be on a line by itself Open
Open
<?php printf(
- Exclude checks
Closing PHP tag must be on a line by itself Open
Open
); ?>
- Exclude checks
Detected usage of a non-sanitized input variable: $_GET Open
Open
$attr[ $identifier ] = $_GET[ $params['name'] ];
- Exclude checks
Missing wp_unslash() before sanitization. Open
Open
$attr[ $identifier ] = $_GET[ $params['name'] ];
- Exclude checks
Expected 1 space after comma in function call; 4 found Open
Open
add_filter( 'wp_shortcode_cache_use_cache_video', '__return_false' );
- Exclude checks
Expected 1 space after comma in function call; 9 found Open
Open
add_filter( 'do_shortcode_tag', array( $shortcode_cache, 'maybe_cache_output' ), 1, 4 );
- Exclude checks
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '__'. Open
Open
__( 'Please note: WP Shortcode Cache requires WordPress 4.7-beta or higher. <a href="%s">Deactivate plugin</a>.', 'wp-shortcode-cache' ),
- Exclude checks
Expected 1 space after comma in function call; 2 found Open
Open
add_filter( 'wp_shortcode_cache_use_cache_gallery', '__return_false' );
- Exclude checks