NMDSdevopsServiceAdm/SopraSteria-SFC

View on GitHub

Showing 3,465 of 3,465 total issues

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

module.exports = {
up: (queryInterface, Sequelize) => {
const createTable = (queryInterface, tableName, column = null, transaction) => {
return queryInterface.createTable(
tableName,
backend/migrations/20230515143502-QualificationsByEstablishmentId.js on lines 3..110
backend/migrations/20230515155840-VacanciesByEstablishmentId.js on lines 3..110

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

module.exports = {
up: (queryInterface, Sequelize) => {
const createTable = (queryInterface, tableName, column = null, transaction) => {
return queryInterface.createTable(
tableName,
Severity: Major
Found in backend/migrations/20230515141901-payByLAandService.js and 1 other location - About 2 days to fix
backend/migrations/20230515153329-SicknessByEstablishmentId.js on lines 3..106

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

module.exports = {
up: (queryInterface, Sequelize) => {
const createTable = (queryInterface, tableName, column = null, transaction) => {
return queryInterface.createTable(
tableName,
Severity: Major
Found in backend/migrations/20230515153329-SicknessByEstablishmentId.js and 1 other location - About 2 days to fix
backend/migrations/20230515141901-payByLAandService.js on lines 3..106

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

down: async (queryInterface) => {
return queryInterface.sequelize.transaction(async (transaction) => {
await Promise.all([
queryInterface.sequelize.query(
'update cqc."ServicesCapacity" set "Question"=\'How many beds do you currently have?\' where "ServiceCapacityID"=1;',
Severity: Major
Found in backend/migrations/20220913142238-alterCapacitiesText.js and 1 other location - About 2 days to fix
backend/migrations/20220913142238-alterCapacitiesText.js on lines 4..89

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

up: async (queryInterface) => {
return queryInterface.sequelize.transaction(async (transaction) => {
await Promise.all([
queryInterface.sequelize.query(
'update cqc."ServicesCapacity" set "Question"=\'How many beds do you have?\' where "ServiceCapacityID"=1;',
Severity: Major
Found in backend/migrations/20220913142238-alterCapacitiesText.js and 1 other location - About 2 days to fix
backend/migrations/20220913142238-alterCapacitiesText.js on lines 91..176

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

module.exports = {
up: (queryInterface, Sequelize) => {
const createTable = (queryInterface, tableName, column = null, transaction) => {
return queryInterface.createTable(
tableName,
backend/migrations/20230515155207-TurnoverByLAAndService.js on lines 3..99
backend/migrations/20230515160333-VacanciesByLAAndService.js on lines 3..99

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

module.exports = {
up: (queryInterface, Sequelize) => {
const createTable = (queryInterface, tableName, column = null, transaction) => {
return queryInterface.createTable(
tableName,
Severity: Major
Found in backend/migrations/20230515160333-VacanciesByLAAndService.js and 2 other locations - About 2 days to fix
backend/migrations/20230515151930-QualificationsByLAAndService.js on lines 3..99
backend/migrations/20230515155207-TurnoverByLAAndService.js on lines 3..99

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

module.exports = {
up: (queryInterface, Sequelize) => {
const createTable = (queryInterface, tableName, column = null, transaction) => {
return queryInterface.createTable(
tableName,
Severity: Major
Found in backend/migrations/20230515155207-TurnoverByLAAndService.js and 2 other locations - About 2 days to fix
backend/migrations/20230515151930-QualificationsByLAAndService.js on lines 3..99
backend/migrations/20230515160333-VacanciesByLAAndService.js on lines 3..99

File user.js has 998 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
* user.js
*
* The encapsulation of a User, including all properties, all specific validation (not API, but object validation),
* saving & restoring of data to database (via sequelize model), construction and deletion.
Severity: Major
Found in backend/server/models/classes/user.js - About 2 days to fix

    Function exports has 470 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (sequelize, DataTypes) {
    const User = sequelize.define(
    'user',
    {
    id: {
    Severity: Major
    Found in backend/server/models/user.js - About 2 days to fix

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

      export class MetricsContent {
      title: string;
      description: string;
      tileDescription: string;
      noData: NoData;
      Severity: Major
      Found in frontend/src/app/core/model/benchmarks-v2.model.ts and 1 other location - About 2 days to fix
      frontend/src/app/core/model/benchmarks.model.ts on lines 62..139

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

      export class MetricsContent {
      title: string;
      description: string;
      tileDescription: string;
      noData: NoData;
      Severity: Major
      Found in frontend/src/app/core/model/benchmarks.model.ts and 1 other location - About 2 days to fix
      frontend/src/app/core/model/benchmarks-v2.model.ts on lines 101..178

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

      const updateServiceUsers = async (req, res) => {
      const establishmentId = req.establishmentId;
      const thisEstablishment = new Establishment.Establishment(req.username);
      try {
      // before updating an Establishment, we need to be sure the Establishment is
      Severity: Major
      Found in backend/server/routes/establishments/serviceUsers.js and 1 other location - About 2 days to fix
      backend/server/routes/establishments/capacity.js on lines 53..100

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

      const updateCapacity = async (req, res) => {
      const establishmentId = req.establishmentId;
      const thisEstablishment = new Establishment.Establishment(req.username);
       
      try {
      Severity: Major
      Found in backend/server/routes/establishments/capacity.js and 1 other location - About 2 days to fix
      backend/server/routes/establishments/serviceUsers.js on lines 54..100

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

      const updateShareData = async (req, res) => {
      const establishmentId = req.establishmentId;
      const thisEstablishment = new Establishment.Establishment(req.username);
       
      try {
      Severity: Major
      Found in backend/server/routes/establishments/shareData.js and 3 other locations - About 2 days to fix
      backend/server/routes/establishments/employerType.js on lines 56..99
      backend/server/routes/establishments/name.js on lines 57..100
      backend/server/routes/establishments/staff.js on lines 55..98

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

      const updateCurrentStaffNumber = async (req, res) => {
      const establishmentId = req.establishmentId;
      const thisEstablishment = new Establishment.Establishment(req.username);
       
      try {
      Severity: Major
      Found in backend/server/routes/establishments/staff.js and 3 other locations - About 2 days to fix
      backend/server/routes/establishments/employerType.js on lines 56..99
      backend/server/routes/establishments/name.js on lines 57..100
      backend/server/routes/establishments/shareData.js on lines 54..96

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

      const updateName = async (req, res) => {
      const establishmentId = req.establishmentId;
      const thisEstablishment = new Establishment.Establishment(req.username);
       
      try {
      Severity: Major
      Found in backend/server/routes/establishments/name.js and 3 other locations - About 2 days to fix
      backend/server/routes/establishments/employerType.js on lines 56..99
      backend/server/routes/establishments/shareData.js on lines 54..96
      backend/server/routes/establishments/staff.js on lines 55..98

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

      const updateEmployerType = async (req, res) => {
      const establishmentId = req.establishmentId;
      const thisEstablishment = new Establishment.Establishment(req.username);
       
      try {
      Severity: Major
      Found in backend/server/routes/establishments/employerType.js and 3 other locations - About 2 days to fix
      backend/server/routes/establishments/name.js on lines 57..100
      backend/server/routes/establishments/shareData.js on lines 54..96
      backend/server/routes/establishments/staff.js on lines 55..98

      File training.js has 831 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
      * training.js
      *
      * The encapsulation of a Worker's Training record, including all properties, all specific validation (not API, but object validation),
      * saving & restoring of data to database (via sequelize model), construction and deletion.
      Severity: Major
      Found in backend/server/models/classes/training.js - About 1 day to fix

        Establishment has 103 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Establishment extends EntityValidator {
        constructor(username, bulkUploadStatus = null) {
        super();
         
        this._username = username;
        Severity: Major
        Found in backend/server/models/classes/establishment.js - About 1 day to fix
          Severity
          Category
          Status
          Source
          Language