gocodebox/lifterlms

View on GitHub

Showing 1,420 of 1,425 total issues

Method is_instructor has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function is_instructor( $post_id = null ) {

        $ret = false;

        // Use current post if no post is set.
Severity: Minor
Found in includes/models/model.llms.instructor.php - About 1 hr to fix

    Method instructors_mb_store has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function instructors_mb_store( $request ) {
    
            // validate required params.
            if ( ! isset( $request['store_action'] ) || ! isset( $request['post_id'] ) ) {
    
    
    Severity: Minor
    Found in includes/class.llms.ajax.handler.php - About 1 hr to fix

      Method lost_password has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function lost_password() {
      
              // Invalid nonce or the form wasn't submitted.
              if ( ! llms_verify_nonce( '_lost_password_nonce', 'llms_lost_password', 'POST' ) ) {
                  return null;
      Severity: Minor
      Found in includes/forms/controllers/class.llms.controller.account.php - About 1 hr to fix

        Method _migrate_awards has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function _migrate_awards( $type ) {
        
            $per_page = llms_update_util_get_items_per_page();
        
            $query_args = array(
        Severity: Minor
        Found in includes/functions/updates/llms-functions-updates-600.php - About 1 hr to fix

          Method maybe_clean_earned_engagments_related_user_post_meta has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function maybe_clean_earned_engagments_related_user_post_meta( $post_id ) {
          
                  $post_types = array(
                      'llms_my_certificate',
                      'llms_my_achievement',
          Severity: Minor
          Found in includes/class.llms.post.relationships.php - About 1 hr to fix

            Function bind has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                bind: function() {
                    $( '#llms_review_submit_button' ).click(function()
                        {
                        if ($( '#review_title' ).val() !== '' && $( '#review_text' ).val() !== '') {
                            jQuery.ajax({
            Severity: Minor
            Found in assets/js/app/llms-review.js - About 1 hr 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 action has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                action: ( { increment, preid, exclude, force, skipConfig, replacements, extraReplacements } ) => {
                    const version = force ? force : getNextVersion( getCurrentVersion(), increment, preid );
            
                    if ( ! semver.valid( version ) ) {
                        logResult( `The supplied version string ${ chalk.bold( version ) } is invalid.`, 'error' );
            Severity: Minor
            Found in packages/dev/src/cmds/update-version.js - About 1 hr 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 output_notice has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function output_notice( $notice_id ) {
            
                    if ( current_user_can( 'manage_options' ) ) {
            
                        $notice = self::get_notice( $notice_id );
            Severity: Minor
            Found in includes/admin/class.llms.admin.notices.php - About 1 hr 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_manage_addons has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                private function handle_manage_addons() {
            
                    // phpcs:disable WordPress.Security.NonceVerification.Missing -- nonce is verified in $this->handle_actions() method.
            
                    $actions = apply_filters(
            Severity: Minor
            Found in includes/admin/class.llms.admin.addons.php - About 1 hr 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_ajax has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function handle_ajax( $request ) {
            
                    if ( ! $request['course_id'] || ! current_user_can( 'edit_course', $request['course_id'] ) ) {
                        return array();
                    }
            Severity: Minor
            Found in includes/admin/class.llms.admin.builder.php - About 1 hr 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 llms_create_page has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            function llms_create_page( $slug, $title = '', $content = '', $option = '' ) {
            
                $option_val = get_option( $option );
            
                // See if there's a valid page already stored for the option we're trying to create.
            Severity: Minor
            Found in includes/admin/llms.functions.admin.php - About 1 hr 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 output_tfoot_html has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public function output_tfoot_html() {
                    ?>
                    <tfoot>
                    <tr>
                        <th colspan="<?php echo esc_attr( $this->get_columns_count() ); ?>">
            Severity: Minor
            Found in includes/abstracts/abstract.llms.admin.table.php - About 1 hr 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_correct_choice has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public function get_correct_choice() {
            
                    $correct = false;
            
                    if ( $this->supports( 'choices' ) && $this->supports( 'grading', 'auto' ) ) {
            Severity: Minor
            Found in includes/models/model.llms.question.php - About 1 hr 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 instructors_mb_store has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function instructors_mb_store( $request ) {
            
                    // validate required params.
                    if ( ! isset( $request['store_action'] ) || ! isset( $request['post_id'] ) ) {
            
            
            Severity: Minor
            Found in includes/class.llms.ajax.handler.php - About 1 hr 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_field_html has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function get_field_html() {
            
                    /**
                     * Allow 3rd parties to create custom field types or their own field HTML methods.
                     *
            Severity: Minor
            Found in includes/forms/class-llms-form-field.php - About 1 hr 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 llms_get_picture_choice_question_cols has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            function llms_get_picture_choice_question_cols( $num_choices ) {
            
                /**
                 * Allow 3rd parties to override this function with a custom number of columns.
                 *
            Severity: Minor
            Found in includes/functions/llms.functions.quiz.php - About 1 hr 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 Edit has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Edit = ( props ) => {
                const { attributes, setAttributes } = props;
                const blockProps = useBlockProps();
                const isLlmsPostType = useLlmsPostType();
                const courseOptions = usePostOptions();
            Severity: Minor
            Found in src/blocks/course-syllabus/index.jsx - About 1 hr to fix

              Method get_achievements_by_post has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function get_achievements_by_post( $post_ids, $include_children = true ) {
              
                      if ( ! is_array( $post_ids ) ) {
                          $post_ids = array( $post_ids );
                      }
              Severity: Minor
              Found in includes/class.llms.achievements.php - About 1 hr to fix

                Method output_section has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function output_section( $section, $which ) {
                
                        $url = false;
                
                        if ( 'previous' === $which ) {

                  Method output has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function output() {
                  
                          $tabs = apply_filters(
                              'llms_admin_page_status_tabs',
                              array(
                  Severity: Minor
                  Found in includes/admin/class.llms.admin.page.status.php - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language