romanpitak/dotMailer-API-v2-PHP-client

View on GitHub

Showing 7 of 7 total issues

Resources has 102 functions (exceeds 20 allowed). Consider refactoring.
Open

final class Resources implements IResources
{
    /** @var IClient */
    private $restClient;

Severity: Major
Found in src/Resources/Resources.php - About 1 day to fix

    File Resources.php has 543 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     *
     *
     * @author Roman Piták <roman@pitak.net>
    Severity: Major
    Found in src/Resources/Resources.php - About 1 day to fix

      Method getProperties has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getProperties()
          {
              return array(
                  'DateSent' => 'XsDateTime',
                  'NumUniqueOpens' => 'XsInt',
      Severity: Major
      Found in src/DataTypes/ApiCampaignSummary.php - About 2 hrs to fix

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

            public function execute($param_arr, $responses = array())
            {
        
                // when only url is supplied
                if (is_string($param_arr)) {
        Severity: Minor
        Found in src/Rest/Client.php - About 1 hr to fix

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

              public function __construct($value = null)
              {
                  // if value is supplied
                  if (!is_null($value)) {
                      if (!is_array($value)) { // convert to array
          Severity: Minor
          Found in src/DataTypes/MagicArray.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 GetAddressBookContactsModifiedSinceDate has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function GetAddressBookContactsModifiedSinceDate($addressBookId, $date, $withFullData = false, $select = 1000, $skip = 0);
          Severity: Minor
          Found in src/Resources/IResources.php - About 35 mins to fix

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

                public function GetAddressBookContactsModifiedSinceDate($addressBookId, $date, $withFullData = false, $select = 1000, $skip = 0)
            Severity: Minor
            Found in src/Resources/Resources.php - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language