Showing 88 of 559 total issues
File submission.js
has 556 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const {Model} = require('objection');
const CommonModels = require('../../common/models');
const constants = require('../constants');
const SubmissionSchema = {
File base.js
has 433 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const { Model } = require('objection');
const constants = require('../constants');
const stamps = require('./jsonSchema').stamps;
const Timestamps = require('./mixins').Timestamps;
Function up
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => knex.schema.alterTable(`${AGRI_PREFIX}_submission_location`, table => {
table.dropColumn('mineNumber');
table.dropColumn('permitNumber');
Function up
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => {
return knex(`${PREFIX}_version_status_code`).del();
})
Function up
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => {
return knex(`${PREFIX}_version_status_code`).del();
})
Function up
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => {
return knex(`${PREFIX}_version_status_code`).del();
})
Function down
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.down = function(knex) {
return Promise.resolve()
.then(() => knex.schema.alterTable(`${AGRI_PREFIX}_submission_location`, table => {
table.string('mineNumber').nullable();
table.string('permitNumber').nullable();
File dataService.js
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const equal = require('fast-deep-equal');
const log = require('npmlog');
const Problem = require('api-problem');
const {transaction} = require('objection');
const {v4: uuidv4} = require('uuid');
Function up
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function (knex) {
return Promise.resolve()
.then(() => knex.schema.raw(`create view ${AGRI_PREFIX}_submission_search_vw
("submissionId", "createdAt", deleted, "formVersionId", "confirmationId", "operationType", "assignedTo",
"statusCode", "statusDate", name, city, "operationTypeDisplay", "statusDisplay")
Function up
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => knex.schema.createTable(`${PREFIX}_submission_location`, table => {
table.increments('locationId').primary();
table.uuid('submissionId').references('submissionId').inTable(`${PREFIX}_submission`).notNullable().index();
Function up
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => knex.schema.createTable(`${PREFIX}_submission_location`, table => {
table.increments('locationId').primary();
table.uuid('submissionId').references('submissionId').inTable(`${PREFIX}_submission`).notNullable().index();
Function up
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => knex.schema.createTable(`${PREFIX}_submission_location`, table => {
table.increments('locationId').primary();
table.uuid('submissionId').references('submissionId').inTable(`${PREFIX}_submission`).notNullable().index();
Function up
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => knex.schema.createTable(`${PREFIX}_submission_location`, table => {
table.increments('locationId').primary();
table.uuid('submissionId').references('submissionId').inTable(`${PREFIX}_submission`).notNullable().index();
File dataService.js
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const equal = require('fast-deep-equal');
const log = require('npmlog');
const Problem = require('api-problem');
const {transaction} = require('objection');
const {v4: uuidv4} = require('uuid');
File 20200604071226_012-cleanup-data-and-model.js
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const AGRI_PREFIX = require('../../forms/attestations/agriseafoodopscreening/constants').PREFIX;
const AGRI_TITLE = require('../../forms/attestations/agriseafoodopscreening/constants').TITLE;
const AGRI_TITLE_ORIG = 'Agriculture/Seafood Operator Screening';
Function up
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return knex(`${PREFIX}_settings`).del()
.then(() => {
const data = {
name: 'submissionEmail',
Function up
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => knex.schema.createTable(`${PREFIX}_form`, table => {
table.uuid('formId').references('formId').inTable('form').notNullable().primary();
table.string('description');
Function up
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => knex.schema.createTable(`${PREFIX}_form`, table => {
table.uuid('formId').references('formId').inTable('form').notNullable().primary();
table.string('description');
Function up
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => knex.schema.createTable(`${PREFIX}_form`, table => {
table.uuid('formId').references('formId').inTable('form').notNullable().primary();
table.string('description');
Function up
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = function(knex) {
return Promise.resolve()
.then(() => {
return knex(`${PREFIX}_version_status_code`).del();
})