Showing 33 of 36 total issues
Function BookForm
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const BookForm = (props) => {
const categories = props.categories ?
<Categories
text='Select Book Category'
categories={props.categories}
Function render
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const loadingState = this.props.isLoading ?
<Loading text='Creating your account' /> : null;
return (
this.props.isLoggedIn === true ?
Function render
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const loadingState = this.props.isLoading ?
<Loading text='logging in' /> : null;
return (
this.props.isLoggedIn === true ?
File userController.spec.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import supertest from 'supertest';
import { assert } from 'chai';
import bcrypt from 'bcrypt';
import sinon from 'sinon';
Function render
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const loaderDisplay = this.props.fetchingBooks ?
<Loading text="fetching awesome books . . ." /> :
<div className="center">
<p style={{ fontWeight: 900 }}>
Function render
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const actionButtons = this.props.isAdmin ? (
<div className="card-action">
<Button
className="teal darken-4 action-btn edit-btn"
Function render
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const renderPage = this.state.redirect === true ?
<Redirect to='/dashboard' /> :
<div>
<Header
Function render
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const imageUploading = this.state.cover && !this.state.book.cover;
const imageUploaded = this.state.cover === null && this.state.book.cover;
const bookFileUploading = this.state.bookFile && !this.state.book.bookFile;
const bookFileUploaded = this.state.bookFile === null &&
Function borrowBook
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
borrowBook(req, res, next) {
const userId = req.params.id;
const bookId = req.body.id;
Book.findById(bookId)
.then((book) => {
File index.jsx
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Redirect } from 'react-router-dom';
import { Col, Row } from 'react-materialize';
Function Borrowed
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Borrowed = (props) => {
const books = props.borrowedBooks && props.borrowedBooks.length ?
props.borrowedBooks.map(book =>
<Col key={book.title} s={12} className="book-info grey-tex">
<div className="card horizontal">
Function up
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
up(queryInterface, Sequelize) {
return queryInterface.createTable('Users', {
id: {
allowNull: false,
autoIncrement: true,
Function up
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
up(queryInterface, Sequelize) {
return queryInterface.createTable('Books', {
id: {
allowNull: false,
autoIncrement: true,
Function BorrowedTable
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const BorrowedTable = (props) => {
const rows = props.books.length ? props.books.map((book) => {
const returned = book.borrowedBook.returned;
const bookImage = <img src={(book.cover &&
requestImageUrl(book.cover, { width: 50 })) || BOOK_IMAGE_FALLBACK}
Function createUser
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createUser(req, res, next) {
delete req.body.isAdmin;
const username = req.body.username;
const email = req.body.email;
return User.find({
Function passwordResetMail
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
passwordResetMail(req, res) {
return User.findOne({
where: { email: req.body.email },
attributes: ['id', 'email'],
plain: true,
Function TransactionHistory
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TransactionHistory = (props) => {
const transactions = props.transactions.length ?
props.transactions.map(
transaction => (
<Col s={12}
Function getUser
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getUser(req, res, next) {
const username = req.body.username;
const password = req.body.password;
return User.findOne({ where: { username } }).then((user) => {
if (!user) {
Function returnBook
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
returnBook(req, res, next) {
const bookId = req.body.id;
const userId = req.params.id;
BorrowedBook.findOne({ where: { userId, bookId, returned: false } })
.then((borrowedBook) => {
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let navLinks = ['library'];
navLinks = this.props.isLoggedIn ?
['dashboard', ...navLinks, 'history', 'logout'] :
['login', 'sign up', ...navLinks];