Showing 7 of 9 total issues
Function ComponentTemplate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const ComponentTemplate = function (props, context) {
const isShadow = get(context.container, [ Constants.BLOCK, 'isShadow' ], false);
if (isShadow) {
if (global.HTMLSlotElement) {
- 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 mergeCustomizer
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function mergeCustomizer(objValue, srcValue, key) {
if (isArray(objValue)) {
return objValue.concat(srcValue);
}
- 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 get
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function get(element, attrs) {
if (element.nodeType !== 1 || !element.hasAttributes()) {
return attrs;
}
- 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 reduceChildListMutation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function reduceChildListMutation(mutationContent, record) {
const isAdded = Boolean(record.addedNodes.length);
const isNext = Boolean(record.nextSibling);
const isPrev = Boolean(record.previousSibling);
const isRemoved = Boolean(record.removedNodes.length);
- 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 setAttribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
proto.setAttribute = function (attrName, newVal) {
let prevVal = this.getAttribute(attrName);
this.__setAttribute(attrName, newVal);
newVal = this.getAttribute(attrName);
if (newVal !== prevVal) {
- 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 null;
Function ComponentContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ComponentContent = function (props, context) {
const isShadow = get(context.container, [ Constants.BLOCK, 'isShadow' ], false);
if (isShadow) {
if (global.HTMLSlotElement) {
- 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"