ForestAdmin/forest-express-sequelize

View on GitHub
src/services/leaderboard-stat-getter.js

Summary

Maintainability
A
3 hrs
Test Coverage
A
96%

Function LeaderboardStatGetter has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function LeaderboardStatGetter(childModel, parentModel, params, user) {
  const labelField = params.labelFieldName;
  const aggregate = params.aggregator.toUpperCase();
  const { limit } = params;
  const childSchema = Schemas.schemas[childModel.name];
Severity: Major
Found in src/services/leaderboard-stat-getter.js - About 2 hrs to fix

    Function perform has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      this.perform = async () => {
        const { timezone } = params;
        const parentSequelizeOptions = await getSequelizeOptionsForModel(parentModel, user, timezone);
        const childSequelizeOptions = await getSequelizeOptionsForModel(childModel, user, timezone);
    
    
    Severity: Minor
    Found in src/services/leaderboard-stat-getter.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status