Code Duplication    Length = 11-11 lines in 2 locations

packages/jitm/src/class-message.php 2 locations

@@ 481-491 (lines=11) @@
478
			// check for inactive plugins.
479
			$score = (int) array_reduce(
480
				$this->inactive_plugins,
481
				function ( $score, $inactive_plugin ) use ( &$active_plugins, &$installed_plugins ) {
482
					if ( true !== $score && $score > 0 ) {
483
						return $score; // this creates an OR condition.
484
					}
485
486
					if ( isset( $installed_plugins[ $inactive_plugin ] ) && in_array( $inactive_plugin, $active_plugins, true ) ) {
487
						return 0;
488
					}
489
490
					return 1;
491
				},
492
				true
493
			);
494
@@ 502-512 (lines=11) @@
499
			// check for active plugins.
500
			$score = (int) array_reduce(
501
				$this->active_plugins,
502
				function ( $score, $active_plugin ) use ( &$active_plugins, &$installed_plugins ) {
503
					if ( true !== $score && $score > 0 ) {
504
						return $score; // this creates an OR condition.
505
					}
506
507
					if ( isset( $installed_plugins[ $active_plugin ] ) && in_array( $active_plugin, $active_plugins, true ) ) {
508
						return 1;
509
					}
510
511
					return 0;
512
				},
513
				true
514
			);
515