Showing 34 of 79 total issues
Function fetchPage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
export async function fetchPage(dataPages, dataMatrix, model, fullHeight, currentRow, callNum, maxCalls) {
Function resolveExpression
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
resolveExpression: (input) => {
// rgb
let matches = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(input);
if (matches) {
return `rgb(${matches[1]},${matches[2]},${matches[3]})`;
- 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 transform
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function transform(nodes, width, height, svg, divBox, useTransitions) {
Function createStylingDefinition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function createStylingDefinition(theme, flags, translator) {
const fontResolver = createFontResolver({
theme,
translator,
flags,
- 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 supernova
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function supernova(env) {
return {
qae: {
properties,
data,
- 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
Consider simplifying this complex logical expression. Open
if (
(d.data.id === topId && isExpanded) ||
(d.parent && d.parent.data.id === topId && expandedChildren.includes(d.data.id)) ||
ancestorIds.includes(d.data.id)
) {
Function getTooltipStyle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function getTooltipStyle(d, containerHeight, x, y, transform) {
Function createNodes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function createNodes(matrix, attributeIndecies, status, navigationMode, translator) {
Function snapshot
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function snapshot(expandedState, containerData, layout, transform, initialZoom) {
Function getDarkColor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getDarkColor(color) {
const percent = 0.5;
let f;
let R;
let B;
- 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 "none";
Avoid too many return
statements within this function. Open
return `rgba(${color.r},${color.g},${color.b},${a})`;
Function filterTree
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const filterTree = ({ topId, isExpanded, expandedChildren }, nodeTree, extended, navigationMode) => {
if (navigationMode === "expandAll") {
return nodeTree.descendants();
}
const topNode = nodeTree.descendants().find((node) => node.data.id === topId) || nodeTree;
- 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 getTooltipContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getTooltipContent(d, styling) {
const label = encodeUtils.encodeTitle(d.data.attributes.label || d.data.id);
const subLabel = d.data.attributes.subLabel ? `${encodeUtils.encodeTitle(d.data.attributes.subLabel)}<br />` : "";
const extraLabel = d.data.attributes.extraLabel
? `${encodeUtils.encodeTitle(d.data.attributes.extraLabel)}<br />`
- 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"