Showing 6 of 34 total issues
Function simpleAsync
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function simpleAsync(descriptor) {
if (typeof descriptor.effect !== 'function') {
throw new Error('Invalid descriptor for simpleAsync: "effect" must be a function')
}
return function* simpleSaga(action) {
- 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
File crud.test.js
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import jsc from 'jsverify'
import update from 'immutability-helper'
import * as generators from './generators'
import * as utils from './utils'
Function configureCrudReducer
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const configureCrudReducer = extractors => (state, action, t) => {
const { payload, type } = action
switch (type) {
case t.CREATE:
return update(state, {
File simple-async.test.js
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { call, put } from 'redux-saga/effects'
import simpleAsync from './simple-async'
import * as utils from './utils'
Function simpleAsync
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function simpleAsync(descriptor) {
if (typeof descriptor.effect !== 'function') {
throw new Error('Invalid descriptor for simpleAsync: "effect" must be a function')
}
return function* simpleSaga(action) {
Function simpleSaga
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function* simpleSaga(action) {
if (!action.meta) {
throw new Error(
`The action ${
action.type