darrynten/sage-one-php

View on GitHub

Showing 31 of 35 total issues

File Company.php has 539 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
* SageOne Library
*
* @category Library
Severity: Major
Found in src/Models/Company.php - About 1 day to fix

    File Customer.php has 350 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
    * SageOne Library
    *
    * @category Library
    Severity: Minor
    Found in src/Models/Customer.php - About 4 hrs to fix

      File TaxInvoice.php has 321 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
      * SageOne Library
      *
      * @category Library
      Severity: Minor
      Found in src/Models/TaxInvoice.php - About 3 hrs to fix

        File BaseModel.php has 314 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
        * SageOne Library - Base Model
        *
        * @category Library
        Severity: Minor
        Found in src/BaseModel.php - About 3 hrs to fix

          File SupplierInvoice.php has 308 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
          * SageOne Library
          *
          * @category Library
          Severity: Minor
          Found in src/Models/SupplierInvoice.php - About 3 hrs to fix

            File SupplierReturn.php has 278 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
            * SageOne Library
            *
            * @category Library
            Severity: Minor
            Found in src/Models/SupplierReturn.php - About 2 hrs to fix

              BaseModel has 22 functions (exceeds 20 allowed). Consider refactoring.
              Open

              abstract class BaseModel
              {
              use Validation;
              /**
              * A request object
              Severity: Minor
              Found in src/BaseModel.php - About 2 hrs to fix

                File Supplier.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                * SageOne Library
                * @category Library
                * @package SageOne
                Severity: Minor
                Found in src/Models/Supplier.php - About 2 hrs to fix

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

                  public function validateRange($value, $min, $max)
                  {
                  if (gettype($value) === 'integer') {
                  if (($value < $min) || ($value > $max)) {
                  throw new ValidationException(
                  Severity: Minor
                  Found in src/Validation.php - About 1 hr to fix

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

                    public function __construct($class, $config, $results)
                    {
                    $collectionObject = $results;
                    if (is_array($results)) {
                    $collectionObject = new \StdClass;
                    Severity: Minor
                    Found in src/Models/ModelCollection.php - About 1 hr to fix

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

                      private function prepareObjectRow($key, $config)
                      {
                      $value = $this->__get($key);
                       
                      // If null and allowed to be null, return null
                      Severity: Minor
                      Found in src/BaseModel.php - About 1 hr to fix

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

                      private function processResultItem($resultItem, $config)
                      {
                      if ($this->isValidPrimitive($resultItem, $config['type'])) {
                      return $resultItem;
                      }
                      Severity: Minor
                      Found in src/BaseModel.php - About 1 hr to fix

                        Avoid using undefined variables such as '$libraryErrorMessages' which will lead to PHP notices.
                        Open

                        ExceptionMessages::$libraryErrorMessages[$code]
                        Severity: Minor
                        Found in src/Exception/LibraryException.php by phpmd

                        Avoid using undefined variables such as '$strings' which will lead to PHP notices.
                        Open

                        ExceptionMessages::$strings[$code],
                        Severity: Minor
                        Found in src/Request/RequestHandler.php by phpmd

                        Avoid using undefined variables such as '$configErrorMessages' which will lead to PHP notices.
                        Open

                        ExceptionMessages::$configErrorMessages[$code]
                        Severity: Minor
                        Found in src/Exception/ConfigException.php by phpmd

                        Avoid using undefined variables such as '$modelErrorMessages' which will lead to PHP notices.
                        Open

                        ExceptionMessages::$modelErrorMessages[$code]
                        Severity: Minor
                        Found in src/Exception/ModelException.php by phpmd

                        Avoid using undefined variables such as '$modelCollectionErrorMessages' which will lead to PHP notices.
                        Open

                        ExceptionMessages::$modelCollectionErrorMessages[$code],

                        Avoid using undefined variables such as '$validationMessages' which will lead to PHP notices.
                        Open

                        ExceptionMessages::$validationMessages[$code]
                        Severity: Minor
                        Found in src/Exception/ValidationException.php by phpmd

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

                        public function makeRequest(string $method, string $uri, array $options, array $parameters)
                        {
                        if (!in_array($method, $this->verbs)) {
                        throw new RequestHandlerException('405 Bad HTTP Verb', RequestHandlerException::HTTP_VERB_ERROR);
                        }
                        Severity: Minor
                        Found in src/Request/RequestHandler.php - About 1 hr to fix

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

                        private function prepareObjectRow($key, $config)
                        {
                        $value = $this->__get($key);
                         
                        // If null and allowed to be null, return null
                        Severity: Minor
                        Found in src/BaseModel.php - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language