Showing 378 of 379 total issues
Array double arrow not aligned correctly; expected 6 space(s) between "'post_type'" and double arrow, but found 1. Open
Open
'post_type' => 'ldp_resource',
- Exclude checks
Detected usage of tax_query, possible slow query. Open
Open
'tax_query' => array(
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space Open
Open
$array[ $rdf_type ]['id'] = strtolower( explode( ':', $rdf_type )[1] );
- Exclude checks
Each array item in a multi-line array declaration must end in a comma Open
Open
)
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 23 spaces but found 1 space Open
Open
$field_values = get_post_custom_values( $field_name, $post->ID )[0];
- Exclude checks
Each array item in a multi-line array declaration must end in a comma Open
Open
)
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space Open
Open
$current_entry = array();
- Exclude checks
Detected usage of a non-sanitized input variable: $_SERVER Open
Open
$referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : null;
- Exclude checks
Missing wp_unslash() before sanitization. Open
Open
$term_meta['ldp_included_fields_list'] = $_POST['ldp_included_fields_list'];
- Exclude checks
Detected usage of a non-sanitized input variable: $_POST Open
Open
$term_meta['ldp_rdf_type'] = $_POST['ldp_rdf_type'];
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space Open
Open
$params = $request->get_params();
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space Open
Open
$params = $request->get_params();
- Exclude checks
Array double arrow not aligned correctly; expected 5 space(s) between "'meta_query'" and double arrow, but found 1. Open
Open
'meta_query' => array(
- Exclude checks
unserialize() found. Serialized data has known vulnerability problems with Object Injection. JSON is generally a better approach for serializing data. See https://www.owasp.org/index.php/PHP_Object_Injection Open
Open
$field_values = unserialize( $field_values );
- Exclude checks
Function generate_menu_item
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function generate_menu_item() {
$menu_name = 'primary';
$locations = get_nav_menu_locations();
if ( ! empty( $locations ) && isset( $locations[ $menu_name ] ) ) {
- 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
No space found after comma in function call Open
Open
$term_meta = get_term_meta( $term_id,'ldp_site_url', true );
- Exclude checks
Line indented incorrectly; expected 0 tabs, found 3 Open
Open
foreach ( $terms as $term ) {
- Exclude checks
No space found after comma in function call Open
Open
if ( array_key_exists( $rdf_type,$array ) ) {
- Exclude checks