realpython/members

View on GitHub
src/server/db/_seed_helpers.js

Summary

Maintainability
C
1 day
Test Coverage

File _seed_helpers.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function() {

  'use strict';

  const knex = require('./connection');
Severity: Minor
Found in src/server/db/_seed_helpers.js - About 3 hrs to fix

    Function insertLessons has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function insertLessons(chapters) {
        // get chapter order number
        const chapterOrder = chapters.map((chapter) => {
          return chapter.order_number;
        });
    Severity: Major
    Found in src/server/db/_seed_helpers.js - About 3 hrs to fix

      Function insertMessages has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function insertMessages(userID) {
          return Promise.all([
            knex('messages')
            .insert({
              content: 'Awesome lesson!',
      Severity: Minor
      Found in src/server/db/_seed_helpers.js - About 1 hr to fix

        Function insertCodes has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function insertCodes() {
            return Promise.all([
              knex('codes').insert({
                verify_code: 'oGvufQsOUL7264B8M0g4J5lkr1VcyYiR'
              }),
        Severity: Minor
        Found in src/server/db/_seed_helpers.js - About 1 hr to fix

          Function createLesson has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              lessonOrder, chapterOrder, lessonName,
              lessonContent, chapterID, lessonActive,
              knex, Promise
          Severity: Major
          Found in src/server/db/_seed_helpers.js - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status