Function load_framework_plugins
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function load_framework_plugins() {
// first sort the registered plugins by framework version
usort( $this->registered_plugins, array( $this, 'compare_frameworks' ) );
- 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 render_update_notices
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function render_update_notices() {
// must update plugin notice
if ( ! empty( $this->incompatible_framework_plugins ) ) {
- 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_deactivate_framework_plugins
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function maybe_deactivate_framework_plugins() {
if ( isset( $_GET['sv_wc_framework_deactivate_newer'] ) ) {
if ( 'yes' == $_GET['sv_wc_framework_deactivate_newer'] ) {
- 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 render_update_notices
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render_update_notices() {
// must update plugin notice
if ( ! empty( $this->incompatible_framework_plugins ) ) {
Method load_framework_plugins
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load_framework_plugins() {
// first sort the registered plugins by framework version
usort( $this->registered_plugins, array( $this, 'compare_frameworks' ) );
Consider simplifying this complex logical expression. Open
if ( ( $this->incompatible_framework_plugins || $this->incompatible_wc_version_plugins || $this->incompatible_wp_version_plugins ) && is_admin() && ! defined( 'DOING_AJAX' ) && ! has_action( 'admin_notices', array( $this, 'render_update_notices' ) ) ) {
add_action( 'admin_notices', array( $this, 'render_update_notices' ) );
}
Method register_plugin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function register_plugin( $version, $plugin_name, $path, $callback, $args = array() ) {