sparkletown/sparkle

View on GitHub
functions/scheduled.js

Summary

Maintainability
C
1 day
Test Coverage

Function updateSeatedUsersCountInAuditorium has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const updateSeatedUsersCountInAuditorium = async () => {
  await removeDanglingSeatedUsers();

  const firestore = admin.firestore();
  let updateOccupiedPromises = [{ batch: firestore.batch(), updatesCount: 0 }];
Severity: Major
Found in functions/scheduled.js - About 4 hrs to fix

Function removeDanglingSeatedUsers has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const removeDanglingSeatedUsers = async () => {
  const firestore = admin.firestore();

  const expiredSittingTimeMs = Date.now() - USER_INACTIVE_THRESHOLD;

Severity: Major
Found in functions/scheduled.js - About 2 hrs to fix

File scheduled.js has 269 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const admin = require("firebase-admin");

const functions = require("firebase-functions");

const {
Severity: Minor
Found in functions/scheduled.js - About 2 hrs to fix

Function updateUsersLocations has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  .onRun(async () => {
    await updateSeatedUsersCountInAuditorium();

    const venuesPromise = admin
      .firestore()
Severity: Minor
Found in functions/scheduled.js - About 1 hr to fix

There are no issues that match your filters.

Category
Status