Code Duplication    Length = 6-7 lines in 2 locations

_inc/lib/class.core-rest-api-endpoints.php 1 location

@@ 926-932 (lines=7) @@
923
		}
924
925
		// If all Jumpstart modules were activated
926
		if ( empty( $result['failed_modules'] ) ) {
927
			return rest_ensure_response( array(
928
				'code' 	  => 'success',
929
				'message' => esc_html__( 'Jumpstart done.', 'jetpack' ),
930
				'data'    => $result,
931
			) );
932
		}
933
934
		return new WP_Error( 'jumpstart_failed', esc_html( sprintf( _n( 'Jumpstart failed activating this module: %s.', 'Jumpstart failed activating these modules: %s.', count( $result['failed_modules'] ), 'jetpack' ), join( ', ', $result['failed_modules'] ) ) ), array( 'status' => 400 ) );
935
	}

_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php 1 location

@@ 215-220 (lines=6) @@
212
			}
213
		}
214
215
		if ( empty( $failed ) ) {
216
			return rest_ensure_response( array(
217
				'code' 	  => 'success',
218
				'message' => esc_html__( 'All modules activated.', 'jetpack' ),
219
			) );
220
		}
221
222
		$error = '';
223