ryanwinchester/hubspot-php

View on GitHub

Showing 21 of 23 total issues

Response has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class Response implements ResponseInterface, ArrayAccess
{
    /**
     * @var mixed
     */
Severity: Minor
Found in src/Http/Response.php - About 2 hrs to fix

    Contacts has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Contacts extends Endpoint
    {
        /**
         * Create a new contact.
         *
    Severity: Minor
    Found in src/Endpoints/Contacts.php - About 2 hrs to fix

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

          function build_query_string(array $params = [], $encoding = PHP_QUERY_RFC3986): string
          {
              if (empty($params)) {
                  return '';
              }
      Severity: Minor
      Found in src/helpers.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 createOrUpdate has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $appId,
              $eventTypeId,
              $id,
              $objectId = null,
              $email = null,
      Severity: Major
      Found in src/Endpoints/Timeline.php - About 1 hr to fix

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

            public function request(string $method, string $endpoint, array $options = [], $query_string = null, bool $requires_auth = true)
            {
                if ($requires_auth && empty($this->key)) {
                    throw new InvalidArgument('You must provide a Hubspot api key or token.');
                }
        Severity: Minor
        Found in src/Http/Client.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 updateEventTypeProperty has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $appId,
                $eventTypeId,
                $eventTypePropertyId,
                $name,
                $label,
        Severity: Major
        Found in src/Endpoints/Timeline.php - About 50 mins to fix

          Method createEventTypeProperty has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $appId,
                  $eventTypeId,
                  $name,
                  $label,
                  $propertyType,
          Severity: Major
          Found in src/Endpoints/Timeline.php - About 50 mins to fix

            Method updateTable has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function updateTable($tableId, string $name, array $columns = [], bool $draft = false, bool $published = true, bool $useForPages = false)
            Severity: Minor
            Found in src/Endpoints/HubDB.php - About 45 mins to fix

              Method upload has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      $file,
                      array $options = [],
                      string $folderPath = '/',
                      string $fileName = null,
                      string $folderId = null,
              Severity: Minor
              Found in src/Endpoints/Files.php - About 45 mins to fix

                Method updateEventType has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $appId,
                        $eventTypeId,
                        $name = null,
                        $headerTemplate = null,
                        $detailTemplate = null,
                Severity: Minor
                Found in src/Endpoints/Timeline.php - About 45 mins to fix

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

                          string $breakdown_by,
                          string $time_period,
                          string $start,
                          string $end,
                          array $params = []
                  Severity: Minor
                  Found in src/Endpoints/Analytics.php - About 35 mins to fix

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

                            $importStartedAt,
                            int $pageNumber,
                            array $messages,
                            string $storeId,
                            string $objectType
                    Severity: Minor
                    Found in src/Endpoints/EcommerceBridge.php - About 35 mins to fix

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

                          public function request(string $method, string $endpoint, array $options = [], $query_string = null, bool $requires_auth = true)
                      Severity: Minor
                      Found in src/Http/Client.php - About 35 mins to fix

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

                                string $content_type,
                                string $time_period,
                                string $start,
                                string $end,
                                array $params = []
                        Severity: Minor
                        Found in src/Endpoints/Analytics.php - About 35 mins to fix

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

                              public function updateRow($tableId, $rowId, array $values, string $name = null, string $path = null)
                          Severity: Minor
                          Found in src/Endpoints/HubDB.php - About 35 mins to fix

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

                                    string $object_type,
                                    string $time_period,
                                    string $start,
                                    string $end,
                                    array $params = []
                            Severity: Minor
                            Found in src/Endpoints/Analytics.php - About 35 mins to fix

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

                                      $importStartedAt,
                                      int $pageCount,
                                      int $itemCount,
                                      string $storeId,
                                      string $objectType
                              Severity: Minor
                              Found in src/Endpoints/EcommerceBridge.php - About 35 mins to fix

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

                                    public function updateCell($tableId, $rowId, $cellId, array $values, bool $draft = false)
                                Severity: Minor
                                Found in src/Endpoints/HubDB.php - About 35 mins to fix

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

                                          $hubId,
                                          $eventId,
                                          $contactEmail = null,
                                          $contactRevenue = null,
                                          $contactProperties = []
                                  Severity: Minor
                                  Found in src/Endpoints/Events.php - About 35 mins to fix

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

                                        public function addRow($tableId, array $values, bool $draft = false, string $name = null, string $path = null)
                                    Severity: Minor
                                    Found in src/Endpoints/HubDB.php - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language