Showing 112 of 206 total issues
Avoid too many return
statements within this function. Open
return find(item, path.slice(1), current.value)
Avoid too many return
statements within this function. Open
return current.start_mark.line
Avoid too many return
statements within this function. Open
return keywordMap.map(constructAceCompletion.bind(null, "value"))
Avoid too many return
statements within this function. Open
return formItem.set("hasErrors", validationResult)
Avoid too many return
statements within this function. Open
return null
Avoid too many return
statements within this function. Open
return suggestionFromSchema(keywordMap)
Avoid too many return
statements within this function. Open
return formItem
Avoid too many return
statements within this function. Open
return []
Function validateSchemaPatternHasNoZAnchors
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateSchemaPatternHasNoZAnchors = () => (system) => {
return system.validateSelectors
.allSchemas()
.then(nodes => {
return nodes.reduce((acc, node) => {
- 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 validate2And3TypesInDefaultValuesMatchesWithEnum
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validate2And3TypesInDefaultValuesMatchesWithEnum = () => (system) => {
return system.validateSelectors
.allSchemas()
.then(nodes => {
return nodes.reduce((acc, node) => {
- 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 shouldValidate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const shouldValidate = () => (system) => {
// don't run validation if spec is empty
if(system.specSelectors.specStr().trim().length === 0) {
return
}
- 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 checkForEmptyValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const checkForEmptyValue = (value) => {
return !value || value === null || value === "" || !/\S/.test(value) || value === [] ||
(List.isList(value) && value.count() === 0) ||
(Map.isMap(value) && !value.size) ||
(OrderedMap.isOrderedMap(value) && !value.size )
- 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"