ManageIQ/manageiq-providers-ibm_power_vc

View on GitHub
app/javascript/components/pvc-import-image-form/pvc-import-image-form.jsx

Summary

Maintainability
C
7 hrs
Test Coverage

Showing 2 of 2 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const fetchImages = (provider) => {
return new Promise((resolve, reject) => {
API.get(API_CLOUD_TEMPL + '?expand=resources&attributes=id,name&filter[]=ems_id=' + provider).then(({resources}) => {
let options = resources.map(({id, name}) => ({value: id, label: name}));
resolve(options);
app/javascript/components/pvc-import-image-form/pvc-import-image-form.jsx on lines 45..52

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const fetchBuckets = (provider) => {
return new Promise((resolve, reject) => {
API.get(API_OBJ_CONT + '?expand=resources&attributes=name,ems_id&filter[]=ems_id=' + provider).then(({resources}) => {
let options = resources.map(({id, name}) => ({value: id, label: name}));
resolve(options);
app/javascript/components/pvc-import-image-form/pvc-import-image-form.jsx on lines 36..43
Category
Status