Code Duplication    Length = 10-11 lines in 2 locations

class.jetpack.php 2 locations

@@ 2597-2606 (lines=10) @@
2594
2595
			if ( $send_state_messages && in_array( $module, $active ) ) {
2596
				$module_info = Jetpack::get_module( $module );
2597
				if ( ! $module_info['deactivate'] ) {
2598
					$state = in_array( $module, $other_modules ) ? 'reactivated_modules' : 'activated_modules';
2599
					if ( $active_state = Jetpack::state( $state ) ) {
2600
						$active_state = explode( ',', $active_state );
2601
					} else {
2602
						$active_state = array();
2603
					}
2604
					$active_state[] = $module;
2605
					Jetpack::state( $state, implode( ',', $active_state ) );
2606
				}
2607
				continue;
2608
			}
2609
@@ 2630-2640 (lines=11) @@
2627
2628
			$active[] = $module;
2629
2630
			if ( $send_state_messages ) {
2631
2632
				$state    = in_array( $module, $other_modules ) ? 'reactivated_modules' : 'activated_modules';
2633
				if ( $active_state = Jetpack::state( $state ) ) {
2634
					$active_state = explode( ',', $active_state );
2635
				} else {
2636
					$active_state = array();
2637
				}
2638
				$active_state[] = $module;
2639
				Jetpack::state( $state, implode( ',', $active_state ) );
2640
			}
2641
2642
			Jetpack::update_active_modules( $active );
2643