File class-llms-forms.php
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Register and manage LifterLMS user forms.
*
* @package LifterLMS/Classes
LLMS_Forms
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class LLMS_Forms {
use LLMS_Trait_Singleton;
/**
Function get_block_tree
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function get_block_tree( $block, $block_list ) {
foreach ( $block_list as &$_block ) {
// Found the block.
- 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 get_block_path
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function get_block_path( $block, $block_list, $iterations = 0 ) {
foreach ( $block_list as $_block ) {
// Found the block.
- 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 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 ) {
- 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 get_fields_settings_from_blocks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function get_fields_settings_from_blocks( $blocks ) {
$fields = array();
$blocks = $this->get_field_blocks( $blocks );
- 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 get_core_forms
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function get_core_forms( $return = 'posts', $use_cache = true ) {
global $wpdb;
$forms_cache_key = 'posts' === $return ? 'llms_core_forms' : 'llms_core_form_ids';
Function cascade_visibility_attrs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function cascade_visibility_attrs( $blocks, $visibility = null ) {
foreach ( $blocks as &$block ) {
// If a visibility setting has been passed from the parent and the block does not have visibility setting of it's own.
- 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 get_field_blocks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get_field_blocks( $blocks ) {
$fields = array();
foreach ( $blocks as $block ) {
- 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"