mhaidarh/super-workshop-js

View on GitHub

Showing 17 of 17 total issues

File controller.js has 314 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const mongoose = require('mongoose')
const R = require('ramda')

const Book = require('./model')
const books = require('./seed.json')
Severity: Minor
Found in servers/server-express/api/books/controller.js - About 3 hrs to fix

    Function compileBookEditor has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function compileBookEditor () {
        $bookEditor.append(Handlebars.compile($bookEditorTemplate))
        $bookEditor.hide()
    
        // --------
    Severity: Major
    Found in clients/client-jquery/public/scripts/admin.js - About 2 hrs to fix

      Function updateBookByISBNAndOwner has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        updateBookByISBNAndOwner: (req, res) => {
          // Prepare response data
          let updated = {
            s: true,
            m: 'Successfully updated book by ISBN to put with owner account ID.',
      Severity: Major
      Found in servers/server-express/api/books/controller.js - About 2 hrs to fix

        Function seedBooksLot has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          seedBooksLot: (req, res) => {
            // Get the admin you're looking for...
            Account.findOne({ roles: { '$in': ['admin']} }, (err, admin) => {
              if (err) res.status(400).send({ id: 'books_seed_find_admin_error', m: err })
              if (!admin) res.status(400).send({ id: 'books_seed_find_admin_failed', m: 'Failed to find admin.' })
        Severity: Minor
        Found in servers/server-express/api/books/controller.js - About 1 hr to fix

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

            signin: (req, res, next) => {
              // Check for username and password
              if (!req.body.username || !req.body.password) {
                res.status(400).json({ id: 'signin_failed_no_username_password', m: `Sign in failed because no username or password.` })
              } else {
          Severity: Minor
          Found in servers/server-express/auth/controller.js - About 1 hr to fix

            Function deleteBookByISBN has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              deleteBookByISBN: (req, res) => {
                let updated = {
                  m: `Book with ISBN '${req.params.isbn}' has been removed.`,
                  book: null,
                  i: null
            Severity: Minor
            Found in servers/server-express/api/books/controller.js - About 1 hr to fix

              Function seedBooks has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                seedBooks: (req, res) => {
                  // Drop books collection
                  mongoose.connection.db.dropCollection('books', (err, result) => {
                    if (err) res.status(400).send({ id: 'books_drop_error', e: `${err}` })
                    console.log(`[x] ACCOUNT SEED: Dropped collection 'books'`)
              Severity: Minor
              Found in servers/server-express/api/books/controller.js - About 1 hr to fix

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

                  seed: (req, res) => {
                    // Drop posts collection
                    mongoose.connection.db.dropCollection(`${resources}`, (err, result) => {
                      if (err) res.status(400).send({ id: `${resources}_drop_error`, e: `${err}` })
                      // console.log(`[x] Dropped collection: ${resources}`)
                Severity: Minor
                Found in servers/server-express/api/posts/controller.js - About 1 hr to fix

                  Function exports has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = (passport) => {
                    // ---------------------------------------------------------------------------
                    // GITHUB
                    passport.use(new GitHubStrategy({
                      clientID: process.env.GITHUB_CLIENT_ID,
                  Severity: Minor
                  Found in servers/server-express/auth/providers.js - About 1 hr to fix

                    Function signup has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      signup: (req, res, next) => {
                        // Send info if the data is not complete
                        // Send info if password is weak
                        if (!req.body.name || !req.body.email || !req.body.username || !req.body.password) {
                          res.status(400).json({id: 'signup_failed', m: 'Please provide required sign up data: name, email, username, password.'})
                    Severity: Minor
                    Found in servers/server-express/auth/controller.js - About 1 hr to fix

                      Adjoining classes: .ui.account.container
                      Open

                       .ui.account.container {

                      Adjoining classes: .ui.account.container
                      Open

                       .ui.account.container {

                      Adjoining classes: .ui.selection.dropdown
                      Open

                       .ui.selection.dropdown {

                      Adjoining classes: .ui.selection.dropdown
                      Open

                       .ui.selection.dropdown {

                      Adjoining classes: .ui.container
                      Open

                       .ui.container {

                      TODO found
                      Open

                          // TODO: use fields query

                      TODO found
                      Open

                      # TODO
                      Severity: Minor
                      Found in TODO.md by fixme
                      Severity
                      Category
                      Status
                      Source
                      Language