open-eats/openeats-web

View on GitHub

Showing 67 of 202 total issues

Function render has 304 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { formatMessage } = this.props.intl;
    const messages = defineMessages({
      name_label: {
        id: 'recipe.create.name_label',
Severity: Major
Found in modules/recipe_form/components/RecipeForm.js - About 1 day to fix

    Function render has 183 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const { courses, cuisines, ratings, qs, buildUrl, intl } = this.props;
        const messages = defineMessages({
          reset: {
            id: 'filter.reset',
    Severity: Major
    Found in modules/browse/components/SearchMenu.js - About 7 hrs to fix

      Function save has 106 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const save = (data, event) => {
        return (dispatch) => {
          dispatch({
            type: StatusConstants.RECIPE_FROM_STATUS_DISPLAY,
            message: 'Saving recipe. Please wait...',
      Severity: Major
      Found in modules/recipe_form/actions/RecipeFormActions.js - About 4 hrs to fix

        File RecipeForm.js has 342 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react'
        import {
          injectIntl,
          defineMessages,
        } from 'react-intl';
        Severity: Minor
        Found in modules/recipe_form/components/RecipeForm.js - About 4 hrs to fix

          Function recipes has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const recipes = (state = [], action) => {
            switch (action.type) {
              case RecipeConstants.RECIPE_LOAD:
                let recipe = state.find(t => t.id === action.data.id);
                let subRecipes, ingredients;
          Severity: Major
          Found in modules/recipe/reducers/RecipeReducer.js - About 3 hrs to fix

            Function render has 87 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                let footer;
                let main;
                let items = this.props.items;
            
            
            Severity: Major
            Found in modules/list/components/ListItems.js - About 3 hrs to fix

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

                render () {
                  let { id, show, onHide, fetchRecipeList, intl } = this.props;
                  let { recipe, title, placeholder, start_date, complete } = this.state;
                  const messages = defineMessages({
                    start_date: {
              Severity: Major
              Found in modules/menu/components/modals/MenuItemModal.js - About 3 hrs to fix

                Function render has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    const { formatMessage } = this.props.intl;
                    const messages = defineMessages({
                      ingredients: {
                        id: 'recipe.ingredients',
                Severity: Major
                Found in modules/recipe/components/RecipeScheme.js - About 3 hrs to fix

                  Function render has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      const { formatMessage } = this.props.intl;
                      const messages = defineMessages({
                        name_label: {
                          id: 'newRating.create.name_label',
                  Severity: Major
                  Found in modules/rating/components/NewRating.js - About 2 hrs to fix

                    Function render has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      render() {
                        const { formatMessage } = this.props.intl;
                        const messages = defineMessages({
                          preview: {
                            id: 'recipe.create.preview',
                    Severity: Major
                    Found in modules/recipe_form/components/TabbedView.js - About 2 hrs to fix

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

                        render() {
                          const {formatMessage} = this.props.intl;
                          const messages = defineMessages({
                            search: {
                              id: 'searchbar.label',
                      Severity: Major
                      Found in modules/browse/components/SearchBar.js - About 2 hrs to fix

                        Function bulkAdd has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const bulkAdd = (recipeState, list) => {
                          return (dispatch) => {
                            const format = (i) => {
                              const quantity = i.quantity && i.quantity !== '0' ? i.quantity + " " : '';
                              const measurement = i.measurement ? i.measurement + " " : '';
                        Severity: Minor
                        Found in modules/recipe/actions/RecipeItemActions.js - About 2 hrs to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

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

                          render() {
                            const {formatMessage} = this.props.intl;
                            const messages = defineMessages({
                              brand: {
                                id: 'nav.brand',
                        Severity: Major
                        Found in modules/header/components/NavBar.js - About 2 hrs to fix

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

                            render() {
                              const { menuItems, stats, SimpleLayout } = this.props;
                              const { menuItemActions } = this.props;
                              const { showItemModal, editMenuItemEventId, startDate, tab } = this.state;
                          
                          
                          Severity: Major
                          Found in modules/menu/containers/Menu.js - About 2 hrs to fix

                            Function Pagination has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const Pagination = ({ offset, limit, count, buildUrl }) => {
                              offset = offset ? parseInt(offset, 10) : 0;
                              limit = limit ? parseInt(limit, 10) : 0;
                              count = count ? parseInt(count, 10) : 0;
                              let next = offset + limit;
                            Severity: Minor
                            Found in modules/browse/components/Pagination.js - About 2 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function save has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const save = (id, data) => {
                              return (dispatch) => {
                                dispatch({
                                  type: StatusConstants.MENU_STATUS_DISPLAY,
                                  message: 'Saving. Please wait...',
                            Severity: Major
                            Found in modules/menu/actions/MenuItemActions.js - About 2 hrs to fix

                              Function items has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const items = (state = [], action) => {
                                switch (action.type) {
                                  case ItemConstants.ITEM_INIT:
                                    return action.items.map(listItem => {
                                      return { ...listItem }
                              Severity: Major
                              Found in modules/list/reducers/ItemReducer.js - About 2 hrs to fix

                                Function render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  render() {
                                    const { formatMessage } = this.props.intl;
                                    const messages = defineMessages({
                                      my_lists: {
                                        id: 'grocery_list.my_lists',
                                Severity: Minor
                                Found in modules/list/components/GroceryList.js - About 1 hr to fix

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

                                  export const save = (data, event) => {
                                    return (dispatch) => {
                                      dispatch({
                                        type: StatusConstants.RECIPE_FROM_STATUS_DISPLAY,
                                        message: 'Saving recipe. Please wait...',
                                  Severity: Minor
                                  Found in modules/recipe_form/actions/RecipeFormActions.js - About 1 hr to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

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

                                    render() {
                                      const {formatMessage} = this.props.intl;
                                      const messages = defineMessages({
                                        please_sign_in: {
                                          id: 'login.please_sign_in',
                                  Severity: Minor
                                  Found in modules/account/components/LoginForm.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language