Lifecycle
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
class Lifecycle {
/** @var array the version numbers that have an upgrade routine */
Function add_admin_notices
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function add_admin_notices() {
// display any milestone notices
foreach ( $this->get_milestone_messages() as $id => $message ) {
- 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 init
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function init() {
// potentially handle a new activation
$this->handle_activation();
- 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 handle_deactivation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function handle_deactivation() {
// if the enhanced admin is available, delete all of this plugin's notes on deactivation
if ( SV_WC_Plugin_Compatibility::is_enhanced_admin_available() ) {
- 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 upgrade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function upgrade( $installed_version ) {
foreach ( $this->upgrade_versions as $upgrade_version ) {
$upgrade_method = 'upgrade_to_' . str_replace( array( '.', '-' ), '_', $upgrade_version );
- 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"