Showing 17 of 17 total issues
File controller.js
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const mongoose = require('mongoose')
const R = require('ramda')
const Book = require('./model')
const books = require('./seed.json')
Function compileBookEditor
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function compileBookEditor () {
$bookEditor.append(Handlebars.compile($bookEditorTemplate))
$bookEditor.hide()
// --------
Function updateBookByISBNAndOwner
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateBookByISBNAndOwner: (req, res) => {
// Prepare response data
let updated = {
s: true,
m: 'Successfully updated book by ISBN to put with owner account ID.',
Function seedBooksLot
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
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.' })
Function signin
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 {
Function deleteBookByISBN
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
deleteBookByISBN: (req, res) => {
let updated = {
m: `Book with ISBN '${req.params.isbn}' has been removed.`,
book: null,
i: null
Function seedBooks
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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'`)
Function seed
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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}`)
Function exports
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (passport) => {
// ---------------------------------------------------------------------------
// GITHUB
passport.use(new GitHubStrategy({
clientID: process.env.GITHUB_CLIENT_ID,
Function signup
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
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.'})
Adjoining classes: .ui.account.container Open
Open
.ui.account.container {
- Exclude checks
Adjoining classes: .ui.account.container Open
Open
.ui.account.container {
- Exclude checks
Adjoining classes: .ui.selection.dropdown Open
Open
.ui.selection.dropdown {
- Exclude checks
Adjoining classes: .ui.selection.dropdown Open
Open
.ui.selection.dropdown {
- Exclude checks
Adjoining classes: .ui.container Open
Open
.ui.container {
- Exclude checks
TODO found Open
Open
// TODO: use fields query
- Exclude checks
TODO found Open
Open
# TODO
- Exclude checks