tieme-ndo/backend

View on GitHub
controllers/farmer/statistics.js

Summary

Maintainability
A
1 hr
Test Coverage

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

const getStatistics = async (req, res, next) => {
  try {
    const allFarmers = await models.Farmer.find({ archived: false });

    const totalNumOfFarmers = allFarmers.length;
Severity: Minor
Found in controllers/farmer/statistics.js - About 1 hr to fix

    Parsing error: Invalid ecmaVersion.
    Open

    const { models } = require('../../models');
    Severity: Minor
    Found in controllers/farmer/statistics.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    There are no issues that match your filters.

    Category
    Status