Function llms_update_300_create_access_plans
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
function llms_update_300_create_access_plans() {
$courses = new WP_Query(
array(
'post_type' => array( 'course', 'llms_membership' ),
- Read upRead up
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-300.php
has 428 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Update functions for version 3.0.0
*
* @package LifterLMS/Functions/Updates
Method llms_update_300_create_access_plans
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
function llms_update_300_create_access_plans() {
$courses = new WP_Query(
array(
'post_type' => array( 'course', 'llms_membership' ),
Function llms_update_300_update_orders
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function llms_update_300_update_orders() {
$args = array(
'post_type' => array( 'llms_order' ),
'posts_per_page' => -1,
- Read upRead up
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_300_migrate_account_field_options
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function llms_update_300_migrate_account_field_options() {
$email_confirm = get_option( 'lifterlms_registration_confirm_email' );
if ( 'yes' === $email_confirm ) {
$email_confirm = 'yes';
- Read upRead up
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_300_update_orders
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function llms_update_300_update_orders() {
$args = array(
'post_type' => array( 'llms_order' ),
'posts_per_page' => -1,
Method llms_update_300_migrate_course_postmeta
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function llms_update_300_migrate_course_postmeta() {
global $wpdb;
// Rekey meta fields.
Method llms_update_300_migrate_account_field_options
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function llms_update_300_migrate_account_field_options() {
$email_confirm = get_option( 'lifterlms_registration_confirm_email' );
if ( 'yes' === $email_confirm ) {
$email_confirm = 'yes';
Method llms_update_300_migrate_lesson_postmeta
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function llms_update_300_migrate_lesson_postmeta() {
global $wpdb;
llms_update_util_rekey_meta( 'lesson', '_llms_audio_embed', '_audio_embed' );
Function llms_update_300_migrate_course_postmeta
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function llms_update_300_migrate_course_postmeta() {
global $wpdb;
// Rekey meta fields.
- Read upRead up
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"