pagseguro/pagseguro-php-sdk

View on GitHub

Showing 86 of 191 total issues

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

    public static function search(Credentials $credentials, $code)
    {

        Logger::info("Begin", ['service' => 'PreApproval.Search.Code']);

Severity: Minor
Found in source/Services/PreApproval/Search/Code.php - About 1 hr to fix

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

        public static function search(Credentials $credentials, $code)
        {
            Logger::info("Begin", ['service' => 'Application.Search.Notification']);
            try {
                $connection = new Connection\Data($credentials);
    Severity: Minor
    Found in source/Services/Application/Search/Notification.php - About 1 hr to fix

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

          public static function create(Credentials $credentials, QueryPaymentOrder $queryPaymentOrder)
          {
              Logger::info("Begin", ['service' => 'DirectPreApproval']);
              try {
                  $connection = new Connection\Data($credentials);
      Severity: Minor
      Found in source/Services/DirectPreApproval/QueryPaymentOrderService.php - About 1 hr to fix

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

            public static function search(Credentials $credentials, $code)
            {
                Logger::info("Begin", ['service' => 'Application.Search.Code']);
                try {
                    $connection = new Connection\Data($credentials);
        Severity: Minor
        Found in source/Services/Application/Search/Code.php - About 1 hr to fix

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

              public static function getData(Requests $request, $properties)
              {
                  $data = [];
                  $items = $request->getItems();
                  if ($request->itemLenght() > 0) {
          Severity: Minor
          Found in source/Parsers/Item.php - About 1 hr to fix

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

                public static function search(Credentials $credentials, $code)
                {
                    Logger::info("Begin", ['service' => 'PreApproval.Search.Notification']);
                    try {
                        $connection = new Connection\Data($credentials);
            Severity: Minor
            Found in source/Services/PreApproval/Search/Notification.php - About 1 hr to fix

              Method create has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function create(Credentials $credentials, $code)
                  {
                      Logger::info("Begin", ['service' => 'Cancel']);
                      try {
                          $connection = new Connection\Data($credentials);
              Severity: Minor
              Found in source/Services/Transactions/Cancel.php - About 1 hr to fix

                Method create has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function create(Credentials $credentials, $code, $value = null)
                    {
                        Logger::info("Begin", ['service' => 'Refund']);
                        try {
                            $connection = new Connection\Data($credentials);
                Severity: Minor
                Found in source/Services/Transactions/Refund.php - About 1 hr to fix

                  Method success has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function success(Http $http)
                      {
                          $xml = simplexml_load_string($http->getResponse());
                  
                          $response = new Response();
                  Severity: Minor
                  Found in source/Parsers/PreApproval/Notification/Request.php - About 1 hr to fix

                    Method success has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function success(Http $http)
                        {
                            $xml = simplexml_load_string($http->getResponse());
                            $response = new Response();
                            $response->setName(current($xml->name))
                    Severity: Minor
                    Found in source/Parsers/PreApproval/Search/Code/Request.php - About 1 hr to fix

                      Function mask has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private static function mask($value, $mask)
                          {
                              $maskared = '';
                              $key = 0;
                              for ($count = 0; $count <= strlen($mask) - 1; $count++) {
                      Severity: Minor
                      Found in source/Helpers/Mask.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 check has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function check(Credentials $credentials)
                          {
                              Logger::info("Begin", ['service' => 'Application.Notification']);
                              try {
                                  $connection = new Connection\Data($credentials);
                      Severity: Minor
                      Found in source/Services/Application/Notification.php - About 1 hr to fix

                        Method check has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function check(Credentials $credentials)
                            {
                                Logger::info("Begin", ['service' => 'Transactions.Notification']);
                                try {
                                    $connection = new Connection\Data($credentials);
                        Severity: Minor
                        Found in source/Services/Transactions/Notification.php - About 1 hr to fix

                          Method makeAddressNode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function makeAddressNode(\DOMNode $personDom)
                              {
                                  $addressElement = $this->dom->createElement('address');
                                  $addressDom = $personDom->appendChild($addressElement);
                          
                          
                          Severity: Minor
                          Found in source/Services/Authorization/SellerService.php - About 1 hr to fix

                            Method address has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private static function address($request, $properties)
                                {
                                    $data = [];
                            
                                    if (!is_null($request->getStreet())) {
                            Severity: Minor
                            Found in source/Parsers/DirectPayment/CreditCard/Billing.php - About 1 hr to fix

                              Method makeAddressNode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function makeAddressNode(\DOMNode $companyDom)
                                  {
                                      $addressElement = $this->dom->createElement('address');
                                      $addressDom = $companyDom->appendChild($addressElement);
                              
                              
                              Severity: Minor
                              Found in source/Services/Authorization/CompanyService.php - About 1 hr to fix

                                Method makeAddressNode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function makeAddressNode(\DOMNode $personDom)
                                    {
                                        $addressElement = $this->dom->createElement('address');
                                        $addressDom = $personDom->appendChild($addressElement);
                                
                                
                                Severity: Minor
                                Found in source/Services/Authorization/PersonalService.php - About 1 hr to fix

                                  Method address has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private static function address($request, $properties)
                                      {
                                          $data = [];
                                          if (!is_null($request->getShipping()->getAddress()->getStreet())) {
                                              $data[$properties::SHIPPING_ADDRESS_STREET] = $request->getShipping()->getAddress()->getStreet();
                                  Severity: Minor
                                  Found in source/Parsers/Shipping.php - About 1 hr to fix

                                    Method create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public static function create(Credentials $credentials, \PagSeguro\Domains\Requests\PreApproval\Charge $charge)
                                        {
                                            Logger::info("Begin", ['service' => 'PreApproval.Charge']);
                                            try {
                                                $connection = new Connection\Data($credentials);
                                    Severity: Minor
                                    Found in source/Services/PreApproval/Charge.php - About 1 hr to fix

                                      Method withParameters has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              $street,
                                              $number,
                                              $district,
                                              $postalCode,
                                              $city,
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language