descubraomundo/omnipay-pagarme

View on GitHub

Showing 7 of 12 total issues

AbstractRequest has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class AbstractRequest extends BaseAbstractRequest
{
    /**
     * Live or Test Endpoint URL
     *
Severity: Minor
Found in src/Message/AbstractRequest.php - About 2 hrs to fix

    Function getData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getData()
        {
            $this->validate('amount');
            
            $data = array();
    Severity: Minor
    Found in src/Message/AuthorizeRequest.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 testGetData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function testGetData()
        {
            $expiryDate = new DateTime();
            $expiryDate->add(new DateInterval("P1Y"));
            $card = array(
    Severity: Minor
    Found in tests/Message/AuthorizeRequestTest.php - About 1 hr to fix

      Method getData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getData()
          {
              $this->validate('amount');
              
              $data = array();
      Severity: Minor
      Found in src/Message/AuthorizeRequest.php - About 1 hr to fix

        Method testSetCustomerWithoutCard has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function testSetCustomerWithoutCard()
            {
                $customer = array(
                    'firstName' => 'John F',
                    'lastName' => 'Doe',
        Severity: Minor
        Found in tests/Message/AuthorizeRequestTest.php - About 1 hr to fix

          Function getCustomerReference has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getCustomerReference()
              {
                  if (isset($this->data['object']) && 'customer' === $this->data['object']) {
                      return $this->data['id'];
                  }
          Severity: Minor
          Found in src/Message/Response.php - About 45 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

          Function getData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getData()
              {
                  $data = array();
                  //var_dump($this->getCustomer());
                  //die;
          Severity: Minor
          Found in src/Message/CreateCustomerRequest.php - About 45 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