Function parse_output
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
protected function parse_output() {
foreach ( $this->output as $output ) {
$skip = false;
// Apply any sanitization callbacks defined.
- Read upRead up
- Create a ticketCreate a ticket
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 apply_pattern_replace
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
protected function apply_pattern_replace( $output, $value ) {
if ( isset( $output['pattern_replace'] ) && is_array( $output['pattern_replace'] ) ) {
$option_type = ( isset( $this->field['option_type'] ) ) ? $this->field['option_type'] : 'theme_mod';
$option_name = ( isset( $this->field['option_name'] ) ) ? $this->field['option_name'] : '';
$options = [];
- Read upRead up
- Create a ticketCreate a ticket
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 apply_value_pattern
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function apply_value_pattern( $output, $value ) {
if ( isset( $output['value_pattern'] ) && is_string( $output['value_pattern'] ) ) {
if ( ! is_array( $value ) ) {
$value = str_replace( '$', $value, $output['value_pattern'] );
}
- Read upRead up
- Create a ticketCreate a ticket
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 parse_output
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parse_output() {
foreach ( $this->output as $output ) {
$skip = false;
// Apply any sanitization callbacks defined.
- Create a ticketCreate a ticket
Method apply_pattern_replace
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function apply_pattern_replace( $output, $value ) {
if ( isset( $output['pattern_replace'] ) && is_array( $output['pattern_replace'] ) ) {
$option_type = ( isset( $this->field['option_type'] ) ) ? $this->field['option_type'] : 'theme_mod';
$option_name = ( isset( $this->field['option_name'] ) ) ? $this->field['option_name'] : '';
$options = [];
- Create a ticketCreate a ticket
Function process_output
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function process_output( $output, $value ) {
$output = apply_filters( 'kirki_output_item_args', $output, $value, $this->output, $this->field );
if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) {
return;
- Read upRead up
- Create a ticketCreate a ticket
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"