Showing 34 of 79 total issues
Function createStylingDefinition
has 191 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createStylingDefinition(theme, flags, translator) {
const fontResolver = createFontResolver({
theme,
translator,
flags,
Function getSettings
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getSettings = (translator, flags, anything) => {
const theme = anything?.sense?.theme;
const settings = {
uses: "settings",
items: {
Function supernova
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function supernova(env) {
return {
qae: {
properties,
data,
Function component
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
component: () => {
const layout = useStaleLayout();
const model = useModel();
const element = useElement();
const Theme = useTheme();
File nebula.config.js
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
// nebula.config.js
module.exports = {
build: {},
serve: {
open: false,
Function selectionHandler
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function selectionHandler(translator) {
const [singleSelect, setSingleSelect] = useState(false);
const selectionsAPI = useSelections();
const isInSelections = !!useLayout().qSelectionInfo.qInSelections;
const [selectionObj] = useState({
File ext-raw.js
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
import DEFAULTS from "../style-defaults";
import propertyResolver from "../utils/property-resolver";
import migrateStyle from "./migration";
import createStylingDefinition from "./styling-definitions/styling-definition";
Function createNodes
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createNodes(matrix, attributeIndecies, status, navigationMode, translator) {
const nodeMap = {};
const allNodes = [];
for (let i = 0; i < matrix.length; ++i) {
const row = matrix[i];
Function select
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
select: (node, selectionObj) => {
const { api, state, singleSelect, setState } = selectionObj;
if (node && api) {
let newState;
if (node.data.elemNo < 0 && node.data.elemNo !== -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 getPoints
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function getPoints(d, topId, { depthSpacing, isVertical, x, y }, navigationMode) {
// TODO: Generalize to make all directions work, currently on only ttb working
const { cardWidth, cardHeight, buttonHeight, cardPadding, buttonMargin } = constants;
const points = [];
const halfCard = { x: cardWidth / 2, y: cardHeight / 2 };
- 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
File tree-utils.spec.js
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
import defaultValues from "../../__tests__/default-orgchart-props";
import transform, {
anyCycle,
createNodes,
fetchPage,
Function createNodes
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function createNodes(matrix, attributeIndecies, status, navigationMode, translator) {
const nodeMap = {};
const allNodes = [];
for (let i = 0; i < matrix.length; ++i) {
const row = matrix[i];
- 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 select
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
select: (node, selectionObj) => {
const { api, state, singleSelect, setState } = selectionObj;
if (node && api) {
let newState;
if (node.data.elemNo < 0 && node.data.elemNo !== -3) {
Function widthTranslation
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const widthTranslation = (d, widthSpacing, element, axis, initialZoomState, navigationMode) => {
const { buttonMargin } = constants;
const initialX = (initialZoomState && initialZoomState.initialX) || 0;
if (navigationMode === "expandAll") {
d[axis] = d.x + initialX;
- 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 createContainer
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const createContainer = ({
element,
dataTree,
selectionObj,
wrapperState,
- 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 anyCycle
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function anyCycle(nodes) {
const visited = {};
const marked = {};
function isCycleUtil(node) {
visited[node.id] = true;
- 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 getNewState
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const getNewState = (d, { topId, isExpanded, expandedChildren }, ancestorIds) => {
if (d.data.id === topId) {
// top
isExpanded = !isExpanded;
expandedChildren = [];
- 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 validateFiles
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const validateFiles = (pkg) => {
const whitelist = [
"name",
"version",
"description",
Function getDarkColor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
getDarkColor(color) {
const percent = 0.5;
let f;
let R;
let B;
Function openTooltip
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
export function openTooltip(tooltip, d, containerHeight, styling, x, y, transform, delay = 250) {