gocodebox/lifterlms

View on GitHub

Showing 1,420 of 1,425 total issues

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

    public function output() {

        global $post;

        parent::output();

    Method modify_admin_search has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function modify_admin_search( $query ) {
    
            // On the admin posts order table.
            // Allow searching of custom fields.
            if ( is_admin() && ! empty( $query->query_vars['s'] ) && isset( $query->query_vars['post_type'] ) && 'llms_order' === $query->query_vars['post_type'] ) {

      Method add_review_meta_boxes has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function add_review_meta_boxes( $content ) {
      
              /**
               * This array is what holds the updated fields.
               * It is created in such a way so that a plugin
      Severity: Major
      Found in includes/admin/class.llms.admin.reviews.php - About 2 hrs to fix

        Method get_results has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function get_results( $args = array() ) {
        
                $this->title = __( 'Memberships', 'lifterlms' );
        
                $args = $this->clean_args( $args );
        Severity: Major
        Found in includes/admin/reporting/tables/llms.table.memberships.php - About 2 hrs to fix

          Method autoload has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function autoload( $class ) {
          
                  $class = strtolower( $class );
                  if ( 0 !== strpos( $class, 'llms_' ) && 'lifterlms' !== $class && 'meta_box_field_interface' !== $class ) {
                      return;
          Severity: Major
          Found in includes/class-llms-loader.php - About 2 hrs to fix

            Method init has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function init() {
            
                    // New method.
                    $scs = apply_filters(
                        /**
            Severity: Major
            Found in includes/shortcodes/class.llms.shortcodes.php - About 2 hrs to fix

              Method lifterlms_student_dashboard has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function lifterlms_student_dashboard( $options = array() ) {
              
                      $options = wp_parse_args(
                          $options,
                          array(
              Severity: Major
              Found in includes/functions/llms.functions.templates.dashboard.php - About 2 hrs to fix

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                                    <PanelRow>
                                        <TextControl
                                            label={ __( 'Text', 'lifterlms' ) }
                                            help={ __(
                                                'The text to display on the button.',
                Severity: Major
                Found in src/blocks/access-plan-button/index.jsx and 3 other locations - About 2 hrs to fix
                src/blocks/course-outline/index.jsx on lines 52..61
                src/blocks/course-outline/index.jsx on lines 63..72
                src/blocks/my-achievements/index.jsx on lines 66..75

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 76.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                <PanelRow>
                                    <TextControl
                                        label={ __( 'Membership ID', 'lifterlms' ) }
                                        value={ attributes.id }
                                        onChange={ ( value ) => setAttributes( { id: value } ) }
                Severity: Major
                Found in src/blocks/memberships/index.jsx and 1 other location - About 2 hrs to fix
                src/blocks/courses/index.jsx on lines 93..100

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 76.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                                    <PanelRow>
                                        <ToggleControl
                                            label={ __( 'Toggles', 'lifterlms' ) }
                                            help={ __( 'If true, will display "Collapse All" and "Expand All" toggles at the bottom of the outline. Only functions if "collapse" is true.', 'lifterlms' ) }
                                            checked={ attributes.toggles }
                Severity: Major
                Found in src/blocks/course-outline/index.jsx and 3 other locations - About 2 hrs to fix
                src/blocks/access-plan-button/index.jsx on lines 170..180
                src/blocks/course-outline/index.jsx on lines 52..61
                src/blocks/my-achievements/index.jsx on lines 66..75

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 76.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                                <PanelRow>
                                    <NumberControl
                                        label={ __( 'Count', 'lifterlms' ) }
                                        help={ __( 'Number of achievements to display. Leave empty to display all achievements for user.', 'lifterlms' ) }
                                        value={ attributes.count }
                Severity: Major
                Found in src/blocks/my-achievements/index.jsx and 3 other locations - About 2 hrs to fix
                src/blocks/access-plan-button/index.jsx on lines 170..180
                src/blocks/course-outline/index.jsx on lines 52..61
                src/blocks/course-outline/index.jsx on lines 63..72

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 76.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                                <PanelRow>
                                    <ToggleControl
                                        label={ __( 'Collapse', 'lifterlms' ) }
                                        help={ __( 'If true, will make the outline sections collapsible via click events.', 'lifterlms' ) }
                                        checked={ attributes.collapse }
                Severity: Major
                Found in src/blocks/course-outline/index.jsx and 3 other locations - About 2 hrs to fix
                src/blocks/access-plan-button/index.jsx on lines 170..180
                src/blocks/course-outline/index.jsx on lines 63..72
                src/blocks/my-achievements/index.jsx on lines 66..75

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 76.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                <PanelRow>
                                    <ToggleControl
                                        label={ __( 'Show hidden courses?', 'lifterlms' ) }
                                        checked={ attributes.hidden }
                                        onChange={ ( value ) => setAttributes( { hidden: value } ) }
                Severity: Major
                Found in src/blocks/courses/index.jsx and 1 other location - About 2 hrs to fix
                src/blocks/memberships/index.jsx on lines 83..90

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 76.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                File class.llms.settings.engagements.php has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Admin Settings Page: Engagements
                 *
                 * @package LifterLMS/Admin/Settings/Classes
                Severity: Minor
                Found in includes/admin/settings/class.llms.settings.engagements.php - About 2 hrs to fix

                  File class.llms.roles.php has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * LLMS_Roles class.
                   *
                   * @package LifterLMS/Classes
                  Severity: Minor
                  Found in includes/class.llms.roles.php - About 2 hrs to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        public function restricted_by_course_prerequisite( $info ) {
                    
                            if ( 'course' === get_post_type( $info['content_id'] ) ) {
                                return;
                            }
                    Severity: Major
                    Found in includes/class.llms.template.loader.php and 1 other location - About 2 hrs to fix
                    includes/class.llms.template.loader.php on lines 164..178

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 122.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        public function restricted_by_course_track_prerequisite( $info ) {
                    
                            if ( 'course' === get_post_type( $info['content_id'] ) ) {
                                return;
                            }
                    Severity: Major
                    Found in includes/class.llms.template.loader.php and 1 other location - About 2 hrs to fix
                    includes/class.llms.template.loader.php on lines 192..206

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 122.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Function Edit has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const Edit = ( props ) => {
                        const { attributes, setAttributes } = props;
                        const blockProps = useBlockProps();
                        const courseOptions = usePostOptions();
                    
                    
                    Severity: Major
                    Found in src/blocks/pricing-table/index.jsx - About 2 hrs to fix

                      Method codes_section_html has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function codes_section_html() {
                      
                              global $post;
                              $voucher = new LLMS_Voucher( $post->ID );
                              $codes   = $voucher->get_voucher_codes();
                      Severity: Major
                      Found in includes/admin/post-types/meta-boxes/class.llms.meta.box.voucher.php - About 2 hrs to fix

                        Method set_query has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function set_query() {
                        
                                global $wpdb;
                        
                                $txn_meta_join  = '';
                          Severity
                          Category
                          Status
                          Source
                          Language