Showing 241 of 364 total issues
Method show_salesforce_user_fields
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show_salesforce_user_fields( $user ) {
$get_data = filter_input_array( INPUT_GET, FILTER_SANITIZE_SPECIAL_CHARS );
if ( true === $this->check_wordpress_admin_permissions() ) {
$mappings = $this->mappings->load_all_by_wordpress( 'user', $user->ID );
$fieldmap = $this->mappings->get_fieldmaps(
Method process
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process( WP_REST_Request $request ) {
// see methods: https://developer.wordpress.org/reference/classes/wp_rest_request/
// use error_log( 'request is ' . print_r( $request, true ) ); to log the request.
$http_method = $request->get_method();
$route = $request->get_route();
Method __construct
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
$this->version = object_sync_for_salesforce()->version;
$this->file = object_sync_for_salesforce()->file;
$this->wpdb = object_sync_for_salesforce()->wpdb;
$this->slug = object_sync_for_salesforce()->slug;
Method run_analytics_report
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function run_analytics_report( $id, $async = true, $clear_cache = false, $params = array(), $method = 'GET', $report_cache_expiration = '', $cache_instance = true, $instance_cache_expiration = '' ) {
Method object_fields
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
private function object_fields( $object_name, $id_field, $content_table, $content_methods, $meta_table, $meta_methods, $where, $ignore_keys = array() ) {
Method post_upsert
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
private function post_upsert( $key, $value, $methods, $params, $id_field = 'ID', $pull_to_drafts = false, $post_type = 'post', $check_only = false ) {
Method term_upsert
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
private function term_upsert( $key, $value, $methods, $params, $taxonomy, $id_field = 'ID', $pull_to_drafts = false, $check_only = false ) {
Function wordpress_salesforce_tables
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function wordpress_salesforce_tables() {
$charset_collate = $this->wpdb->get_charset_collate();
$field_map_table = $this->wpdb->prefix . 'object_sync_sf_field_map';
- 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 delete_object_map
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function delete_object_map( $id = '' ) {
if ( is_string( $id ) || is_int( $id ) ) {
$data = array(
'id' => $id,
);
- 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 get_wordpress_table_structure
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function get_wordpress_table_structure( $object_type ) {
if ( 'attachment' === $object_type ) {
$object_table_structure = array(
'object_name' => 'post',
'content_methods' => 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 object_delete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function object_delete( $name, $id ) {
$structure = $this->get_wordpress_table_structure( $name );
$id_field = $structure['id_field'];
switch ( $name ) {
- 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 get_wordpress_object_data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function get_wordpress_object_data( $object_type, $object_id, $is_deleted = false ) {
$wordpress_object = array();
$object_table_structure = $this->get_wordpress_table_structure( $object_type );
$meta_table = $object_table_structure['meta_table'];
- 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 object_update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function object_update( $name, $id, $params, $mapping_object = array() ) {
$structure = $this->get_wordpress_table_structure( $name );
$id_field = $structure['id_field'];
- 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 object_create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function object_create( $name, $params ) {
$structure = $this->get_wordpress_table_structure( $name );
$id_field = $structure['id_field'];
- 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 get_next_record_batch
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private function get_next_record_batch( $last_sync, $salesforce_mapping, $map_sync_triggers, $type, $version_path, $query_options, $response ) {
Method comment_upsert
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private function comment_upsert( $key, $value, $methods, $params, $id_field = 'comment_ID', $pull_to_drafts = false, $check_only = false ) {
Method user_upsert
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private function user_upsert( $key, $value, $methods, $params, $id_field = 'ID', $pull_to_drafts = false, $check_only = false ) {
Method object_upsert
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function object_upsert( $name, $key, $value, $methods, $params, $pull_to_drafts = false, $check_only = false ) {
Function tabs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function tabs( $tabs, $tab = '' ) {
$get_data = filter_input_array( INPUT_GET, FILTER_SANITIZE_SPECIAL_CHARS );
$consumer_key = $this->login_credentials['consumer_key'];
$consumer_secret = $this->login_credentials['consumer_secret'];
- 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 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 ) {