Showing 6 of 17 total issues
Function isDispatchActionsEqual
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Confirmed
Confirmed
function isDispatchActionsEqual(arr1, arr2) {
// Determine if a function was passed.
const isFunc1 = typeof arr1 === 'function';
const isFunc2 = typeof arr2 === 'function';
if (isFunc1 || isFunc2) {
- 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 resolveActionSets
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
Confirmed
export function resolveActionSets(routeComponents, dispatchActions, initParamFuncName, isLifecycleMethod, actionFilter) {
const actionSets = parseDispatchActions(dispatchActions);
const resolvedActionSets = [];
actionSets.forEach(actionSet => {
Function isDispatchActionsEqual
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
Confirmed
function isDispatchActionsEqual(arr1, arr2) {
// Determine if a function was passed.
const isFunc1 = typeof arr1 === 'function';
const isFunc2 = typeof arr2 === 'function';
if (isFunc1 || isFunc2) {
Function withActions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Confirmed
Confirmed
export default function withActions(mapParamsToProps, ...actions) {
if (!(typeof mapParamsToProps === 'undefined' || mapParamsToProps === null)) {
invariant(typeof mapParamsToProps === 'function', '"mapParamsToProps" must be either a function, or null.');
}
- 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 resolveActionSets
has 5 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
Confirmed
export function resolveActionSets(routeComponents, dispatchActions, initParamFuncName, isLifecycleMethod, actionFilter) {
TODO found Confirmed
Confirmed
// TODO: Remove the need for any default parameters
- Exclude checks