noobling/anglicare-sprint-week

View on GitHub
app_server/middleware/images.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function sendUploadToFirebase has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function sendUploadToFirebase(req, res, next) {
  if (!req.file) {
    return next();
  }

Severity: Minor
Found in app_server/middleware/images.js - About 1 hr to fix

    Function getImagesForService has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getImagesForService(service, serviceUri) {
      return new Promise((resolve, reject) => {
        let metadataCount = 0;
        let listCount = 0;
        const imageDict = [];
    Severity: Minor
    Found in app_server/middleware/images.js - About 1 hr to fix

      Function deleteImageFromService has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function deleteImageFromService(service, serviceUri, index) {
        return new Promise((resolve, reject) => {
          // Delete the image specified by 'index' from Firebase
          bucket.file(service.img[index]).delete().then(() => {
            // After deleting the image from Firebase, delete the image from MongoDB
      Severity: Minor
      Found in app_server/middleware/images.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status