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' ) {
Method analytics_api
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function analytics_api( $name, $id, $route = '', $params = array(), $method = 'GET' ) {
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
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function set( $operation, $object_type = '', $fieldmap_id = '', $value = '', $autoload = false ) {
Method set
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function set( $operation, $object_type = '', $fieldmap_id = '', $value = '', $expiration = 0 ) {
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 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 ) {
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 ) {
- 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 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';
- 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 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.
- 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 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 ) {
- 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_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(
- 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 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 ) {
- 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 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'] ) {
- 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
Avoid too many return
statements within this method. Open
return $this->schedulable_classes;
Avoid too many return
statements within this method. Open
return $existing_id;
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $string;
Avoid too many return
statements within this method. Open
return $result;