Showing 10 of 123 total issues
Function withPropsOnChange
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const withPropsOnChange = (shouldMapOrKeys, propsMapper) => BaseComponent => {
const factory = createFactory(BaseComponent)
const shouldMap =
typeof shouldMapOrKeys === 'function'
? shouldMapOrKeys
Function withReducer
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
) => BaseComponent => {
const factory = createFactory(BaseComponent)
class WithReducer extends Component {
state = {
stateValue: this.initializeStateValue(),
Function withHandlers
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const withHandlers = handlers => BaseComponent => {
const factory = createFactory(BaseComponent)
class WithHandlers extends Component {
handlers = mapValues(
typeof handlers === 'function' ? handlers(this.props) : handlers,
Function withStateHandlers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const withStateHandlers = (initialState, stateUpdaters) => BaseComponent => {
const factory = createFactory(BaseComponent)
class WithStateHandlers extends Component {
state = typeof initialState === 'function'
Function withState
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
) => BaseComponent => {
const factory = createFactory(BaseComponent)
class WithState extends Component {
state = {
stateValue:
Function withReducer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const withReducer = (
stateName,
dispatchName,
reducer,
initialState
- 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 shallowEqual
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function shallowEqual(objA, objB) {
if (is(objA, objB)) {
return true
}
- 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 withPropsOnChange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const withPropsOnChange = (shouldMapOrKeys, propsMapper) => BaseComponent => {
const factory = createFactory(BaseComponent)
const shouldMap =
typeof shouldMapOrKeys === 'function'
? shouldMapOrKeys
- 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 branch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const branch = (test, left, right = identity) => BaseComponent => {
let leftFactory
let rightFactory
const Branch = props => {
if (test(props)) {
- 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
Avoid too many return
statements within this function. Open
return true