Function loop_controls
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public static function loop_controls( $config_id ) {
// Get an instance of the Generator class.
// This will make sure google fonts and backup fonts are loaded.
Generator::get_instance();
- 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 field_init
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function field_init( $args, $object ) {
if ( ! isset( $args['output'] ) ) {
$args['output'] = array();
}
- 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 field_init
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function field_init( $args, $object ) {
if ( ! isset( $args['output'] ) ) {
$args['output'] = array();
}
- Create a ticketCreate a ticket
Method loop_controls
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function loop_controls( $config_id ) {
// Get an instance of the Generator class.
// This will make sure google fonts and backup fonts are loaded.
Generator::get_instance();
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
( isset( $field['kirki_config'] ) && $config_id === $field['kirki_config'] ) ||
(
( 'global' === $config_id || ! $config_id ) &&
( ! isset( $field['kirki_config'] ) || 'global' === $field['kirki_config'] || ! $field['kirki_config'] )
- Create a ticketCreate a ticket
Function print_styles
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function print_styles() {
// Go through all configs.
$configs = Kirki::$config;
- 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 get_fields_by_config
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function get_fields_by_config( $config_id ) {
$fields = array();
foreach ( self::$fields as $field ) {
if (
( isset( $field['kirki_config'] ) && $config_id === $field['kirki_config'] ) ||
- 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 enqueue_styles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function enqueue_styles() {
$args = array(
'action' => apply_filters( 'kirki_styles_action_handle', self::$css_handle ),
);
- 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"