Showing 16 of 28 total issues
File data.js
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Modifiers from "qlik-modifiers";
// eslint-disable-next-line import/no-unresolved, import/extensions
import { ColumnWidthType, ColumnWidthValues } from "@qlik/nebula-table-utils/lib/constants";
const columnCommonHidden = {
File types.ts
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Direction, TableCellProps } from "@mui/material";
import { stardust } from "@nebula.js/stardust";
import type { ExtendedTheme } from "@qlik/nebula-table-utils/lib/hooks/use-extended-theme/types";
import {
Announce,
File sense-horizon.js
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = () => ({
_inherit: true,
_variables: {
"@myColorLight": "#FFFFFF",
"@myColorDark": "#404040",
Function TableWrapper
has 133 lines of code (exceeds 100 allowed). Consider refactoring. Open
const TableWrapper = (props: TableWrapperProps) => {
const { pageInfo, setPageInfo, direction, footerContainer, announce } = props;
const { page, rowsPerPage } = pageInfo;
const { totalColumnCount, totalRowCount, totalPages, paginationNeeded, rows, columns, totalsPosition } =
Function sortingFactory
has a Cognitive Complexity of 16 (exceeds 10 allowed). Consider refactoring. Open
export const sortingFactory = (
dimensionsLength: number,
model: EngineAPI.IGenericObject | undefined,
isNewHeadCellMenuEnabled: boolean,
) => {
- 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 HeadCellMenu
has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring. Open
const HeadCellMenu = ({ column, tabIndex }: HeadCellMenuProps) => {
const { isDim, qLibraryId, fieldId, headTextAlign, pageColIdx } = column;
const { translator, embed, model, interactions, layout } = useContextSelector(
TableContext,
(value) => value.baseProps,
- 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 generateLayout
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
nDims: number,
nMeas: number,
nRows: number,
qColumnOrder: number[] = [],
qGrandTotalRow: Record<string, string>[] = [],
Function Cell
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
const Cell = ({ columnIndex, rowIndex, style, data }: CellProps) => {
const { rowsInPage, columns, bodyStyle, isHoverEnabled, maxLineCount } = data;
const rowIsHovered = useContextSelector(TableContext, (value) => value.hoverIndex === rowIndex);
const setHoverIndex = useContextSelector(TableContext, (value) => value.setHoverIndex);
- 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 getNextCellCoord
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
export const getNextCellCoord = (
evt: React.KeyboardEvent,
rootElement: HTMLElement,
cellCoord: FocusedCellCoord,
allowedRows: {
- 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 manageData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
model: EngineAPI.IGenericObject,
layout: TableLayout,
pageInfo: PageInfo,
setPageInfo: SetPageInfo,
viewService: ViewService,
Function handleHeadKeyDown
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
export const handleHeadKeyDown = ({
evt,
rootElement,
cellCoord,
setFocusedCellCoord,
- 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 handleHeadCellMenuKeyDown
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
export const handleHeadCellMenuKeyDown = (event: React.KeyboardEvent) => {
const { key, currentTarget } = event;
const currentFocusItem = document.activeElement ?? currentTarget; // The rest key are handled by handleKeyDown in MUIMenuList
if (key === KeyCodes.DOWN || key === KeyCodes.UP) {
const getNewFocusItem = (currentItem: Element) =>
- 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 getTotalPosition
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
export function getTotalPosition(layout: TableLayout, viewService: ViewService) {
// For multi-page pdf the totals row may not be needed from the second pdf page
if (viewService.viewState?.skipTotals) return { atTop: false, atBottom: false };
const [hasDimension, hasMeasure, hasGrandTotal, isTotalModeAuto, position] = [
layout.qHyperCube.qDimensionInfo.length > 0,
- 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 getVisibleColumnOrder
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
const getVisibleColumnOrder = (
columnOrder: number[],
qDimensionInfo: ExtendedNxDimensionInfo[],
qMeasureInfo: ExtendedNxMeasureInfo[],
) => {
- 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 resetFocus
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
export const resetFocus = ({
focusedCellCoord,
rootElement,
shouldRefocus,
isSelectionMode,
- 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 findVirtualizedVisibleRows
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
export function findVirtualizedVisibleRows(rootElement: HTMLElement, viewService: ViewService) {
const tableBody = rootElement.querySelector(".sn-table-body");
const bodyRect = tableBody?.getBoundingClientRect();
const cells = tableBody?.querySelectorAll(".sn-table-body .sn-table-cell");
if (!cells || !bodyRect) 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"