Showing 5 of 5 total issues
Function getChildContext
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Confirmed
Confirmed
getChildContext() { const punditCheck = (type, action, model = null, user = null) => { const { policies } = this.props; let policy; if (Array.isArray(policies)) {
- Read upRead up
Avoid too many return
statements within this function. Confirmed
Confirmed
return policy[action].apply(null, [model, user || this.props.user]);
Avoid too many return
statements within this function. Confirmed
Confirmed
if (typeof policy[action] !== 'function') { return false; }
Avoid too many return
statements within this function. Confirmed
Confirmed
return false;
Avoid too many return
statements within this function. Confirmed
Confirmed
return policy[action].apply(null, [model, user || this.props.user]);