Code Duplication    Length = 6-7 lines in 2 locations

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

@@ 948-954 (lines=7) @@
945
		}
946
947
		// If all Jumpstart modules were activated
948
		if ( empty( $result['failed_modules'] ) ) {
949
			return rest_ensure_response( array(
950
				'code' 	  => 'success',
951
				'message' => esc_html__( 'Jumpstart done.', 'jetpack' ),
952
				'data'    => $result,
953
			) );
954
		}
955
956
		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 ) );
957
	}

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

@@ 239-244 (lines=6) @@
236
			}
237
		}
238
239
		if ( empty( $failed ) ) {
240
			return rest_ensure_response( array(
241
				'code' 	  => 'success',
242
				'message' => esc_html__( 'All modules activated.', 'jetpack' ),
243
			) );
244
		}
245
246
		$error = '';
247