Code Duplication    Length = 6-7 lines in 2 locations

class.jetpack-cli.php 1 location

@@ 1044-1049 (lines=6) @@
1041
				? array( 'sso' )
1042
				: array();
1043
1044
			if ( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) {
1045
				Jetpack::delete_active_modules();
1046
				Jetpack::activate_default_modules( 999, 1, array_merge( $active_modules, $other_modules ), false );
1047
			} else {
1048
				Jetpack::activate_default_modules( false, false, $other_modules, false );
1049
			}
1050
		}
1051
1052
		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();