Code Duplication    Length = 10-11 lines in 2 locations

class.jetpack.php 2 locations

@@ 2831-2840 (lines=10) @@
2828
2829
			if ( $send_state_messages && in_array( $module, $active ) ) {
2830
				$module_info = Jetpack::get_module( $module );
2831
				if ( ! $module_info['deactivate'] ) {
2832
					$state = in_array( $module, $other_modules ) ? 'reactivated_modules' : 'activated_modules';
2833
					if ( $active_state = Jetpack::state( $state ) ) {
2834
						$active_state = explode( ',', $active_state );
2835
					} else {
2836
						$active_state = array();
2837
					}
2838
					$active_state[] = $module;
2839
					Jetpack::state( $state, implode( ',', $active_state ) );
2840
				}
2841
				continue;
2842
			}
2843
@@ 2864-2874 (lines=11) @@
2861
2862
			$active[] = $module;
2863
2864
			if ( $send_state_messages ) {
2865
2866
				$state    = in_array( $module, $other_modules ) ? 'reactivated_modules' : 'activated_modules';
2867
				if ( $active_state = Jetpack::state( $state ) ) {
2868
					$active_state = explode( ',', $active_state );
2869
				} else {
2870
					$active_state = array();
2871
				}
2872
				$active_state[] = $module;
2873
				Jetpack::state( $state, implode( ',', $active_state ) );
2874
			}
2875
2876
			Jetpack::update_active_modules( $active );
2877