Code Duplication    Length = 6-7 lines in 2 locations

class.jetpack-client-server.php 1 location

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

_inc/class.jetpack-provision.php 1 location

@@ 177-182 (lines=6) @@
174
				? array( 'sso' )
175
				: array();
176
177
			if ( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) {
178
				Jetpack::delete_active_modules();
179
				Jetpack::activate_default_modules( 999, 1, array_merge( $active_modules, $other_modules ), false );
180
			} else {
181
				Jetpack::activate_default_modules( false, false, $other_modules, false );
182
			}
183
		}
184
		return $body_json;
185
	}