chykehyman/More-Recipes

View on GitHub

Showing 118 of 118 total issues

File browserTests.test.js has 575 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { resolve } from 'path';
import {
validSignup1, validSignup2,
invalidSignUp, invalidSignin, invalidRecipe,
validRecipe, profileValid
Severity: Major
Found in e2e-tests/browserTests.test.js - About 1 day to fix

    `` has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default {
    'Render home page correctly':
    (browser) => {
    browser
    .url('http://localhost:7777')
    Severity: Minor
    Found in e2e-tests/browserTests.test.js - About 4 hrs to fix

      Function signup has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      static signup(request, response, next) {
      if (typeof request.body.fullName === 'undefined' || typeof request.body.username === 'undefined' || typeof request.body.email === 'undefined' ||
      typeof request.body.password === 'undefined' || typeof request.body.repassword === 'undefined') {
      return requestFeedback.error(response, 422, 'All or some fields are not defined');
      }
      Severity: Minor
      Found in server/middleware/validations/users.js - About 3 hrs to fix

      Function updateUserValidations has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

      static updateUserValidations(request, response, next) {
      if (typeof request.body.fullName === 'undefined' || typeof request.body.username === 'undefined' ||
      typeof request.body.email === 'undefined' || typeof request.body.location === 'undefined' ||
      typeof request.body.aboutMe === 'undefined') {
      return requestFeedback.error(response, 422, 'All or some fields are not defined');
      Severity: Minor
      Found in server/middleware/validations/users.js - About 3 hrs to fix

      Function fetchRecipes has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const fetchRecipes = (
      request, response, recipesModel, usersModel,
      favoritesModel, userId, orderBy, orderType, message1, message2
      ) => {
      let recipeQuery = {};
      Severity: Major
      Found in server/utils/recipes.js - About 3 hrs to fix

        Function updateRecipeValidations has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        static updateRecipeValidations(request, response, next) {
        const { title, ingredients, procedures } = request.body,
        recipeId = parseInt(request.params.recipeID.trim(), 10),
        errors = {};
         
         
        Severity: Minor
        Found in server/middleware/validations/recipes.js - About 2 hrs to fix

        Function getSingleRecipe has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        static getSingleRecipe(request, response) {
        const recipeId = parseInt(request.params.recipeID.trim(), 10);
        let isFavorited = false,
        vote = '';
         
         
        Severity: Major
        Found in server/controllers/recipes.js - About 2 hrs to fix

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

          up: (queryInterface, Sequelize) => {
          queryInterface.createTable('Recipes', {
          id: {
          allowNull: false,
          autoIncrement: true,
          Severity: Major
          Found in server/migrations/20171004114443-create-recipes.js - About 2 hrs to fix

            Function updateRecipe has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            static updateRecipe(request, response) {
            const {
            title,
            ingredients,
            procedures,
            Severity: Major
            Found in server/controllers/recipes.js - About 2 hrs to fix

              Function addRecipeValidations has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              static addRecipeValidations(request, response, next) {
              if (typeof request.body.title === 'undefined' || typeof request.body.ingredients === 'undefined' || typeof request.body.procedures === 'undefined') {
              return requestFeedback.error(response, 422, 'All or some fields are not defined');
              }
               
               
              Severity: Minor
              Found in server/middleware/validations/recipes.js - About 1 hr to fix

              Function updateUser has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              static updateUser(request, response) {
              const {
              fullName,
              username,
              email,
              Severity: Minor
              Found in server/controllers/users.js - About 1 hr to fix

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

                up: (queryInterface, Sequelize) => {
                queryInterface.createTable('Users', {
                id: {
                allowNull: false,
                autoIncrement: true,
                Severity: Minor
                Found in server/migrations/20171004113757-create-users.js - About 1 hr to fix

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

                  static votes(request, response) {
                  const recipeId = parseInt(request.params.recipeID.trim(), 10),
                  { userId } = request.decoded,
                  { vote } = request.query;
                   
                   
                  Severity: Minor
                  Found in server/controllers/votes.js - About 1 hr to fix

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

                    up: (queryInterface, Sequelize) => {
                    queryInterface.createTable('Reviews', {
                    id: {
                    allowNull: false,
                    autoIncrement: true,
                    Severity: Minor
                    Found in server/migrations/20171004115226-create-reviews.js - About 1 hr to fix

                      Function updateUserValidations has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      static updateUserValidations(request, response, next) {
                      if (typeof request.body.fullName === 'undefined' || typeof request.body.username === 'undefined' ||
                      typeof request.body.email === 'undefined' || typeof request.body.location === 'undefined' ||
                      typeof request.body.aboutMe === 'undefined') {
                      return requestFeedback.error(response, 422, 'All or some fields are not defined');
                      Severity: Minor
                      Found in server/middleware/validations/users.js - About 1 hr to fix

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

                        static signup(request, response, next) {
                        if (typeof request.body.fullName === 'undefined' || typeof request.body.username === 'undefined' || typeof request.body.email === 'undefined' ||
                        typeof request.body.password === 'undefined' || typeof request.body.repassword === 'undefined') {
                        return requestFeedback.error(response, 422, 'All or some fields are not defined');
                        }
                        Severity: Minor
                        Found in server/middleware/validations/users.js - About 1 hr to fix

                          Line 25 exceeds the maximum line length of 80.
                          Open

                          requestFeedback.error(response, 401, 'Authentication failed. Token is invalid or expired');
                          Severity: Minor
                          Found in server/middleware/authToken.js by eslint

                          Line 68 exceeds the maximum line length of 80.
                          Open

                          * @returns {object} validation error messages object or content(s) of request.body object

                          Line 15 exceeds the maximum line length of 80.
                          Open

                          sequelize = new Sequelize(config.database, config.username, config.password, config);
                          Severity: Minor
                          Found in server/models/index.js by eslint

                          Line 15 exceeds the maximum line length of 80.
                          Open

                          <img src="http://bit.ly/2mTfo2w" alt="mail image" style="height:180px; width: 100%" />
                          Severity
                          Category
                          Status
                          Source
                          Language