vindi/vindi-woocommerce

View on GitHub

Showing 2,474 of 2,474 total issues

The closing brace for the class must go on the next line after the body
Open

}

Opening brace of a class must be on the line after the definition
Open

class FrontendFilesLoader {

Visibility must be declared on method "__construct"
Open

  function __construct() {

Terminating statement must be indented to the same level as the CASE body
Open

          break;
Severity: Minor
Found in src/utils/PaymentGateway.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

if ( ! defined( 'ABSPATH' ) ) {

Blank line found at start of control structure
Open

            if ($sign_up_fee != null && $sign_up_fee > 0) {

Expected 0 spaces before closing bracket; 1 found
Open

if ( ! defined( 'ABSPATH' ) ) {
Severity: Minor
Found in src/views/product-status.php by phpcodesniffer

Blank line found at start of control structure
Open

    if ($this->is_valid_br_zip_code($shipping_address_zip)) {
Severity: Minor
Found in src/utils/PaymentGateway.php by phpcodesniffer

The DEFAULT body must start on the line following the statement
Open

            default:

Opening brace of a class must be on the line after the definition
Open

class FieldValidator {

Function closing brace must go on the next line following the body; found 3 blank lines before brace
Open

  }

Expected 0 spaces before closing bracket; 1 found
Open

        if (!is_null($amount) ) {
Severity: Minor
Found in src/utils/PaymentGateway.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

    if (isset($_POST['post_data'] ) ) {

The CASE body must start on the line following the statement
Open

            case static::ORDER_TYPE_SUBSCRIPTION:

Closing class brace must be on a line by itself
Open

};
Severity: Minor
Found in src/utils/PaymentGateway.php by phpcodesniffer

The method create has a boolean flag argument $recreated, which is a certain sign of a Single Responsibility Principle violation.
Open

  function create($post_id, $post, $update, $recreated = false)
Severity: Minor
Found in src/controllers/ProductController.php by phpmd

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

    return $response;
Severity: Major
Found in src/controllers/PlansController.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return array(
            'product' => $variations_products,
            'plan' => $variations_plans,
          );
    Severity: Major
    Found in src/controllers/PlansController.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return $createdProduct;
      Severity: Major
      Found in src/controllers/ProductController.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return $response;
        Severity: Major
        Found in src/controllers/PlansController.php - About 30 mins to fix
          Severity
          Category
          Status
          Source
          Language