jwiegant/laravel-tikkie

View on GitHub

Showing 6 of 6 total issues

Function getPayload has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPayload(): array
    {
        // Initialize the payload
        $payload = [];

Severity: Minor
Found in src/Request/BaseRequest.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 getPayload has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getPayload(): array
    {
        // Initialize the payload
        $payload = [];

Severity: Minor
Found in src/Request/BaseRequest.php - About 1 hr to fix

    Function parseParameters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function parseParameters(array $parameters): void
        {
            // Get the properties of the current class
            $classProperties = get_class_vars(static::class);
    
    
    Severity: Minor
    Found in src/Request/BaseRequest.php - About 55 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

    Method list has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            string $paymentRequestToken,
            bool $includeRefunds = false,
            int $pageNumber = 0,
            int $pageSize = 50,
            $fromDateTime = null,
    Severity: Minor
    Found in src/Payment.php - About 45 mins to fix

      Method create has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              string $paymentRequestToken,
              string $paymentToken,
              string $description,
              float $amount,
              string $referenceId
      Severity: Minor
      Found in src/Refund.php - About 35 mins to fix

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

            protected function parseParameter(
                $key,
                $parameter
            ) {
                // Check if the parameter key exist in the cast variable
        Severity: Minor
        Found in src/Response/BaseResponse.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

        Severity
        Category
        Status
        Source
        Language