pagseguro/pagseguro-php-sdk

View on GitHub

Showing 86 of 191 total issues

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

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

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

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

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

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

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

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

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

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

            Function setParameter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public function setParameter($parameter)
                {
                    if (is_array($parameter)) {
                        $arr = array();
                        foreach ($parameter as $key => $parameterItem) {
            Severity: Minor
            Found in source/Domains/Requests/Parameter.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

            Function setItems has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public function setItems($items)
                {
                    if (is_array($items)) {
                        $arr = array();
                        foreach ($items as $key => $item) {
            Severity: Minor
            Found in source/Domains/Requests/Item.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

            Function setMetadata has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public function setMetadata($metadata)
                {
                    if (is_array($metadata)) {
                        $arr = array();
                        foreach ($metadata as $key => $metadataItem) {
            Severity: Minor
            Found in source/Domains/Requests/Metadata.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

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

                public static function getData(Requests $request)
                {
                    $data = [];
            
                    if ($request->parameterLenght() > 0) {
            Severity: Minor
            Found in source/Parsers/Parameter.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

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

                public static function getData(Requests $request, $properties)
                {
                    $data = [];
                    if (!is_null($request->acceptedPaymentMethods())) {
                        $accepted = $request->acceptedPaymentMethods();
            Severity: Minor
            Found in source/Parsers/Accepted.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

            Function setPaymentMethod has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public function setPaymentMethod($paymentMethod)
                {
                    if (is_array($paymentMethod)) {
                        $arr = array();
                        foreach ($paymentMethod as $key => $method) {
            Severity: Minor
            Found in source/Domains/Requests/PaymentMethod.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 create has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

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

                Method checkout has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function checkout(
                        Credentials $credentials,
                        \PagSeguro\Domains\Requests\DirectPayment\CreditCard $payment
                    )
                    {
                Severity: Minor
                Found in source/Services/DirectPayment/CreditCard.php - About 1 hr to fix

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

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

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

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

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

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

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

                            public static function search(
                                Credentials $credentials,
                                array $options
                            )
                            {
                        Severity: Minor
                        Found in source/Services/PreApproval/Search/Date.php - About 1 hr to fix

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

                              public static function create(Credentials $credentials, PreApproval $preApproval)
                              {
                                  Logger::info("Begin", ['service' => 'PreApproval']);
                                  try {
                                      $connection = new Connection\Data($credentials);
                          Severity: Minor
                          Found in source/Services/PreApproval/Payment.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, Query $directPreApproval)
                                {
                                    Logger::info("Begin", ['service' => 'DirectPreApproval']);
                                    try {
                                        $connection = new Connection\Data($credentials);
                            Severity: Minor
                            Found in source/Services/DirectPreApproval/QueryService.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language