MinnPost/object-sync-for-salesforce

View on GitHub

Showing 241 of 364 total issues

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

    public function api_call( $path, $params = array(), $method = 'GET', $options = array(), $type = 'rest' ) {
Severity: Minor
Found in classes/class-object-sync-sf-salesforce.php - About 35 mins to fix

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

        public function analytics_api( $name, $id, $route = '', $params = array(), $method = 'GET' ) {
    Severity: Minor
    Found in classes/class-object-sync-sf-salesforce.php - About 35 mins to fix

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

          private function update_called_from_salesforce( $sf_sync_trigger, $synced_object, $params, $wordpress_id_field_name, $seconds ) {
      Severity: Minor
      Found in classes/class-object-sync-sf-salesforce-pull.php - About 35 mins to fix

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

            public function set( $operation, $object_type = '', $fieldmap_id = '', $value = '', $autoload = false ) {
        Severity: Minor
        Found in classes/class-object-sync-sf-pull-options.php - About 35 mins to fix

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

              public function set( $operation, $object_type = '', $fieldmap_id = '', $value = '', $expiration = 0 ) {
          Severity: Minor
          Found in classes/class-object-sync-sf-sync-transients.php - About 35 mins to fix

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

                private function legacy_transient_upgrade( $operation, $object_type = '', $fieldmap_id = '', $value = '', $expiration = 0 ) {
            Severity: Minor
            Found in classes/class-object-sync-sf-sync-transients.php - About 35 mins to fix

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

                  private function is_push_allowed( $object_type, $object, $sf_sync_trigger, $mapping, $map_sync_triggers ) {
              Severity: Minor
              Found in classes/class-object-sync-sf-salesforce-push.php - About 35 mins to fix

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

                    public function posts_filter( $query ) {
                        global $pagenow;
                        $type     = 'wp_log';
                        $taxonomy = 'wp_log_type';
                        if ( is_admin() && 'edit.php' === $pagenow ) {
                Severity: Minor
                Found in classes/class-object-sync-sf-logging.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 check_deprecated_salesforce_api_version has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function check_deprecated_salesforce_api_version( $sf_api_version ) {
                        $deprecated_api_version = defined( 'OBJECT_SYNC_SF_SALESFORCE_API_VERSION' ) ? OBJECT_SYNC_SF_SALESFORCE_API_VERSION : '';
                        // if the constant exists.
                        if ( '' === $deprecated_api_version ) {
                            $deprecated_option_key = $this->option_prefix . 'api_version';
                Severity: Minor
                Found in classes/class-object-sync-salesforce.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 create_object_map has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function create_object_map( $posted = array() ) {
                        $data            = $this->setup_object_map_data( $posted );
                        $data['created'] = current_time( 'mysql' );
                        // Check to see if we don't know the salesforce id and it is not a temporary id, or if this is pending.
                        // If it is using a temporary id, the map will get updated after it finishes running; it won't call this method unless there's an error, which we should log.
                Severity: Minor
                Found in classes/class-object-sync-sf-mapping.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 clear_cache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function clear_cache( $ajax = false ) {
                        $result  = $this->wordpress->sfwp_transients->flush();
                        $success = $result['success'];
                        if ( 0 < $result['count'] ) {
                            if ( true === $success ) {
                Severity: Minor
                Found in classes/class-object-sync-sf-admin.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 object_describe has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function object_describe( $name, $reset = false ) {
                        if ( empty( $name ) ) {
                            return array();
                        }
                        $options = array(
                Severity: Minor
                Found in classes/class-object-sync-sf-salesforce.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 check_log_schedule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function check_log_schedule( $old_value, $new_value, $option ) {
                        $clear_schedule  = false;
                        $schedule_unit   = get_option( $this->option_prefix . 'logs_how_often_unit', '' );
                        $schedule_number = filter_var( get_option( $this->option_prefix . 'logs_how_often_number', '' ), FILTER_VALIDATE_INT );
                        if ( $this->option_prefix . 'logs_how_often_unit' === $option ) {
                Severity: Minor
                Found in classes/class-object-sync-sf-logging.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 comment_update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function comment_update( $comment_id, $params, $id_field = 'comment_ID' ) {
                        $content              = array();
                        $content[ $id_field ] = $comment_id;
                        foreach ( $params as $key => $value ) {
                            if ( 'wp_update_comment' === $value['method_modify'] ) {
                Severity: Minor
                Found in classes/class-object-sync-sf-wordpress.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

                Avoid too many return statements within this method.
                Open

                        return $this->schedulable_classes;
                Severity: Major
                Found in classes/class-object-sync-sf-queue.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return $existing_id;
                  Severity: Major
                  Found in classes/class-object-sync-sf-wordpress.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return $result;
                    Severity: Major
                    Found in classes/class-object-sync-sf-wordpress.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return true;
                      Severity: Major
                      Found in classes/class-object-sync-sf-rest.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                            return $string;
                        Severity: Major
                        Found in bin/wp-readme.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return $result;
                          Severity: Major
                          Found in classes/class-object-sync-sf-salesforce-push.php - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language