Showing 71 of 247 total issues
Function sanitize_object_value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function sanitize_object_value( $value, $args ) {
if ( $value instanceof stdClass ) {
$value = (array) $value;
}
- 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 $value;
Avoid too many return
statements within this method. Open
return $this->sanitize_string_value( $value, $args );
Avoid too many return
statements within this method. Open
return $this->sanitize_numeric_value( $value, $args );
Avoid too many return
statements within this method. Open
return $this->validate_string_value( $value, $args );
Avoid too many return
statements within this method. Open
return $value;
Avoid too many return
statements within this method. Open
return $this->validate_numeric_value( $value, $args );
Function get_as_html
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get_as_html( $name ) {
switch ( $name ) {
case 'phone_link':
case 'email_link':
case 'website_link':
- 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 wpsi_requirements_notice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function wpsi_requirements_notice() {
$plugin_file = plugin_basename( __FILE__ );
// WordPress before 4.9 didn't have a dedicated capability for this.
if ( version_compare( $GLOBALS['wp_version'], '4.9', '<' ) ) {
- 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_current_tab
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function get_current_tab( array $settings_forms = null ) {
if ( null === $settings_forms ) {
$settings_forms = $this->plugin->services()->get( 'settings_form_registry' )->get_all_forms();
}
- 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 __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct( $prefix, $group, WP_Site_Identity_Setting_Feedback_Handler $feedback_handler = null, WP_Site_Identity_Setting_Validator $validator = null, WP_Site_Identity_Setting_Sanitizer $sanitizer = null ) {
$this->prefix = $prefix;
$this->group = $group;
$this->factory = new WP_Site_Identity_Setting_Factory( $this );
- 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"