gocodebox/lifterlms

View on GitHub

Showing 1,389 of 1,394 total issues

LLMS_Add_On has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class LLMS_Add_On {

    /**
     * Add On ID
     *
Severity: Minor
Found in includes/models/model.llms.add-on.php - About 2 hrs to fix

    LLMS_User_Certificate has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class LLMS_User_Certificate extends LLMS_Abstract_User_Engagement {
    
        /**
         * Database (WP) post type name
         *
    Severity: Minor
    Found in includes/models/model.llms.user.certificate.php - About 2 hrs to fix

      LLMS_Install has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class LLMS_Install {
      
          /**
           * Instances of the bg updater.
           *
      Severity: Minor
      Found in includes/class.llms.install.php - About 2 hrs to fix

        Function llmsStudentsSelect2 has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.fn.llmsStudentsSelect2 = function( options ) {
        
                if ( ! this.length ) {
                    return this;
                }
        Severity: Major
        Found in assets/js/llms-admin.js - About 2 hrs to fix

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

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

            Method manage_columns has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function manage_columns( $column, $post_id ) {
                    global $post;
            
                    $order = new LLMS_Order( $post_id );
            
            

              Method get_fields has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function get_fields() {
              
                      $email_merge = array(
                          '{student_email}' => __( 'Student Email', 'lifterlms' ),
                          '{admin_email}'   => __( 'Admin Email', 'lifterlms' ),

                Method get_available_date has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function get_available_date( $format = '' ) {
                
                        if ( ! $format ) {
                            $format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
                        }
                Severity: Major
                Found in includes/models/model.llms.lesson.php - About 2 hrs to fix

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

                                          condition: function() {
                                              if ( this.get_course() && 'yes' === this.get_course().get( 'lesson_drip' ) && this.get_course().get( 'drip_method' ) ) {
                                                  return false;
                                              }
                  
                  
                  Severity: Major
                  Found in assets/js/builder/Schemas/Lesson.js and 1 other location - About 2 hrs to fix
                  assets/js/builder/Schemas/Lesson.js on lines 172..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 84.

                  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

                                          condition: function() {
                                              if ( this.get_course() && 'yes' === this.get_course().get( 'lesson_drip' ) && this.get_course().get( 'drip_method' ) ) {
                                                  return false;
                                              }
                  
                  
                  Severity: Major
                  Found in assets/js/builder/Schemas/Lesson.js and 1 other location - About 2 hrs to fix
                  assets/js/builder/Schemas/Lesson.js on lines 186..192

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

                  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

                      describe( 'increment=patch', () => {
                          const testData = [
                              [ '1.0.0', '1.0.1' ],
                              [ '5.1.2', '5.1.3' ],
                              [ '0.12.9', '0.12.10' ],
                  Severity: Major
                  Found in packages/dev/test/utils/get-next-version.test.js and 1 other location - About 2 hrs to fix
                  packages/dev/test/utils/get-next-version.test.js on lines 18..29

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

                  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

                      describe( 'increment=minor', () => {
                          const testData = [
                              [ '1.0.0', '1.1.0' ],
                              [ '5.3.9', '5.4.0' ],
                              [ '0.54.3', '0.55.0' ],
                  Severity: Major
                  Found in packages/dev/test/utils/get-next-version.test.js and 1 other location - About 2 hrs to fix
                  packages/dev/test/utils/get-next-version.test.js on lines 5..16

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

                  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

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

                      public function get_results( $args = array() ) {
                  
                          $this->title = __( 'Manage Existing Enrollments', 'lifterlms' );
                  
                          if ( ! $args ) {

                    Method get_data has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function get_data( $key, $student ) {
                    
                            $value = '';
                    
                            switch ( $key ) {
                    Severity: Major
                    Found in includes/admin/reporting/tables/llms.table.course.students.php - About 2 hrs to fix

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

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

                        Method get_settings has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function get_settings() {
                        
                                $settings = array();
                        
                                $settings[] = array(
                        Severity: Major
                        Found in includes/admin/settings/class.llms.settings.general.php - About 2 hrs to fix

                          Method get_wp_caps has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private static function get_wp_caps( $role ) {
                          
                                  $caps = array(
                                      'read' => true,
                                  );
                          Severity: Major
                          Found in includes/class.llms.roles.php - About 2 hrs to fix

                            Method lifterlms_template_student_dashboard_my_notifications has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function lifterlms_template_student_dashboard_my_notifications() {
                            
                                    $url = llms_get_endpoint_url( 'notifications', '', llms_get_page_url( 'myaccount' ) );
                            
                                    $sections = array(
                            Severity: Major
                            Found in includes/functions/llms.functions.templates.dashboard.php - About 2 hrs to fix

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

                                  public static function certificate_data( $email_address, $page ) {
                              
                                      $ret = self::get_return();
                              
                                      $student = parent::get_student_by_email( $email_address );
                              Severity: Major
                              Found in includes/privacy/class-llms-privacy-erasers.php and 1 other location - About 2 hrs to fix
                              includes/privacy/class-llms-privacy-erasers.php on lines 30..51

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

                              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 static function achievement_data( $email_address, $page ) {
                              
                                      $ret = self::get_return();
                              
                                      $student = parent::get_student_by_email( $email_address );
                              Severity: Major
                              Found in includes/privacy/class-llms-privacy-erasers.php and 1 other location - About 2 hrs to fix
                              includes/privacy/class-llms-privacy-erasers.php on lines 83..104

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

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language