Lambda-School-Labs/allay-be

View on GitHub

Showing 11 of 85 total issues

Function seed has 162 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.seed = function (knex) {
  // Deletes ALL existing entries
  return knex('states')
    .del()
    .then(function () {
Severity: Major
Found in data/seeds/006-states_table.js - About 6 hrs to fix

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

    exports.up = function (knex) {
      return knex.schema.createTable('reviews', tbl => {
        tbl.increments();
        tbl.string('job_title').notNullable();
        tbl.integer('start_date');
    Severity: Major
    Found in data/migrations/20200312161741_reviews_table.js - About 2 hrs to fix

      Function seed has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.seed = function (knex) {
        // Deletes ALL existing entries
        return knex('users')
          .del()
          .then(function () {
      Severity: Major
      Found in data/seeds/008-users.js - About 2 hrs to fix

        Function findReviewsById has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function findReviewsById(revId) {
          return db('reviews as r')
            .select(
              'r.id as review_id',
              'u.id as user_id',
        Severity: Minor
        Found in helpers/reviews-model.js - About 1 hr to fix

          Function findReviews has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function findReviews() {
            return db('reviews as r')
              .select(
                'r.id as review_id',
                'u.id as user_id',
          Severity: Minor
          Found in helpers/reviews-model.js - About 1 hr to fix

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

            function findUserReviewsById(revId) {
              return db('reviews as r')
                .select(
                  'r.id as review_id',
                  'u.id as user_id',
            Severity: Minor
            Found in helpers/users-model.js - About 1 hr to fix

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

              function findUserReviews(userId) {
                return db('reviews as r')
                  .select(
                    'r.id as review_id',
                    'u.id as user_id',
              Severity: Minor
              Found in helpers/users-model.js - About 1 hr to fix

                Function findUserById has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function findUserById(userId) {
                  return db('users as u')
                    .where('id', userId)
                    .select(
                      'u.id',
                Severity: Minor
                Found in helpers/users-model.js - About 1 hr to fix

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

                  exports.down = function (knex) {
                    return knex('users')
                      .del()
                      .then(() => {
                        return knex.schema.alterTable('users', tbl => {
                  Severity: Minor
                  Found in data/migrations/20200428091407_users_table.js - About 1 hr to fix

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

                    exports.up = function (knex) {
                      return knex('users')
                        .del()
                        .then(() => {
                          return knex.schema.alterTable('users', tbl => {
                    Severity: Minor
                    Found in data/migrations/20200428091407_users_table.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                        } else if (
                          !req.body.password ||
                          !req.body.email ||
                          !req.body.track_id ||
                          !req.body.first_name ||
                      Severity: Major
                      Found in middleware/index.js - About 40 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language