gocodebox/lifterlms

View on GitHub

Showing 1,420 of 1,425 total issues

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

    public function init( $args ) {

        $this->student    = new WP_User( $args['person_id'] );
        $this->email_post = get_post( $args['email_id'] );

Severity: Minor
Found in includes/emails/class.llms.email.engagement.php - About 1 hr to fix

    Method install has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function install() {
    
            if ( ! is_blog_installed() ) {
                return;
            }
    Severity: Minor
    Found in includes/class.llms.install.php - About 1 hr to fix

      Method get_order_data has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function get_order_data( $order ) {
      
              $data = array();
      
              $props = self::get_order_data_props( 'export' );
      Severity: Minor
      Found in includes/privacy/class-llms-privacy-exporters.php - About 1 hr to fix

        Method prepare_value has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function prepare_value() {
        
                // Never autoload passwords and or fields with an explicit value (except radio and checkbox).
                if ( 'password' === $this->settings['type'] || ! empty( $this->settings['value'] && ! in_array( $this->settings['type'], array( 'checkbox', 'radio' ), true ) ) ) {
                    return;
        Severity: Minor
        Found in includes/forms/class-llms-form-field.php - About 1 hr to fix

          Method includes_admin has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function includes_admin() {
          
                  // Functions.
                  require_once LLMS_PLUGIN_DIR . 'includes/admin/llms.functions.admin.php';
          
          
          Severity: Minor
          Found in includes/class-llms-loader.php - About 1 hr to fix

            Method user_can_manage_user has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function user_can_manage_user( $user_id, $edit_id ) {
            
                    $user = get_user_by( 'id', $user_id );
            
                    /**
            Severity: Minor
            Found in includes/class.llms.user.permissions.php - About 1 hr to fix

              Method favorite_object has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function favorite_object() {
              
                      // Grab the data if it exists.
                      $user_action = llms_filter_input_sanitize_string( INPUT_POST, 'user_action' );
                      $object_id   = llms_filter_input( INPUT_POST, 'object_id', FILTER_SANITIZE_NUMBER_INT );
              Severity: Minor
              Found in includes/class.llms.ajax.php - About 1 hr to fix

                Method show_notice has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function show_notice() {
                
                    $notice_id = sprintf( 'v%s-welcome-msg', str_replace( array( '.', '-' ), '', _get_db_version() ) );
                
                    $get_started_link = admin_url( 'post-new.php?post_type=llms_certificate' );
                Severity: Minor
                Found in includes/functions/updates/llms-functions-updates-600.php - About 1 hr to fix

                  Method llms_agree_to_terms_form_field has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function llms_agree_to_terms_form_field( $echo = true ) {
                  
                          // Because `do_action()` passes empty string.
                          if ( '' === $echo ) {
                              $echo = true;
                  Severity: Minor
                  Found in includes/functions/llms.functions.templates.privacy.php - About 1 hr to fix

                    Method course_info has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function course_info( $atts ) {
                            extract(
                                shortcode_atts(
                                    array(
                                        'date_format' => 'F j, Y', // If $type is date, a custom date format can be supplied.
                    Severity: Minor
                    Found in includes/shortcodes/class.llms.shortcodes.php - About 1 hr to fix

                      Method lifterlms_template_student_dashboard_my_certificates has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function lifterlms_template_student_dashboard_my_certificates( $preview = false ) {
                      
                              $student = llms_get_student();
                              if ( ! $student ) {
                                  return;
                      Severity: Minor
                      Found in includes/functions/llms.functions.templates.dashboard.php - About 1 hr to fix

                        Method lifterlms_template_student_dashboard_my_achievements has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function lifterlms_template_student_dashboard_my_achievements( $preview = false ) {
                        
                                $student = llms_get_student();
                                if ( ! $student ) {
                                    return;
                        Severity: Minor
                        Found in includes/functions/llms.functions.templates.dashboard.php - About 1 hr to fix

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

                                              array(
                                                  'type'            => 'select',
                                                  'label'           => __( 'Courses', 'lifterlms' ),
                                                  'desc'            => __( 'Limit coupon to the following courses.', 'lifterlms' ),
                                                  'id'              => $this->prefix . 'coupon_courses',
                          includes/admin/post-types/meta-boxes/class.llms.meta.box.coupon.php on lines 182..195

                          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 102.

                          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

                                              array(
                                                  'type'            => 'select',
                                                  'label'           => __( 'Membership', 'lifterlms' ),
                                                  'desc'            => __( 'Limit coupon to the following memberships.', 'lifterlms' ),
                                                  'id'              => $this->prefix . 'coupon_membership',
                          includes/admin/post-types/meta-boxes/class.llms.meta.box.coupon.php on lines 168..181

                          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 102.

                          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

                                          if ($( '#review_title' ).val() === '') {
                                              $( '#review_title_error' ).show( 'swing' );
                                          } else {
                                              $( '#review_title_error' ).hide( 'swing' );
                                          }
                          Severity: Major
                          Found in assets/js/app/llms-review.js and 1 other location - About 1 hr to fix
                          assets/js/app/llms-review.js on lines 57..61

                          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 56.

                          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

                                          if ($( '#review_text' ).val() === '') {
                                              $( '#review_text_error' ).show( 'swing' );
                                          } else {
                                              $( '#review_text_error' ).hide( 'swing' );
                                          }
                          Severity: Major
                          Found in assets/js/app/llms-review.js and 1 other location - About 1 hr to fix
                          assets/js/app/llms-review.js on lines 52..56

                          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 56.

                          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 check_strength has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              check_strength: function() {
                          
                                  var $pass_field = this.$pass.closest( '.llms-form-field' ),
                                      $conf_field = this.$conf && this.$conf.length ? this.$conf.closest( '.llms-form-field' ) : null,
                                      pass_length = this.$pass.val().length,
                          Severity: Minor
                          Found in assets/js/app/llms-password-strength.js - About 1 hr to fix

                            Function init_relationships has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    init_relationships: function( options ) {
                            
                                        var rels = this.get_relationships();
                            
                                        // initialize parent relationships
                            Severity: Minor
                            Found in assets/js/builder/Models/_Relationships.js - About 1 hr to fix

                              Function processResults has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                              processResults: function( data, params ) {
                              
                                                  // recursive function for creating
                                                  function map_data( items ) {
                              
                              
                              Severity: Minor
                              Found in assets/js/llms-admin.js - About 1 hr to fix

                                Function add_existing_assignment_click has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            add_existing_assignment_click: function( event ) {
                                
                                                event.preventDefault();
                                
                                                if ( this.is_addon_available() ) {
                                Severity: Minor
                                Found in assets/js/builder/Views/Assignment.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language