gocodebox/lifterlms-rest

View on GitHub

Showing 191 of 191 total issues

Avoid too many return statements within this method.
Open

            return $fields_update;
Severity: Major
Found in includes/server/class-llms-rest-enrollments-controller.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return false;
    Severity: Major
    Found in includes/admin/class-llms-rest-admin-form-controller.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return $response;
      Severity: Major
      Found in includes/abstracts/class-llms-rest-controller.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $meta_update;
        Severity: Major
        Found in includes/abstracts/class-llms-rest-posts-controller.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $terms_update;
          Severity: Major
          Found in includes/abstracts/class-llms-rest-posts-controller.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return $fields_update;
            Severity: Major
            Found in includes/abstracts/class-llms-rest-posts-controller.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $fields_update;
              Severity: Major
              Found in includes/server/class-llms-rest-enrollments-controller.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return $response;
                Severity: Major
                Found in includes/abstracts/class-llms-rest-posts-controller.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return $meta_update;
                  Severity: Major
                  Found in includes/abstracts/class-llms-rest-posts-controller.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return $this->prepare_item_for_response( $object, $request );
                    Severity: Major
                    Found in includes/abstracts/class-llms-rest-posts-controller.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $prepared;
                      Severity: Major
                      Found in includes/abstracts/class-llms-rest-controller.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return $response;
                        Severity: Major
                        Found in includes/abstracts/class-llms-rest-controller.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return $response;
                          Severity: Major
                          Found in includes/abstracts/class-llms-rest-posts-controller.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return $updated_date_created;
                            Severity: Major
                            Found in includes/server/class-llms-rest-enrollments-controller.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return llms_rest_server_error( __( 'The enrollment creation date could not be updated', 'lifterlms' ) );
                              Severity: Major
                              Found in includes/server/class-llms-rest-enrollments-controller.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return 0;
                                Severity: Major
                                Found in includes/abstracts/class-llms-rest-controller-stubs.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return $user_id;
                                  Severity: Major
                                  Found in includes/class-llms-rest-authentication.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                            return true;
                                    Severity: Major
                                    Found in includes/models/class-llms-rest-webhook.php - About 30 mins to fix

                                      Function prepare_collection_query_args has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          protected function prepare_collection_query_args( $request ) {
                                      
                                              $query_args = parent::prepare_collection_query_args( $request );
                                              if ( is_wp_error( $query_args ) ) {
                                                  return $query_args;
                                      Severity: Minor
                                      Found in includes/server/class-llms-rest-lessons-controller.php - About 25 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 handle_terms has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          protected function handle_terms( $object_id, $request ) {
                                      
                                              $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_llms_rest' => true ) );
                                      
                                              foreach ( $taxonomies as $taxonomy ) {
                                      Severity: Minor
                                      Found in includes/abstracts/class-llms-rest-posts-controller.php - About 25 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