Showing 241 of 364 total issues
Method map_params
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function map_params( $mapping, $object, $trigger, $use_soap = false, $is_new = true, $object_id_field = '' ) {
Function init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function init() {
if ( false === $this->salesforce_get_api['soap_available'] ) {
return;
}
if ( ! class_exists( 'SforceBaseClient' ) && file_exists( plugin_dir_path( $this->file ) . 'vendor/autoload.php' ) ) {
- Read upRead up
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 attachment_upsert
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function attachment_upsert( $key, $value, $methods, $params, $id_field = 'ID', $check_only = false ) {
Function __toString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __toString() {
$query = 'SELECT ';
$query .= implode( ', ', $this->fields );
$query .= ' FROM ' . $this->object_type;
- Read upRead up
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 post_update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function post_update( $post_id, $params, $id_field = 'ID', $post_type = '' ) {
$content = array();
$content[ $id_field ] = $post_id;
foreach ( $params as $key => $value ) {
if ( 'wp_update_post' === $value['method_modify'] ) {
- Read upRead up
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 term_update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function term_update( $term_id, $params, $taxonomy, $id_field = 'ID' ) {
if ( 'tag' === $taxonomy ) {
$taxonomy = 'post_tag';
}
$args = array();
- Read upRead up
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
Consider simplifying this complex logical expression. Open
if ( true === $this->salesforce['is_authorized'] ) {
echo sprintf(
'<a class="nav-tab%1$s" href="%2$s">%3$s</a>',
esc_attr( $active ),
esc_url( '?page=' . $this->admin_settings_url_param . '&tab=' . $tab_key ),
Consider simplifying this complex logical expression. Open
if ( empty( $error_fieldmaps ) && empty( $error_object_maps ) && ( ! empty( $successful_fieldmaps ) || ! empty( $successful_object_maps ) ) ) {
$this->clear_cache( false );
wp_safe_redirect( get_admin_url( null, 'options-general.php?page=' . $this->admin_settings_url_param . '&tab=import-export&data_saved=true' ) );
exit;
} elseif ( ! empty( $error_fieldmaps ) && ! empty( $successful_fieldmaps ) ) {
Consider simplifying this complex logical expression. Open
if ( ( ! isset( $mapping['push_drafts'] ) || '1' !== $mapping['push_drafts'] ) && isset( $object['post_status'] ) && ( 'draft' === $object['post_status'] || ( 'inherit' === $object['post_status'] && 'attachment' !== $object['post_type'] ) ) ) {
// skip this object if it is a draft and the fieldmap settings told us to ignore it.
continue;
}
Method set_log_slug
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function set_log_slug( $override_slug, $slug, $post_ID, $post_status, $post_type ) {
Method http_request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function http_request( $url, $data, $headers = array(), $method = 'GET', $options = array() ) {
Method delete_called_from_salesforce
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function delete_called_from_salesforce( $sf_sync_trigger, $synced_object, $wordpress_id_field_name, $seconds, $mapping_objects ) {
Method api_http_request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function api_http_request( $path, $params, $method, $options = array(), $type = 'rest' ) {
Method legacy_option_upgrade
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function legacy_option_upgrade( $operation, $object_type = '', $fieldmap_id = '', $value = '', $autoload = true ) {
Method schedule_cron
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function schedule_cron( $timestamp, $cron_schedule, $hook, $args = array(), $group = '' ) {
Method create_object_map
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function create_object_map( $wordpress_object, $id_field_name, $salesforce_id, $field_mapping, $pending = false ) {
Method setup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setup( $title_or_params, $message = '', $trigger = 0, $parent = 0, $status = '' ) {
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct( $condition, $message, $dismissible, $type, $template ) {
Method is_pull_allowed
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function is_pull_allowed( $object_type, $object, $sf_sync_trigger, $salesforce_mapping, $map_sync_triggers ) {
Method schedule_recurring
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function schedule_recurring( $timestamp, $interval_in_seconds, $hook, $args = array(), $group = '' ) {