Function _serialize
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Wontfix
const _serialize = (tree: any, opts: SerializeOpts, path: any[]): string =>
tree == null
? ""
: Array.isArray(tree)
? serializeElement(tree, opts, path)
- Read upRead up
- Create a ticketCreate a ticket
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 serializeElement
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Wontfix
const serializeElement = (tree: any[], opts: SerializeOpts, path: any[]) => {
let tag = tree[0];
return !tree.length
? ""
: isFunction(tag)
- Read upRead up
- Create a ticketCreate a ticket
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 serializeAttrib
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Wontfix
const serializeAttrib = (
attribs: any,
a: string,
v: any,
opts: SerializeOpts
- Read upRead up
- Create a ticketCreate a ticket
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 attribPair
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Wontfix
const attribPair = (a: string, v: any, opts: SerializeOpts) => {
v =
a === "style" && isPlainObject(v)
? css(v)
: a === "prefix" && isPlainObject(v)
- Read upRead up
- Create a ticketCreate a ticket
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 serializeTag
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const serializeTag = (tree: any[], opts: SerializeOpts, path: any[]) => {
tree = normalize(tree);
const attribs = tree[1];
if (attribs.__skip || attribs.__serialize === false) return "";
opts.keys && attribs.key === undefined && (attribs.key = path.join("-"));
- Read upRead up
- Create a ticketCreate a ticket
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"