bcgov/vue-scaffold

View on GitHub
app/src/components/chesService.js

Summary

Maintainability
D
2 days
Test Coverage
F
0%

Showing 6 of 6 total issues

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

constructor({tokenUrl, clientId, clientSecret, apiUrl}) {
log.verbose(`Constructed with ${tokenUrl}, ${clientId}, clientSecret, ${apiUrl}`, { function: 'constructor' });
if (!tokenUrl || !clientId || !clientSecret || !apiUrl) {
log.error('Invalid configuration.', { function: 'constructor' });
throw new Error('ChesService is not configured. Check configuration.');
Severity: Major
Found in app/src/components/chesService.js and 1 other location - About 1 day to fix
app/src/components/cdogsService.js on lines 13..23

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

async merge(data) {
try {
const response = await this.axios.post(
`${this.apiV1}/emailMerge`,
data,
Severity: Major
Found in app/src/components/chesService.js and 2 other locations - About 3 hrs to fix
app/src/components/chesService.js on lines 88..105
app/src/components/chesService.js on lines 127..144

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

async preview(data) {
try {
const response = await this.axios.post(
`${this.apiV1}/emailMerge/preview`,
data,
Severity: Major
Found in app/src/components/chesService.js and 2 other locations - About 3 hrs to fix
app/src/components/chesService.js on lines 88..105
app/src/components/chesService.js on lines 108..125

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

async send(email) {
try {
const response = await this.axios.post(
`${this.apiV1}/email`,
email,
Severity: Major
Found in app/src/components/chesService.js and 2 other locations - About 3 hrs to fix
app/src/components/chesService.js on lines 108..125
app/src/components/chesService.js on lines 127..144

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

async cancelQuery(params) {
try {
const response = await this.axios.delete(
`${this.apiV1}/cancel`,
{
Severity: Major
Found in app/src/components/chesService.js and 1 other location - About 2 hrs to fix
app/src/components/chesService.js on lines 38..53

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

async statusQuery(params) {
try {
const response = await this.axios.get(
`${this.apiV1}/status`,
{
Severity: Major
Found in app/src/components/chesService.js and 1 other location - About 2 hrs to fix
app/src/components/chesService.js on lines 71..86
Category
Status