Method maybe_show_evaluation_results
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function maybe_show_evaluation_results( $submissions ) {
if ( empty( $_GET['form_id'] ) ) { // WPCS: CSRF OK.
return;
}
File module.php
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Evaluators module class
*
* @package TorroForms
Function maybe_enqueue_submission_results_assets
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function maybe_enqueue_submission_results_assets( $submissions ) {
if ( empty( $_GET['form_id'] ) ) { // WPCS: CSRF OK.
return;
}
- 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 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_shortcode_content( $atts ) {
$args = $atts;
$atts = shortcode_atts(
array(
Method maybe_enqueue_submission_results_assets
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function maybe_enqueue_submission_results_assets( $submissions ) {
if ( empty( $_GET['form_id'] ) ) { // WPCS: CSRF OK.
return;
}
Function maybe_show_evaluation_results
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function maybe_show_evaluation_results( $submissions ) {
if ( empty( $_GET['form_id'] ) ) { // WPCS: CSRF OK.
return;
}
- 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_shortcode_content
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function get_shortcode_content( $atts ) {
$args = $atts;
$atts = shortcode_atts(
array(
- 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
Avoid too many return
statements within this method. Open
return __( 'Shortcode is using an invalid mode!', 'torro-forms' );
Avoid too many return
statements within this method. Open
return str_replace( ' class="torro-evaluations-subtab"', ' class="torro-evaluations-subtab" onclick="' . esc_attr( $onclick ) . '"', ob_get_clean() );