gocodebox/lifterlms

View on GitHub

Showing 1,374 of 1,379 total issues

Method register_post_types has 614 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function register_post_types() {

        // Course.
        $catalog_id = llms_get_page_id( 'shop' );
        self::register_post_type(
Severity: Major
Found in includes/class.llms.post-types.php - About 3 days to fix

    File class.llms.post-types.php has 1100 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Register Post Types, Taxonomies, Statuses.
     *
     * @package LifterLMS/Classes
    Severity: Major
    Found in includes/class.llms.post-types.php - About 2 days to fix

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

          public function get_results( $args = array() ) {
      
              $this->title = __( 'Manage Existing Enrollments', 'lifterlms' );
      
              if ( ! $args ) {
      includes/admin/reporting/tables/llms.table.membership.students.php on lines 266..352

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

      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 get_results( $args = array() ) {
      
              $this->title = __( 'Students', 'lifterlms' );
      
              if ( ! $args ) {
      includes/admin/post-types/tables/class.llms.table.student.management.php on lines 262..347

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

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

          var Metaboxes = function() {
      
              /**
               * load all partials
               */
      Severity: Major
      Found in assets/js/private/llms-metaboxes.js - About 2 days to fix

        File model.llms.order.php has 908 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * LLMS_Order class/model file
         *
         * @package LifterLMS/Models/Classes
        Severity: Major
        Found in includes/models/model.llms.order.php - About 2 days to fix

          Method output_field has 416 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function output_field( $field ) {
          
                  // Set missing values with defaults.
                  $field = self::set_field_defaults( $field );
          
          
          Severity: Major
          Found in includes/admin/class.llms.admin.settings.php - About 2 days to fix

            Function metabox_product has 409 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                window.llms.metabox_product = function() {
            
                    /**
                     * jQuery obj for the main $( '#llms-access-plans' ) element.
                     *
            Severity: Major
            Found in assets/js/llms-metabox-product.js - About 2 days to fix

              File model.llms.student.php has 832 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Student Model
               *
               * @package LifterLMS/Models/Classes
              Severity: Major
              Found in includes/models/model.llms.student.php - About 2 days to fix

                File class.llms.ajax.handler.php has 803 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * LifterLMS AJAX Event Handler.
                 *
                 * @package LifterLMS/Classes
                Severity: Major
                Found in includes/class.llms.ajax.handler.php - About 1 day to fix

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

                              array(
                                  'title'  => __( 'Sales Page', 'lifterlms' ),
                                  'fields' => array(
                                      array(
                                          'allow_null'    => false,
                  includes/admin/post-types/meta-boxes/class.llms.meta.box.course.options.php on lines 82..131

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

                  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(
                                  'title'  => __( 'Sales Page', 'lifterlms' ),
                                  'fields' => array(
                                      array(
                                          'allow_null'    => false,
                  includes/admin/post-types/meta-boxes/class.llms.meta.box.membership.php on lines 116..165

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

                  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

                  <?php
                  /**
                   * LLMS_Meta_Box_Certificate_Sync class
                   *
                   * @package LifterLMS/Admin/PostTypes/MetaBoxes/Classes
                  includes/admin/post-types/meta-boxes/class-llms-meta-box-achievement-sync.php on lines 1..123

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

                  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

                  <?php
                  /**
                   * LLMS_Meta_Box_Achievement_Sync class
                   *
                   * @package LifterLMS/Admin/PostTypes/MetaBoxes/Classes
                  includes/admin/post-types/meta-boxes/class-llms-meta-box-certificate-sync.php on lines 1..123

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

                  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

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                      protected function set_merge_data( $code ) {
                  
                          $order = $this->post;
                  
                          switch ( $code ) {
                  includes/notifications/views/class.llms.notification.view.manual.payment.due.php on lines 152..217
                  includes/notifications/views/class.llms.notification.view.upcoming.payment.reminder.php on lines 171..236

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

                  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

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                      protected function set_merge_data( $code ) {
                  
                          $order = $this->post;
                  
                          switch ( $code ) {
                  includes/notifications/views/class.llms.notification.view.manual.payment.due.php on lines 152..217
                  includes/notifications/views/class.llms.notification.view.payment.retry.php on lines 156..221

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

                  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

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                      protected function set_merge_data( $code ) {
                  
                          $order = $this->post;
                  
                          switch ( $code ) {
                  includes/notifications/views/class.llms.notification.view.payment.retry.php on lines 156..221
                  includes/notifications/views/class.llms.notification.view.upcoming.payment.reminder.php on lines 171..236

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

                  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

                  const Edit = ( props ) => {
                      const { attributes } = props;
                      const blockProps = useBlockProps();
                      const courseOptions = usePostOptions();
                  
                  
                  Severity: Major
                  Found in src/blocks/course-reviews/index.jsx and 3 other locations - About 1 day to fix
                  src/blocks/course-continue/index.jsx on lines 21..64
                  src/blocks/course-meta-info/index.jsx on lines 21..62
                  src/blocks/course-prerequisites/index.jsx on lines 18..59

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

                  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

                  const Edit = ( props ) => {
                      const { attributes } = props;
                      const blockProps = useBlockProps();
                      const courseOptions = usePostOptions();
                  
                  
                  Severity: Major
                  Found in src/blocks/course-prerequisites/index.jsx and 3 other locations - About 1 day to fix
                  src/blocks/course-continue/index.jsx on lines 21..64
                  src/blocks/course-meta-info/index.jsx on lines 21..62
                  src/blocks/course-reviews/index.jsx on lines 18..59

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

                  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

                  const Edit = ( props ) => {
                      const { attributes } = props;
                      const blockProps = useBlockProps();
                      const courseOptions = usePostOptions();
                  
                  
                  Severity: Major
                  Found in src/blocks/course-meta-info/index.jsx and 3 other locations - About 1 day to fix
                  src/blocks/course-continue/index.jsx on lines 21..64
                  src/blocks/course-prerequisites/index.jsx on lines 18..59
                  src/blocks/course-reviews/index.jsx on lines 18..59

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

                  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