Showing 6 of 6 total issues
File index.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { combineReducers } from 'redux';
import isFunction from 'lodash/isFunction';
import isArray from 'lodash/isArray';
import isEqual from 'lodash/isEqual';
import isEmpty from 'lodash/isEmpty';
Function createDefaultMethodReducer
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function createDefaultMethodReducer({ types }) {
const [start, success, failure, reset] = types;
return function defaultMethodReducer(state = [], action) {
if (action.type === reset) {
- 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 defaultMethodReducer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function defaultMethodReducer(state = [], action) {
if (action.type === reset) {
return [];
}
Function createModel
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createModel(options = {}) {
let {
typePrefix,
modelState,
modelsState,
Function normalizeMethods
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function normalizeMethods(methods, { mixins = null } = {}) {
const baseMethods = isArray(methods)
? methods
.map(method => ({
methodName: isString(method) ? method : method.name,
- 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 createReducers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function createReducers({
typePrefix,
modelName,
methods,
reducer,
- 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"