creads/partners-sdk-php

View on GitHub

Showing 16 of 16 total issues

Method execute has 87 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        //for the output to stdderr to no break the output
        $output = $output->getErrorOutput();

Severity: Major
Found in src/Console/Command/LoginCommand.php - About 3 hrs to fix

    Function execute has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            //for the output to stdderr to no break the output
            $output = $output->getErrorOutput();
    
    
    Severity: Minor
    Found in src/Console/Command/LoginCommand.php - About 3 hrs 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 configure has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function configure()
        {
            $this
                ->setName('signed-auth-url')
                ->setDescription('Generate a signed auth URL')
    Severity: Major
    Found in src/Console/Command/SignedAuthUrlCommand.php - About 2 hrs to fix

      Method getAccessToken has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getAccessToken($scope = 'base', $noStoring = false)
          {
              if ($noStoring || $this->isTokenExpired()) {
                  $multipartBody = [
                      [
      Severity: Minor
      Found in src/OAuthAccessToken.php - About 2 hrs to fix

        Method execute has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                $uri = ltrim($input->getArgument('URI'), '/');
                $include = $input->getOption('include', false);
                $filter = $input->getOption('filter', false);
        Severity: Minor
        Found in src/Console/Command/GetCommand.php - About 1 hr to fix

          Function execute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function execute(InputInterface $input, OutputInterface $output)
              {
                  $uri = ltrim($input->getArgument('URI'), '/');
                  $include = $input->getOption('include', false);
                  $filter = $input->getOption('filter', false);
          Severity: Minor
          Found in src/Console/Command/GetCommand.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 execute has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function execute(InputInterface $input, OutputInterface $output)
              {
                  if (0 != ($returnCode = $this->login($output))) {
                      return $returnCode;
                  }
          Severity: Minor
          Found in src/Console/Command/SignedAuthUrlCommand.php - About 1 hr to fix

            Method postFile has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function postFile($sourceFilepath, $destinationFilepath = null, $enforceUnicity = false)
                {
                    $mimeType = mime_content_type($sourceFilepath);
                    if (!$destinationFilepath) {
                        // No specified filename, use the uploaded one
            Severity: Minor
            Found in src/Client.php - About 1 hr to fix

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

                  public static function create(
                      \ArrayAccess $configuration,
                      array $parameters,
                      $protocol = self::RFC2_SIGNATURE_PROTOCOL,
                      string $expirationTime = '+5 minutes'
              Severity: Minor
              Found in src/SignedAuthenticationUrlFactory.php - About 1 hr to fix

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

                    public static function create(
                        \ArrayAccess $configuration,
                        array $parameters,
                        $protocol = self::RFC2_SIGNATURE_PROTOCOL,
                        string $expirationTime = '+5 minutes'
                Severity: Minor
                Found in src/SignedAuthenticationUrlFactory.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 getAccessToken has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getAccessToken($scope = 'base', $noStoring = false)
                    {
                        if ($noStoring || $this->isTokenExpired()) {
                            $multipartBody = [
                                [
                Severity: Minor
                Found in src/OAuthAccessToken.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 execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function execute(InputInterface $input, OutputInterface $output)
                    {
                        if (0 != ($returnCode = $this->login($output))) {
                            return $returnCode;
                        }
                Severity: Minor
                Found in src/Console/Command/SignedAuthUrlCommand.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

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

                    public function __construct($clientId, $clientSecret, $params = [])
                    {
                        if (isset($params['base_uri'])) {
                            $this->baseUri = rtrim($params['base_uri'], '/').'/';
                        }
                Severity: Minor
                Found in src/OAuthAccessToken.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

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

                    protected function getConfigValue($input, $output, $label, $previous, $reset)
                Severity: Minor
                Found in src/Console/Command/LoginCommand.php - About 35 mins to fix

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

                      public function getSignedUri($baseUri, $accessKey, $secretKey, array $parameters, $expirationTime = '+5 minutes')
                  Severity: Minor
                  Found in src/SignedAuthenticationUrl.php - About 35 mins to fix

                    Function decodePath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function decodePath($path)
                        {
                            $template = $this->getRoute();
                    
                            $pattern = preg_quote($template, '/');
                    Severity: Minor
                    Found in src/V0SignedAuthenticationUrl.php - About 35 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