gocodebox/lifterlms

View on GitHub

Showing 1,420 of 1,425 total issues

Method get_sibling_lesson_query has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function get_sibling_lesson_query( $direction ) {

        $curr_position = $this->get( 'order' );

        // First cannot have a previous.
Severity: Minor
Found in includes/models/model.llms.lesson.php - About 1 hr to fix

    Method modify_paginate_links has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function modify_paginate_links( $link ) {
    
            global $wp_rewrite;
    
            // With ugly permalinks actually the whole BuddyPress member profile page doesn't work.
    Severity: Minor
    Found in includes/integrations/class.llms.integration.buddypress.php - About 1 hr to fix

      Method get_test_settings has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function get_test_settings( $type ) {
      
              $query = new WP_Query(
                  array(
                      'post_type'      => 'llms_transaction',

        Method migrate_award_templates has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function migrate_award_templates() {
        
            $per_page = llms_update_util_get_items_per_page();
        
            $query = new \WP_Query(
        Severity: Minor
        Found in includes/functions/updates/llms-functions-updates-600.php - About 1 hr to fix

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

                                  condition: function() {
                                      return ( ! this.get_course() || 'yes' !== this.get_course().get( 'lesson_drip' ) || ! this.get_course().get( 'drip_method' ) );
                                  },
          Severity: Major
          Found in assets/js/builder/Schemas/Lesson.js and 1 other location - About 1 hr to fix
          assets/js/builder/Schemas/Lesson.js on lines 117..119

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

          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

                  shift_down: function( e ) {
          
                      e.preventDefault();
                      var index = this.model.collection.indexOf( this.model );
                      this.shift( index, index + 1 );
          Severity: Major
          Found in assets/js/builder/Views/_Shiftable.js and 1 other location - About 1 hr to fix
          assets/js/builder/Views/_Shiftable.js on lines 75..81

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

          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

                  shift_up: function( e ) {
          
                      e.preventDefault();
                      var index = this.model.collection.indexOf( this.model );
                      this.shift( index, index - 1 );
          Severity: Major
          Found in assets/js/builder/Views/_Shiftable.js and 1 other location - About 1 hr to fix
          assets/js/builder/Views/_Shiftable.js on lines 60..66

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

          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() {
                                      return ( ! this.get_course() || 'yes' !== this.get_course().get( 'lesson_drip' ) || ! this.get_course().get( 'drip_method' ) );
                                  },
          Severity: Major
          Found in assets/js/builder/Schemas/Lesson.js and 1 other location - About 1 hr to fix
          assets/js/builder/Schemas/Lesson.js on lines 105..107

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

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

          function Edit( props ) {
              const [ isOpen, setOpen ] = useState( false ),
                  openModal = () => setOpen( true ),
                  closeModal = () => setOpen( false ),
                  { value, onChange } = props;
          Severity: Minor
          Found in src/js/admin-certificate-editor/merge-codes.js - About 1 hr to fix

            Function usePostOptions has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const usePostOptions = ( postType = 'course' ) => {
                const { posts, currentPostType } = useSelect( ( select ) => {
                    return {
                        posts: select( 'core' ).getEntityRecords( 'postType', postType ),
                        currentPostType: select( 'core/editor' )?.getCurrentPostType(),
            Severity: Minor
            Found in packages/components/src/post-select/index.js - About 1 hr to fix

              Function get_chart_data_object has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      this.get_chart_data_object = function() {
              
                          var self         = this,
                              max_for_days = ( ( 1000 * 3600 * 24 ) * 30 ) * 4, // 4 months in seconds
                              diff         = this.get_date_diff(),
              Severity: Minor
              Found in assets/js/llms-analytics.js - About 1 hr to fix

                Function render has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        render: function() {
                
                            this.$el.html( this.template( this.model ) );
                
                            if ( this.model.get( 'question_type').get( 'choices' ) ) {
                Severity: Minor
                Found in assets/js/builder/Views/Question.js - About 1 hr to fix

                  Function do_ajax_save has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function do_ajax_save() {
                  
                              // prevent simultaneous saves
                              if ( self.saving ) {
                                  return;
                  Severity: Minor
                  Found in assets/js/builder/Controllers/Sync.js - About 1 hr to fix

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

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

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

                          public function manage_columns( $column, $post_id ) {
                      
                              switch ( $column ) {
                      
                                  case 'trigger':

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

                            public function output() {
                        
                                $order = llms_get_post( $this->post );
                        
                                if ( llms_parse_bool( $order->get( 'anonymized' ) ) ) {

                          Method save_mod_rewrite_rules has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function save_mod_rewrite_rules() {
                                  // TODO: Different for multi-site?
                          
                                  if ( false === get_transient( 'lifterlms_check_media_protection_files' ) ) {
                                      global $wp_filesystem;
                          Severity: Minor
                          Found in includes/class-llms-media-protector.php - About 1 hr to fix

                            Method get_gateway_table_html has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function get_gateway_table_html() {
                            
                                    $gateways = llms()->payment_gateways()->get_payment_gateways();
                            
                                    usort( $gateways, array( $this, 'sort_gateways' ) );
                            Severity: Minor
                            Found in includes/admin/settings/class.llms.settings.checkout.php - About 1 hr to fix

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

                                  public function get_data( $key, $lesson ) {
                              
                                      switch ( $key ) {
                              
                                          case 'actions':
                              Severity: Minor
                              Found in includes/admin/reporting/tables/llms.table.student.course.php - About 1 hr to fix

                                Method set_columns has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function set_columns() {
                                        $cols = array(
                                            'id'         => array(
                                                'exportable' => true,
                                                'sortable'   => true,
                                Severity: Minor
                                Found in includes/admin/reporting/tables/llms.table.membership.students.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language