gocodebox/lifterlms

View on GitHub

Showing 1,420 of 1,425 total issues

Method related_courses has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function related_courses( $atts ) {

        ob_start();

        if ( isset( $atts['category'] ) ) {
Severity: Minor
Found in includes/shortcodes/class.llms.shortcodes.php - About 1 hr to fix

    Method get_sidebars has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function get_sidebars() {
    
            $sidebars = array(
                apply_filters(
                    'lifterlms_register_lesson_sidebar',
    Severity: Minor
    Found in includes/class.llms.sidebars.php - About 1 hr to fix

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

          protected function set_subscriber_options( $type ) {
      
              $options = array();
      
              switch ( $type ) {
      includes/notifications/controllers/class.llms.notification.controller.lesson.complete.php on lines 121..141
      includes/notifications/controllers/class.llms.notification.controller.manual.payment.due.php on lines 133..153
      includes/notifications/controllers/class.llms.notification.controller.upcoming.payment.reminder.php on lines 180..200

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

      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

          protected function set_subscriber_options( $type ) {
      
              $options = array();
      
              switch ( $type ) {
      includes/notifications/controllers/class.llms.notification.controller.manual.payment.due.php on lines 133..153
      includes/notifications/controllers/class.llms.notification.controller.payment.retry.php on lines 118..138
      includes/notifications/controllers/class.llms.notification.controller.upcoming.payment.reminder.php on lines 180..200

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

      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

          protected function set_subscriber_options( $type ) {
      
              $options = array();
      
              switch ( $type ) {
      includes/notifications/controllers/class.llms.notification.controller.lesson.complete.php on lines 121..141
      includes/notifications/controllers/class.llms.notification.controller.payment.retry.php on lines 118..138
      includes/notifications/controllers/class.llms.notification.controller.upcoming.payment.reminder.php on lines 180..200

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

      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

          protected function set_subscriber_options( $type ) {
      
              $options = array();
      
              switch ( $type ) {
      includes/notifications/controllers/class.llms.notification.controller.lesson.complete.php on lines 121..141
      includes/notifications/controllers/class.llms.notification.controller.manual.payment.due.php on lines 133..153
      includes/notifications/controllers/class.llms.notification.controller.payment.retry.php on lines 118..138

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

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

              this.init = function( skip_dep_checks ) {
      
                  var self = this;
      
                  self.$plans = $( '#llms-access-plans' );
      Severity: Minor
      Found in assets/js/llms-metabox-product.js - About 1 hr to fix

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

            protected function init() {
        
                // For the cron.
                add_action( $this->schedule_hook, array( $this, 'dispatch_calc' ), 10, 1 );
        
        
        Severity: Minor
        Found in includes/processors/class.llms.processor.course.data.php - About 1 hr to fix

          Function bind has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  this.bind = function() {
          
                      var self = this;
          
                      if ( $( '.llms-image-field-upload' ).length ) {
          Severity: Minor
          Found in assets/js/llms-admin-settings.js - About 1 hr to fix

            Method send_data has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function send_data( $force = false ) {
            
                    // Don't trigger during AJAX Requests.
                    if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
                        return;
            Severity: Minor
            Found in includes/class.llms.tracker.php - About 1 hr to fix

              Method save_remaining_payments has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function save_remaining_payments( $order ) {
              
                      // If it's not a payment plan or cannot modify recurring payment, don't proceed.
                      if ( ! $order->has_plan_expiration() || ! $order->supports_modify_recurring_payments() ) {
                          return -1;

                Method get_nav_items has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function get_nav_items() {
                
                        $items = array();
                
                        foreach ( LLMS_Student_Dashboard::get_tabs() as $id => $data ) {
                Severity: Minor
                Found in includes/class.llms.nav.menus.php - About 1 hr to fix

                  Method restricted_by_membership has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function restricted_by_membership( $info ) {
                  
                          $membership_id = $info['restriction_id'];
                  
                          // Do nothing if we don't have a membership id.
                  Severity: Minor
                  Found in includes/class.llms.template.loader.php - About 1 hr to fix

                    Method output_notice has 30 lines of code (exceeds 25 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

                      Method handle has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function handle() {
                      
                              $options_to_wipe = array(
                                  'lifterlms_registration_generate_username',
                                  'lifterlms_registration_password_strength',

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

                            public function output() {
                        
                                // Single student.
                                if ( isset( $_GET['student_id'] ) ) {
                        
                        

                          Method output_widget has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function output_widget( $args = array() ) {
                          
                                  $args = self::get_output_widget_args( $args );
                          
                                  // Only these data types can make comparisons.
                          Severity: Minor
                          Found in includes/admin/reporting/class.llms.admin.reporting.php - About 1 hr to fix

                            Method generate_export_file has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function generate_export_file( $args = array(), $filename = null, $type = 'csv' ) {
                            
                                    // We only support CSVs and don't allow fakers.
                                    if ( ! empty( $filename ) && pathinfo( $filename, PATHINFO_EXTENSION ) !== $type ) {
                                        return false;
                            Severity: Minor
                            Found in includes/abstracts/llms.abstract.exportable.admin.table.php - About 1 hr to fix

                              Method call has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function call( $resource, $data, $method = null ) {
                              
                                      $method = is_null( $method ) ? $this->default_request_method : $method;
                              
                                      // setup headers.
                              Severity: Minor
                              Found in includes/abstracts/llms.abstract.api.handler.php - About 1 hr to fix

                                Method get_content_html has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function get_content_html() {
                                
                                        add_filter( 'llms_user_info_shortcode_user_id', array( $this, 'set_shortcode_user' ) );
                                
                                        $codes = apply_filters(
                                Severity: Minor
                                Found in includes/certificates/class.llms.certificate.user.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language