MinnPost/object-sync-for-salesforce

View on GitHub

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(
Severity: Minor
Found in classes/class-object-sync-sf-admin.php - About 1 hr to fix

    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();
    Severity: Minor
    Found in classes/class-object-sync-sf-rest.php - About 1 hr to fix

      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;
      Severity: Minor
      Found in classes/class-object-sync-sf-admin.php - About 1 hr to fix

        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() ) {
        Severity: Major
        Found in classes/class-object-sync-sf-wordpress.php - About 1 hr to fix

          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 = '' ) {
          Severity: Major
          Found in classes/class-object-sync-sf-salesforce.php - About 1 hr to fix

            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 ) {
            Severity: Major
            Found in classes/class-object-sync-sf-wordpress.php - About 1 hr to fix

              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 ) {
              Severity: Major
              Found in classes/class-object-sync-sf-wordpress.php - About 1 hr to fix

                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,
                            );
                Severity: Minor
                Found in classes/class-object-sync-sf-mapping.php - About 55 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_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 ) {
                Severity: Minor
                Found in classes/class-object-sync-sf-wordpress.php - About 55 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 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';
                Severity: Minor
                Found in classes/class-object-sync-sf-activate.php - About 55 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 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'];
                Severity: Minor
                Found in classes/class-object-sync-sf-wordpress.php - About 55 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 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(
                Severity: Minor
                Found in classes/class-object-sync-sf-wordpress.php - About 55 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_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'];
                
                
                Severity: Minor
                Found in classes/class-object-sync-sf-wordpress.php - About 55 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_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'];
                
                
                Severity: Minor
                Found in classes/class-object-sync-sf-wordpress.php - About 55 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

                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 ) {
                Severity: Major
                Found in classes/class-object-sync-sf-wordpress.php - About 50 mins to fix

                  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 ) {
                  Severity: Major
                  Found in classes/class-object-sync-sf-salesforce-pull.php - About 50 mins to fix

                    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 ) {
                    Severity: Major
                    Found in classes/class-object-sync-sf-wordpress.php - About 50 mins to fix

                      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 ) {
                      Severity: Major
                      Found in classes/class-object-sync-sf-wordpress.php - About 50 mins to fix

                        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'];
                        Severity: Minor
                        Found in classes/class-object-sync-sf-admin.php - About 45 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 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' ) ) {
                        Severity: Minor
                        Found in classes/class-object-sync-sf-salesforce-soap-partner.php - About 45 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

                        Severity
                        Category
                        Status
                        Source
                        Language