Code Duplication    Length = 6-7 lines in 2 locations

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();

_inc/class.jetpack-provision.php 1 location

@@ 244-249 (lines=6) @@
241
			? array( 'sso' )
242
			: array();
243
244
		if ( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) {
245
			Jetpack::delete_active_modules();
246
			Jetpack::activate_default_modules( 999, 1, array_merge( $active_modules, $other_modules ), false );
247
		} else {
248
			Jetpack::activate_default_modules( false, false, $other_modules, false );
249
		}
250
	}
251
252
	private static function verify_token( $access_token ) {