Method render_form_content
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function render_form_content( $form, $submission = null ) {
$prefix = $this->form_manager->get_prefix();
/**
* Filters whether a user can access a specific form, and optionally submission.
File form-frontend-output-handler.php
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Form frontend output handler class
*
* @package TorroForms
Function render_form_content
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function render_form_content( $form, $submission = null ) {
$prefix = $this->form_manager->get_prefix();
/**
* Filters whether a user can access a specific form, and optionally submission.
- 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 maybe_print_form_error
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function maybe_print_form_error( $form ) {
$key = $this->form_manager->get_prefix() . 'form_errors';
if ( is_user_logged_in() ) {
$errors = get_user_meta( get_current_user_id(), $key, true );
- 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_shortcode_content
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_shortcode_content( $atts ) {
$atts = shortcode_atts(
array(
'id' => '',
'show' => 'direct',
Function get_shortcode_content
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function get_shortcode_content( $atts ) {
$atts = shortcode_atts(
array(
'id' => '',
'show' => 'direct',
- 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 maybe_print_submission_errors
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function maybe_print_submission_errors( $submission ) {
if ( $submission->has_errors( 0 ) ) {
$global_errors = $submission->get_errors( 0 );
if ( 1 === count( $global_errors ) ) {
$error_key = key( $global_errors );
- 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 maybe_get_form_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function maybe_get_form_content( $content ) {
$form = $this->form_manager->get( get_the_ID() );
if ( ! $form ) {
return $content;
}
- 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"