Code Duplication    Length = 6-7 lines in 2 locations

class.jetpack-cli.php 1 location

@@ 1086-1091 (lines=6) @@
1083
				? array( 'sso' )
1084
				: array();
1085
1086
			if ( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) {
1087
				Jetpack::delete_active_modules();
1088
				Jetpack::activate_default_modules( 999, 1, array_merge( $active_modules, $other_modules ), false );
1089
			} else {
1090
				Jetpack::activate_default_modules( false, false, $other_modules, false );
1091
			}
1092
		}
1093
1094
		WP_CLI::log( json_encode( $body_json ) );

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