assemblee-virtuelle/wp-ldp

View on GitHub

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

                    'post_type' => 'ldp_resource',
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

Detected usage of tax_query, possible slow query.
Open

                    'tax_query' => array(
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
Open

                            $array[ $rdf_type ]['id'] = strtolower( explode( ':', $rdf_type )[1] );
Severity: Minor
Found in class-api.php by phpcodesniffer

Each array item in a multi-line array declaration must end in a comma
Open

                    )
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

Equals sign not aligned with surrounding assignments; expected 23 spaces but found 1 space
Open

                        $field_values = get_post_custom_values( $field_name, $post->ID )[0];
Severity: Minor
Found in class-api.php by phpcodesniffer

Each array item in a multi-line array declaration must end in a comma
Open

                    )
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space
Open

                $current_entry = array();
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

Detected usage of a non-sanitized input variable: $_SERVER
Open

            $referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : null;
Severity: Minor
Found in class-api.php by phpcodesniffer

Missing wp_unslash() before sanitization.
Open

                $term_meta['ldp_included_fields_list'] = $_POST['ldp_included_fields_list'];
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

Detected usage of a non-sanitized input variable: $_POST
Open

                $term_meta['ldp_rdf_type'] = $_POST['ldp_rdf_type'];
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space
Open

            $params = $request->get_params();
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space
Open

            $params = $request->get_params();
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

Array double arrow not aligned correctly; expected 5 space(s) between "'meta_query'" and double arrow, but found 1.
Open

                    'meta_query' => array(
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

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

                            $field_values = unserialize( $field_values );
Severity: Minor
Found in class-api.php by phpcodesniffer

Function generate_menu_item has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static function generate_menu_item() {
            $menu_name = 'primary';
            $locations = get_nav_menu_locations();

            if ( ! empty( $locations ) && isset( $locations[ $menu_name ] ) ) {
Severity: Minor
Found in wp-ldp.php - About 25 mins to fix

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

            $term_meta = get_term_meta( $term_id,'ldp_site_url', true );
Severity: Minor
Found in class-site-taxonomy.php by phpcodesniffer

Line indented incorrectly; expected 0 tabs, found 3
Open

            foreach ( $terms as $term ) {
Severity: Minor
Found in wp-ldp.php by phpcodesniffer

No space found after comma in function call
Open

                        if ( array_key_exists( $rdf_type,$array ) ) {
Severity: Minor
Found in class-api.php by phpcodesniffer
Severity
Category
Status
Source
Language