comsave/salesforce-mapper-bundle

View on GitHub

Showing 38 of 38 total issues

Contact has 128 functions (exceeds 20 allowed). Consider refactoring.
Open

class Contact extends AbstractModel
{
    /**
     * @var Account
     * @Salesforce\Relation(field="AccountId", name="Account",
Severity: Major
Found in src/LogicItLab/Salesforce/MapperBundle/Model/Contact.php - About 2 days to fix

    User has 125 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class User extends AbstractModel
    {
        /**
         * @var stirng
         * @Salesforce\Field(name="AboutMe")
    Severity: Major
    Found in src/LogicItLab/Salesforce/MapperBundle/Model/User.php - About 2 days to fix

      Opportunity has 95 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Opportunity extends AbstractModel
      {
          /**
           * @var Account
           * @Salesforce\Relation(field="AccountId", name="Account",
      Severity: Major
      Found in src/LogicItLab/Salesforce/MapperBundle/Model/Opportunity.php - About 1 day to fix

        Account has 90 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Account extends AbstractModel
        {
            /**
             * @var MappedRecordIterator
             * @Salesforce\Relation(name="AccountContactRoles",
        Severity: Major
        Found in src/LogicItLab/Salesforce/MapperBundle/Model/Account.php - About 1 day to fix

          Task has 70 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Task extends AbstractModel
          {
              /**
               * @var Account
               * @Salesforce\Relation(field="AccountId", name="Account",
          Severity: Major
          Found in src/LogicItLab/Salesforce/MapperBundle/Model/Task.php - About 1 day to fix

            File Contact.php has 587 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            namespace LogicItLab\Salesforce\MapperBundle\Model;
            
            use DateTime;
            Severity: Major
            Found in src/LogicItLab/Salesforce/MapperBundle/Model/Contact.php - About 1 day to fix

              File User.php has 574 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              namespace LogicItLab\Salesforce\MapperBundle\Model;
              
              use DateTime;
              Severity: Major
              Found in src/LogicItLab/Salesforce/MapperBundle/Model/User.php - About 1 day to fix

                File Opportunity.php has 484 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace LogicItLab\Salesforce\MapperBundle\Model;
                
                use DateTime;
                Severity: Minor
                Found in src/LogicItLab/Salesforce/MapperBundle/Model/Opportunity.php - About 7 hrs to fix

                  File Mapper.php has 460 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  namespace LogicItLab\Salesforce\MapperBundle;
                  
                  use DateTime;
                  Severity: Minor
                  Found in src/LogicItLab/Salesforce/MapperBundle/Mapper.php - About 7 hrs to fix

                    Function mapToSalesforceObject has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function mapToSalesforceObject($model)
                        {
                            $sObject = new stdClass;
                            $sObject->fieldsToNull = array();
                    
                    
                    Severity: Minor
                    Found in src/LogicItLab/Salesforce/MapperBundle/Mapper.php - About 6 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

                    File Account.php has 435 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    namespace LogicItLab\Salesforce\MapperBundle\Model;
                    
                    use DateTime;
                    Severity: Minor
                    Found in src/LogicItLab/Salesforce/MapperBundle/Model/Account.php - About 6 hrs to fix

                      Lead has 32 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Lead extends AbstractModel
                      {
                          /**
                           * @var string
                           * @Salesforce\Field(name="Name")
                      Severity: Minor
                      Found in src/LogicItLab/Salesforce/MapperBundle/Model/Lead.php - About 4 hrs to fix

                        File Task.php has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        namespace LogicItLab\Salesforce\MapperBundle\Model;
                        
                        use DateTime;
                        Severity: Minor
                        Found in src/LogicItLab/Salesforce/MapperBundle/Model/Task.php - About 3 hrs to fix

                          Name has 28 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class Name
                          {
                              /**
                               * @var string
                               * @Salesforce\Field(name="Id")
                          Severity: Minor
                          Found in src/LogicItLab/Salesforce/MapperBundle/Model/Name.php - About 3 hrs to fix

                            Mapper has 26 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class Mapper
                            {
                                /**
                                 * Salesforce client
                                 *
                            Severity: Minor
                            Found in src/LogicItLab/Salesforce/MapperBundle/Mapper.php - About 3 hrs to fix

                              Function getFields has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getFields($modelClass, $includeRelatedLevels, $ignoreObject = null)
                                  {
                                      $fields = array();
                              
                                      foreach ($this->annotationReader->getSalesforceFields($modelClass) as $field) {
                              Severity: Minor
                              Found in src/LogicItLab/Salesforce/MapperBundle/Mapper.php - About 2 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

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

                              class OpportunityLineItem extends AbstractModel
                              {
                                  /**
                                   * @var string
                                   * @Salesforce\Field(name="Description")
                              Severity: Minor
                              Found in src/LogicItLab/Salesforce/MapperBundle/Model/OpportunityLineItem.php - About 2 hrs to fix

                                Method mapToSalesforceObject has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function mapToSalesforceObject($model)
                                    {
                                        $sObject = new stdClass;
                                        $sObject->fieldsToNull = array();
                                
                                
                                Severity: Major
                                Found in src/LogicItLab/Salesforce/MapperBundle/Mapper.php - About 2 hrs to fix

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

                                  class Attachment extends AbstractModel
                                  {
                                      /**
                                       * @var string
                                       * @Salesforce\Field(name="Body")
                                  Severity: Minor
                                  Found in src/LogicItLab/Salesforce/MapperBundle/Model/Attachment.php - About 2 hrs to fix

                                    Function save has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function save($model)
                                        {
                                            if (is_array($model)) {
                                                $models = $model;
                                            } elseif ($model instanceof Traversable) {
                                    Severity: Minor
                                    Found in src/LogicItLab/Salesforce/MapperBundle/Mapper.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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language