NMDSdevopsServiceAdm/SopraSteria-SFC

View on GitHub
backend/migrations/20201005112700-poolbankLAReport.js

Summary

Maintainability
F
4 days
Test Coverage

Showing 5 of 5 total issues

Function up has 308 lines of code (exceeds 25 allowed). Consider refactoring.
Open

up: (queryInterface, Sequelize) => {
return queryInterface.sequelize.transaction((transaction) => {
return queryInterface.sequelize.query(`
CREATE OR REPLACE FUNCTION cqc.localauthorityreportworker(establishmentid integer,reportfrom date,reportto date)
RETURNS boolean
Severity: Major
Found in backend/migrations/20201005112700-poolbankLAReport.js - About 1 day to fix

    Function down has 306 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    down: (queryInterface, Sequelize) => {
    return queryInterface.sequelize.transaction((transaction) => {
    return queryInterface.sequelize.query(`
    CREATE FUNCTION cqc.localauthorityreportworker(establishmentid integer, reportfrom date, reportto date) RETURNS boolean
    LANGUAGE plpgsql
    Severity: Major
    Found in backend/migrations/20201005112700-poolbankLAReport.js - About 1 day to fix

      File 20201005112700-poolbankLAReport.js has 621 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
       
      module.exports = {
      up: (queryInterface, Sequelize) => {
      return queryInterface.sequelize.transaction((transaction) => {
      Severity: Major
      Found in backend/migrations/20201005112700-poolbankLAReport.js - About 1 day to fix

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

        up: (queryInterface, Sequelize) => {
        return queryInterface.sequelize.transaction((transaction) => {
        return queryInterface.sequelize.query(`
        CREATE OR REPLACE FUNCTION cqc.localauthorityreportworker(establishmentid integer,reportfrom date,reportto date)
        RETURNS boolean
        Severity: Minor
        Found in backend/migrations/20201005112700-poolbankLAReport.js and 1 other location - About 55 mins to fix
        backend/migrations/20201005112700-poolbankLAReport.js on lines 350..691

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

        down: (queryInterface, Sequelize) => {
        return queryInterface.sequelize.transaction((transaction) => {
        return queryInterface.sequelize.query(`
        CREATE FUNCTION cqc.localauthorityreportworker(establishmentid integer, reportfrom date, reportto date) RETURNS boolean
        LANGUAGE plpgsql
        Severity: Minor
        Found in backend/migrations/20201005112700-poolbankLAReport.js and 1 other location - About 55 mins to fix
        backend/migrations/20201005112700-poolbankLAReport.js on lines 4..348

        There are no issues that match your filters.

        Category
        Status