Function createShapeTypeChecker
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function createShapeTypeChecker(shapeTypes, immutableClassName = 'Iterable', immutableClassTypeValidator = Immutable.Iterable.isIterable) {
function validate(props, propName, componentName, location, propFullName, ...rest) {
var propValue = props[propName];
if (!immutableClassTypeValidator(propValue)) {
var propType = getPropType(propValue);
- 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 createRecordOfTypeChecker
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function createRecordOfTypeChecker(recordKeys) {
function validate(props, propName, componentName, location, propFullName, ...rest) {
var propValue = props[propName];
if (!(propValue instanceof Immutable.Record)) {
var propType = getPropType(propValue);
- 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 createIterableTypeChecker
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function createIterableTypeChecker(typeChecker, immutableClassName, immutableClassTypeValidator) {
function validate(props, propName, componentName, location, propFullName, ...rest) {
var propValue = props[propName];
if (!immutableClassTypeValidator(propValue)) {
- 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 checkType
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function checkType(isRequired, props, propName, componentName, location, propFullName, ...rest) {
Function validate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function validate(props, propName, componentName, location, propFullName, ...rest) {
Function validate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function validate(props, propName, componentName, location, propFullName, ...rest) {
Function validate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function validate(props, propName, componentName, location, propFullName, ...rest) {
Function createChainableTypeChecker
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function createChainableTypeChecker(validate) {
function checkType(isRequired, props, propName, componentName, location, propFullName, ...rest) {
propFullName = propFullName || propName;
componentName = componentName || ANONYMOUS;
if (props[propName] == 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 validate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function validate(props, propName, componentName, location, propFullName, ...rest) {
Function validate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function validate(props, propName, componentName, location, propFullName) {
Function createKeysTypeChecker
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function createKeysTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName, ...rest) {
var propValue = props[propName];
if (typeof typeChecker !== 'function') {
- 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"