Showing 241 of 364 total issues
Method create_called_from_salesforce
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function create_called_from_salesforce( $sf_sync_trigger, $synced_object, $params, $prematch, $wordpress_id_field_name, $seconds ) {
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 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
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 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
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
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;
}
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 ) ) {
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 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 ) {
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct( $condition, $message, $dismissible, $type, $template ) {
Method setup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setup( $title_or_params, $message = '', $trigger = 0, $parent = 0, $status = '' ) {
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 ) {
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 schedule_cron
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function schedule_cron( $timestamp, $cron_schedule, $hook, $args = array(), $group = '' ) {
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 ) {
Method set
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function set( $operation, $object_type = '', $fieldmap_id = '', $value = '', $expiration = 0 ) {
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 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 ) {