Aerendir/stripe-bundle

View on GitHub
src/Model/StripeLocalCharge.php

Summary

Maintainability
D
1 day
Test Coverage

StripeLocalCharge has 54 functions (exceeds 20 allowed). Consider refactoring.
Open

class StripeLocalCharge implements StripeLocalResourceInterface
{
    /** @var array<array-key, string> Properties of the Model that may not be present in the SDK model: these must be ignored when populating the local model */
    public const IGNORE = [
        // This is an optional parameter required when creating a charge and not returned by the SDK
Severity: Major
Found in src/Model/StripeLocalCharge.php - About 7 hrs to fix

    File StripeLocalCharge.php has 316 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    declare(strict_types=1);
    
    /*
    Severity: Minor
    Found in src/Model/StripeLocalCharge.php - About 3 hrs to fix

      Function toStripe has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function toStripe(string $action): array
          {
              $return = [];
      
              // Prepare the array for creation
      Severity: Minor
      Found in src/Model/StripeLocalCharge.php - About 1 hr 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

      Method toStripe has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function toStripe(string $action): array
          {
              $return = [];
      
              // Prepare the array for creation
      Severity: Minor
      Found in src/Model/StripeLocalCharge.php - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status