gocodebox/lifterlms

View on GitHub

Showing 1,389 of 1,394 total issues

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

            $( 'a[href="#llms-toggle-filters"]' ).on( 'click', function( e ) {
                e.preventDefault();
                $( '.llms-analytics-filters' ).slideToggle( 100 );
            } );
Severity: Minor
Found in assets/js/llms-analytics.js and 1 other location - About 35 mins to fix
assets/js/llms-form-checkout.js on lines 171..176

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

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

        expand: function( event ) {

            if ( event ) {
                event.preventDefault();
            }
Severity: Minor
Found in assets/js/builder/Views/Question.js and 1 other location - About 35 mins to fix
assets/js/builder/Views/Question.js on lines 229..237

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

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

        collapse: function( event ) {

            if ( event ) {
                event.preventDefault();
            }
Severity: Minor
Found in assets/js/builder/Views/Question.js and 1 other location - About 35 mins to fix
assets/js/builder/Views/Question.js on lines 266..274

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

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

        relationships: {
            parent: {
                model: 'lesson',
                type: 'model',
            },
Severity: Minor
Found in assets/js/builder/Models/Quiz.js and 1 other location - About 35 mins to fix
assets/js/builder/Models/Section.js on lines 11..23

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

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

            $( 'a[href="#llms-coupon-toggle"]' ).on( 'click', function( e ) {

                e.preventDefault();
                $( '.llms-coupon-entry' ).slideToggle( 400 );

Severity: Minor
Found in assets/js/llms-form-checkout.js and 1 other location - About 35 mins to fix
assets/js/llms-analytics.js on lines 86..89

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

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_subject( $merge = true ) {
        $subject = $this->get_option( 'subject', apply_filters( $this->get_filter( 'set_subject' ), $this->set_subject(), $this ) );
        if ( $merge ) {
            $subject = $this->get_merged_string( $subject );
        }
Severity: Minor
Found in includes/abstracts/llms.abstract.notification.view.php and 1 other location - About 30 mins to fix
includes/abstracts/llms.abstract.notification.view.php on lines 716..722

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

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_title( $merge = true ) {
        $title = $this->get_option( 'title', apply_filters( $this->get_filter( 'set_title' ), $this->set_title(), $this ) );
        if ( $merge ) {
            $title = $this->get_merged_string( $title );
        }
Severity: Minor
Found in includes/abstracts/llms.abstract.notification.view.php and 1 other location - About 30 mins to fix
includes/abstracts/llms.abstract.notification.view.php on lines 690..696

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

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

Avoid too many return statements within this method.
Open

                return parent::get_text( $text_type );
Severity: Major
Found in includes/processors/class-llms-processor-certificate-sync.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return parent::get_text( $text_type );
    Severity: Major
    Found in includes/processors/class-llms-processor-achievement-sync.php - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return true;
      Severity: Major
      Found in packages/scripts/e2e/bootstrap.js - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return parent::get_text( $text_type );

          Avoid too many return statements within this method.
          Open

                          return __( 'Sync Awarded certificate', 'lifterlms' );

            Avoid too many return statements within this method.
            Open

                            return sprintf(
                                /* translators: %1$d: number of awarded certificates */
                                __( 'Sync %1$d awarded certificate with this certificate template.', 'lifterlms' ),
                                ( $variables['awarded_number'] ?? 0 )
                            );

              Avoid too many return statements within this method.
              Open

                              return sprintf(
                                  /* translators: %1$d: number of awarded achievements */
                                  __( 'Sync %1$d awarded achievement with this achievement template.', 'lifterlms' ),
                                  ( $variables['awarded_number'] ?? 0 )
                              );

                Avoid too many return statements within this method.
                Open

                                return __( 'Sync Awarded Achievements', 'lifterlms' );

                  Avoid too many return statements within this method.
                  Open

                                  return __( 'Sync Awarded certificates', 'lifterlms' );

                    Avoid too many return statements within this method.
                    Open

                                    return sprintf(
                                        /* translators: %1$s: link to edit the certificate template, %2$s: closing anchor tag */
                                        __( 'Sync this awarded certificate with its %1$scertificate template%2$s.', 'lifterlms' ),
                                        '<a href="' . get_edit_post_link( ( $variables['template_id'] ?? 0 ) ) . '" target="_blank">',
                                        '</a>'

                      Avoid too many return statements within this method.
                      Open

                              return false;
                      Severity: Major
                      Found in includes/admin/class.llms.admin.assets.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return sprintf(
                                            /* translators: %1$s: link to edit the achievement template, %2$s: closing anchor tag */
                                            __( 'Sync this awarded achievement with its %1$sachievement template%2$s.', 'lifterlms' ),
                                            '<a href="' . get_edit_post_link( ( $variables['template_id'] ?? 0 ) ) . '" target="_blank">',
                                            '</a>'

                          Avoid too many return statements within this method.
                          Open

                                      return true;
                          Severity: Major
                          Found in includes/admin/class.llms.admin.assets.php - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language