xabbuh/panda-client

View on GitHub

Showing 9 of 9 total issues

Profile has 46 functions (exceeds 20 allowed). Consider refactoring.
Open

class Profile implements ModelInterface
{
    private $id;

    private $title;
Severity: Minor
Found in src/Model/Profile.php - About 6 hrs to fix

    AbstractMedium has 40 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class AbstractMedium implements ModelInterface
    {
        protected $id;
    
        protected $mimeType;
    Severity: Minor
    Found in src/Model/AbstractMedium.php - About 5 hrs to fix

      Cloud has 38 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Cloud implements CloudInterface
      {
          /**
           * The client which is used to perform the requests to the REST api
           *
      Severity: Minor
      Found in src/Api/Cloud.php - About 5 hrs to fix

        File Cloud.php has 268 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /*
         * This file is part of the XabbuhPandaClient package.
         *
        Severity: Minor
        Found in src/Api/Cloud.php - About 2 hrs to fix

          Method request has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function request($method, $path, array $params)
              {
                  // sign the request parameters
                  $signer = PandaSigner::getInstance($this->cloudId, $this->account);
                  $params = $signer->signParams($method, $path, $params);
          Severity: Minor
          Found in src/Api/HttpClient.php - About 1 hr to fix

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

                private function request($method, $path, array $params)
                {
                    // sign the request parameters
                    $signer = PandaSigner::getInstance($this->cloudId, $this->account);
                    $params = $signer->signParams($method, $path, $params);
            Severity: Minor
            Found in src/Api/HttpClient.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 request has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function request($method, $path, array $params)
                {
                    // sign the request parameters
                    $signer = PandaSigner::getInstance($this->cloudId, $this->account);
                    $params = $signer->signParams($method, $path, $params);
            Severity: Minor
            Found in src/Api/HttplugClient.php - About 1 hr to fix

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

                  private function request($method, $path, array $params)
                  {
                      // sign the request parameters
                      $signer = PandaSigner::getInstance($this->cloudId, $this->account);
                      $params = $signer->signParams($method, $path, $params);
              Severity: Minor
              Found in src/Api/HttplugClient.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

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

                  public function denormalize($data, $class, $format = null, array $context = array())
                  {
                      // prematurely return in case of an empty collection
                      if (is_array($data) && count($data) == 0) {
                          return array();
              Severity: Minor
              Found in src/Serializer/Symfony/Normalizer.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