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',
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',
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...',
File RecipeForm.js
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react'
import {
injectIntl,
defineMessages,
} from 'react-intl';
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;
Function render
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let footer;
let main;
let items = this.props.items;
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: {
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',
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',
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',
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',
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 + " " : '';
- Read upRead up
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',
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;
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;
- Read upRead up
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...',
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 }
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',
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...',
- Read upRead up
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',