Code Duplication    Length = 10-11 lines in 2 locations

class.jetpack.php 2 locations

@@ 2869-2878 (lines=10) @@
2866
2867
			if ( $send_state_messages && in_array( $module, $active ) ) {
2868
				$module_info = Jetpack::get_module( $module );
2869
				if ( ! $module_info['deactivate'] ) {
2870
					$state = in_array( $module, $other_modules ) ? 'reactivated_modules' : 'activated_modules';
2871
					if ( $active_state = Jetpack::state( $state ) ) {
2872
						$active_state = explode( ',', $active_state );
2873
					} else {
2874
						$active_state = array();
2875
					}
2876
					$active_state[] = $module;
2877
					Jetpack::state( $state, implode( ',', $active_state ) );
2878
				}
2879
				continue;
2880
			}
2881
@@ 2902-2912 (lines=11) @@
2899
2900
			$active[] = $module;
2901
2902
			if ( $send_state_messages ) {
2903
2904
				$state    = in_array( $module, $other_modules ) ? 'reactivated_modules' : 'activated_modules';
2905
				if ( $active_state = Jetpack::state( $state ) ) {
2906
					$active_state = explode( ',', $active_state );
2907
				} else {
2908
					$active_state = array();
2909
				}
2910
				$active_state[] = $module;
2911
				Jetpack::state( $state, implode( ',', $active_state ) );
2912
			}
2913
2914
			Jetpack::update_active_modules( $active );
2915