Code Duplication    Length = 6-7 lines in 2 locations

class.jetpack-cli.php 1 location

@@ 1096-1101 (lines=6) @@
1093
				? array( 'sso' )
1094
				: array();
1095
1096
			if ( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) {
1097
				Jetpack::delete_active_modules();
1098
				Jetpack::activate_default_modules( 999, 1, array_merge( $active_modules, $other_modules ), false );
1099
			} else {
1100
				Jetpack::activate_default_modules( false, false, $other_modules, false );
1101
			}
1102
		}
1103
1104
		WP_CLI::log( json_encode( $body_json ) );

class.jetpack-client-server.php 1 location

@@ 152-158 (lines=7) @@
149
			: array();
150
151
		$redirect_on_activation_error = ( 'client' === $data['auth_type'] ) ? true : false;
152
		if ( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) {
153
			Jetpack::delete_active_modules();
154
155
			Jetpack::activate_default_modules( 999, 1, array_merge( $active_modules, $other_modules ), $redirect_on_activation_error, false );
156
		} else {
157
			Jetpack::activate_default_modules( false, false, $other_modules, $redirect_on_activation_error, false );
158
		}
159
160
		// Since this is a fresh connection, be sure to clear out IDC options
161
		Jetpack_IDC::clear_all_idc_options();