gocodebox/lifterlms

View on GitHub

Showing 1,420 of 1,425 total issues

Function init has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    init: function( obj ) {

        // If obj is not of type object or null return false.
        if ( obj === null || typeof obj !== 'object' ) {
            return false;
Severity: Minor
Found in assets/js/app/llms-ajax.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function runSetupWizard has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export async function runSetupWizard( {
    coursesToImport = [ 'LifterLMS Quickstart Course' ],
    exit = false,
} = {} ) {
    // Launch the Setup Wizard.
Severity: Minor
Found in packages/llms-e2e-test-utils/src/run-setup-wizard.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function Donut has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

LLMS.Donut = function( $el ) {

    /**
     * Constructor
     *
Severity: Minor
Found in assets/js/app/llms-donut.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function registerStudent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export async function registerStudent( {
    email = null,
    pass = null,
    first = 'Jamie',
    last = 'Doe',
Severity: Minor
Found in packages/llms-e2e-test-utils/src/register-student.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function output has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function output() {

        $order = new LLMS_Order( $this->post );

        $curr_page = isset( $_GET['notes-page'] ) ? absint( wp_unslash( $_GET['notes-page'] ) ) : 1;

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function manage_columns has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function manage_columns( $column, $post_id ) {

        switch ( $column ) {

            case 'trigger':

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function save has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function save( $post_id ) {

        if ( ! llms_verify_nonce( 'lifterlms_meta_nonce', 'lifterlms_save_data' ) ) {
            return;
        }

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function get_results has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_results( $args = array() ) {

        $this->title = __( 'Courses', 'lifterlms' );

        $args = $this->clean_args( $args );
Severity: Minor
Found in includes/admin/reporting/tables/llms.table.courses.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function get_results has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_results( $args = array() ) {

        $this->title = __( 'Students', 'lifterlms' );

        if ( ! $args ) {
Severity: Minor
Found in includes/admin/reporting/tables/llms.table.course.students.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function get_data has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_data( $key, $course_id ) {

        $course = new LLMS_Course( $course_id );

        switch ( $key ) {
Severity: Minor
Found in includes/admin/reporting/tables/llms.table.student.courses.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function __construct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct( $model, $args = array() ) {

        if ( 'new' === $model ) {
            $model = $this->create( $args );
            if ( ! is_wp_error( $model ) ) {
Severity: Minor
Found in includes/abstracts/abstract.llms.post.model.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function is_enrolled has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function is_enrolled( $product_ids = null, $relation = 'all', $use_cache = true ) {

        // Assume enrollment unless we find otherwise.
        $ret = true;

Severity: Minor
Found in includes/models/model.llms.student.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function lifterlms_page_title has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    function lifterlms_page_title( $echo = true ) {

        $page_title = '';

        if ( is_search() ) {
Severity: Minor
Found in includes/llms.template.functions.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function user_can_manage_user has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function user_can_manage_user( $user_id, $edit_id ) {

        $user = get_user_by( 'id', $user_id );

        /**
Severity: Minor
Found in includes/class.llms.user.permissions.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function favorite_object has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function favorite_object() {

        // Grab the data if it exists.
        $user_action = llms_filter_input_sanitize_string( INPUT_POST, 'user_action' );
        $object_id   = llms_filter_input( INPUT_POST, 'object_id', FILTER_SANITIZE_NUMBER_INT );
Severity: Minor
Found in includes/class.llms.ajax.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function validate_matching_fields has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate_matching_fields( $posted_data, $fields ) {

        $err      = new WP_Error();
        $err_data = array();

Severity: Minor
Found in includes/forms/class-llms-form-validator.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function handle_cap_view_grades has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function handle_cap_view_grades( $allcaps, $args ) {

        // Logged out user or missing required args.
        if ( empty( $args[1] ) || empty( $args[2] ) ) {
            return $allcaps;
Severity: Minor
Found in includes/class.llms.user.permissions.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function maybe_add_export_files has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function maybe_add_export_files( $archive_pathname, $archive_url, $html_report_pathname, $request_id ) {

        if ( ! class_exists( 'ZipArchive' ) ) {
            return;
        }
Severity: Minor
Found in includes/privacy/class-llms-privacy-exporters.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function load_reusable_blocks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function load_reusable_blocks( $blocks ) {

        $loaded = array();

        foreach ( $blocks as $block ) {
Severity: Minor
Found in includes/forms/class-llms-forms.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function editable_roles has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function editable_roles( $all_roles ) {

        /**
         * Prevent issues when other plugins call get_editable_roles() before `init`.
         *
Severity: Minor
Found in includes/class.llms.user.permissions.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language