BenMusch/nu-tab

View on GitHub
client/app/resources/Resource.js

Summary

Maintainability
C
1 day
Test Coverage

Showing 6 of 6 total issues

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

update = (resourceData, ext) => {
let data = {}
data[this.name] = resourceData
return axios
.put(this.pathTo().update + this._extension(ext), {...data, ...this.authenticityTokenObject()})
Severity: Major
Found in client/app/resources/Resource.js and 1 other location - About 2 hrs to fix
client/app/resources/Resource.js on lines 36..41

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

create = (resourceData, ext) => {
let data = {}
data[this.name] = resourceData
return axios
.post(this.pathTo().create + this._extension(ext), {...data, ...this.authenticityTokenObject()})
Severity: Major
Found in client/app/resources/Resource.js and 1 other location - About 2 hrs to fix
client/app/resources/Resource.js on lines 51..56

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

new = (ext) => {
return axios.get(this.pathTo().new + this._extension(ext), this.authenticityTokenObject())
}
Severity: Major
Found in client/app/resources/Resource.js and 3 other locations - About 55 mins to fix
client/app/resources/Resource.js on lines 28..30
client/app/resources/Resource.js on lines 43..45
client/app/resources/Resource.js on lines 47..49

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

index = (ext) => {
return axios.get(this.pathTo().index + this._extension(ext), this.authenticityTokenObject())
}
Severity: Major
Found in client/app/resources/Resource.js and 3 other locations - About 55 mins to fix
client/app/resources/Resource.js on lines 32..34
client/app/resources/Resource.js on lines 43..45
client/app/resources/Resource.js on lines 47..49

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

edit = (ext) => {
return axios.get(this.pathTo().edit + this._extension(ext), this.authenticityTokenObject())
}
Severity: Major
Found in client/app/resources/Resource.js and 3 other locations - About 55 mins to fix
client/app/resources/Resource.js on lines 28..30
client/app/resources/Resource.js on lines 32..34
client/app/resources/Resource.js on lines 43..45

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

show = (ext) => {
return axios.get(this.pathTo().show + this._extension(ext), this.authenticityTokenObject())
}
Severity: Major
Found in client/app/resources/Resource.js and 3 other locations - About 55 mins to fix
client/app/resources/Resource.js on lines 28..30
client/app/resources/Resource.js on lines 32..34
client/app/resources/Resource.js on lines 47..49
Category
Status