Code Duplication    Length = 6-7 lines in 2 locations

class.jetpack-cli.php 1 location

@@ 1119-1124 (lines=6) @@
1116
				? array( 'sso' )
1117
				: array();
1118
1119
			if ( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) {
1120
				Jetpack::delete_active_modules();
1121
				Jetpack::activate_default_modules( 999, 1, array_merge( $active_modules, $other_modules ), false );
1122
			} else {
1123
				Jetpack::activate_default_modules( false, false, $other_modules, false );
1124
			}
1125
		}
1126
1127
		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();