Showing 12 of 12 total issues
Method featured_products_by_category
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function featured_products_by_category( $atts ) {
if ( ! $this->is_woocommerce_active() ) {
return;
}
Method subcategories_from_category
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function subcategories_from_category( $atts ) {
if ( ! $this->is_woocommerce_active() ) {
return;
}
Class file names should be based on the class name with "class-" prepended. Expected class-plugin.php, but found Plugin.php. Open
Open
<?php
- Exclude checks
Filenames should be all lowercase with hyphens as word separators. Expected shortcode.php, but found Shortcode.php. Open
Open
<?php
- Exclude checks
Filenames should be all lowercase with hyphens as word separators. Expected plugin.php, but found Plugin.php. Open
Open
<?php
- Exclude checks
Array double arrow not aligned correctly; expected 10 space(s) between "'meta_query'" and double arrow, but found 1. Open
Open
'meta_query' => array(
- Exclude checks
Parenthesis should always be used when instantiating a new object. Open
Open
'walker' => \apply_filters( 'woocommerce_shortcode_subcategories_from_category_walker', new \Walker_Category, $atts ),
- Exclude checks
Array double arrow not aligned correctly; expected 3 space(s) between "'key'" and double arrow, but found 5. Open
Open
'key' => '_featured',
- Exclude checks
Class file names should be based on the class name with "class-" prepended. Expected class-shortcode.php, but found Shortcode.php. Open
Open
<?php
- Exclude checks
Array double arrow not aligned correctly; expected 1 space(s) between "'value'" and double arrow, but found 3. Open
Open
'value' => 'yes',
- Exclude checks
Missing class import via use statement (line '181', column '102'). Open
Open
'walker' => \apply_filters( 'woocommerce_shortcode_subcategories_from_category_walker', new \Walker_Category, $atts ),
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '220', column '19'). Open
Open
$products = new \WP_Query( $query_args );
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}