gocodebox/lifterlms

View on GitHub
includes/functions/updates/llms-functions-updates-3160.php

Summary

Maintainability
F
5 days
Test Coverage
F
0%

Function llms_update_3160_attempt_migration has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
Open

function llms_update_3160_attempt_migration() {

    global $wpdb;
    $query = $wpdb->get_results( "SELECT user_id, meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'llms_quiz_data' LIMIT 100;" ); // db call ok; no-cache ok.

Severity: Minor
Found in includes/functions/updates/llms-functions-updates-3160.php - About 1 day 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 llms_update_3160_update_question_data has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

function llms_update_3160_update_question_data() {

    if ( 'complete' !== get_transient( 'llms_update_3160_ensure_no_lesson_dupe_rels' ) ) {
        return true;
    }
Severity: Minor
Found in includes/functions/updates/llms-functions-updates-3160.php - About 1 day 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

File llms-functions-updates-3160.php has 424 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

<?php
/**
 * Update functions for version 3.16.0
 *
 * @package LifterLMS/Functions/Updates
Severity: Minor
Found in includes/functions/updates/llms-functions-updates-3160.php - About 6 hrs to fix

    Function llms_update_3160_ensure_no_dupe_question_rels has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    function llms_update_3160_ensure_no_dupe_question_rels() {
    
        if ( 'complete' !== get_transient( 'llms_update_3160_attempt_migration' ) ) {
            return true;
        }
    Severity: Minor
    Found in includes/functions/updates/llms-functions-updates-3160.php - About 5 hrs 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 llms_update_3160_ensure_no_lesson_dupe_rels has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    function llms_update_3160_ensure_no_lesson_dupe_rels() {
    
        if ( 'complete' !== get_transient( 'llms_update_3160_ensure_no_dupe_question_rels_status' ) ) {
            return true;
        }
    Severity: Minor
    Found in includes/functions/updates/llms-functions-updates-3160.php - About 3 hrs 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

    Method llms_update_3160_update_question_data has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function llms_update_3160_update_question_data() {
    
        if ( 'complete' !== get_transient( 'llms_update_3160_ensure_no_lesson_dupe_rels' ) ) {
            return true;
        }
    Severity: Major
    Found in includes/functions/updates/llms-functions-updates-3160.php - About 3 hrs to fix

      Method llms_update_3160_attempt_migration has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function llms_update_3160_attempt_migration() {
      
          global $wpdb;
          $query = $wpdb->get_results( "SELECT user_id, meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'llms_quiz_data' LIMIT 100;" ); // db call ok; no-cache ok.
      
      
      Severity: Major
      Found in includes/functions/updates/llms-functions-updates-3160.php - About 3 hrs to fix

        Method llms_update_3160_ensure_no_dupe_question_rels has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function llms_update_3160_ensure_no_dupe_question_rels() {
        
            if ( 'complete' !== get_transient( 'llms_update_3160_attempt_migration' ) ) {
                return true;
            }
        Severity: Major
        Found in includes/functions/updates/llms-functions-updates-3160.php - About 3 hrs to fix

          Method llms_update_3160_ensure_no_lesson_dupe_rels has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function llms_update_3160_ensure_no_lesson_dupe_rels() {
          
              if ( 'complete' !== get_transient( 'llms_update_3160_ensure_no_dupe_question_rels_status' ) ) {
                  return true;
              }
          Severity: Major
          Found in includes/functions/updates/llms-functions-updates-3160.php - About 2 hrs to fix

            Function llms_update_3160_update_attempt_question_data has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            function llms_update_3160_update_attempt_question_data() {
            
                if ( 'complete' !== get_transient( 'llms_update_3160_update_question_data' ) ) {
                    return true;
                }
            Severity: Minor
            Found in includes/functions/updates/llms-functions-updates-3160.php - About 2 hrs 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

            Method llms_update_3160_update_attempt_question_data has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function llms_update_3160_update_attempt_question_data() {
            
                if ( 'complete' !== get_transient( 'llms_update_3160_update_question_data' ) ) {
                    return true;
                }
            Severity: Minor
            Found in includes/functions/updates/llms-functions-updates-3160.php - About 1 hr to fix

              Function llms_update_3160_update_quiz_to_lesson_rels has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function llms_update_3160_update_quiz_to_lesson_rels() {
              
                  if ( 'complete' !== get_transient( 'llms_update_3160_update_attempt_question_data' ) ) {
                      return true;
                  }
              Severity: Minor
              Found in includes/functions/updates/llms-functions-updates-3160.php - About 35 mins 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

              There are no issues that match your filters.

              Category
              Status