Showing 2,474 of 2,474 total issues
The closing brace for the class must go on the next line after the body Open
Open
}
- Exclude checks
Opening brace of a class must be on the line after the definition Open
Open
class FrontendFilesLoader {
- Exclude checks
Visibility must be declared on method "__construct" Open
Open
function __construct() {
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
Open
break;
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( ! defined( 'ABSPATH' ) ) {
- Exclude checks
Blank line found at start of control structure Open
Open
if ($sign_up_fee != null && $sign_up_fee > 0) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( ! defined( 'ABSPATH' ) ) {
- Exclude checks
Blank line found at start of control structure Open
Open
if ($this->is_valid_br_zip_code($shipping_address_zip)) {
- Exclude checks
The DEFAULT body must start on the line following the statement Open
Open
default:
- Exclude checks
Opening brace of a class must be on the line after the definition Open
Open
class FieldValidator {
- Exclude checks
Function closing brace must go on the next line following the body; found 3 blank lines before brace Open
Open
}
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if (!is_null($amount) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if (isset($_POST['post_data'] ) ) {
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case static::ORDER_TYPE_SUBSCRIPTION:
- Exclude checks
Closing class brace must be on a line by itself Open
Open
};
- Exclude checks
The method create has a boolean flag argument $recreated, which is a certain sign of a Single Responsibility Principle violation. Open
Open
function create($post_id, $post, $update, $recreated = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid too many return
statements within this method. Open
Open
return $response;
Avoid too many return
statements within this method. Open
Open
return array(
'product' => $variations_products,
'plan' => $variations_plans,
);
Avoid too many return
statements within this method. Open
Open
return $createdProduct;
Avoid too many return
statements within this method. Open
Open
return $response;