Showing 96 of 96 total issues
Avoid deeply nested control flow statements. Open
if (res[k] === true) {
cls += ` ${k}`;
}
Avoid deeply nested control flow statements. Open
if (group[index].source !== row.source) {
if (event.target.value === '0') {
// expected payment yes selected
group[index].exppayyes = 0;
group[index].exppaypending = 0;
Avoid deeply nested control flow statements. Open
if (res[k] === true) {
cls += ` ${k}`;
}
Avoid deeply nested control flow statements. Open
if (
group[index].exppayyes === 0 &&
group[index].exppayno === 0 &&
group[index].exppaypending === 0
) {
Function columnsByPin
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function columnsByPin(cols: TableColumn[]) {
const ret: { left: TableColumn[]; center: TableColumn[]; right: TableColumn[] } = {
left: [],
center: [],
right: []
- 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 refreshRowHeightCache
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
refreshRowHeightCache(): void {
if (!this.scrollbarV || (this.scrollbarV && !this.virtualization)) {
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"
Further reading
Function calcNewSorts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
calcNewSorts(
column: TableColumn,
prevValue: SortDirection,
newValue: SortDirection
): SortPropDir[] {
- 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 deeply nested control flow statements. Open
if (column.canAutoResize && !hasMinWidth[column.prop]) {
const newWidth = column.width + column.flexGrow * widthPerFlexPoint;
if (column.minWidth !== undefined && newWidth < column.minWidth) {
remainingWidth += newWidth - column.minWidth;
column.width = column.minWidth;
Function toHaveText
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function toHaveText(): jasmine.CustomMatcher {
return {
compare(
actual: any,
expectedText: string,
- 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 (
(delta > 0 && (!col.maxWidth || col.width + delta <= col.maxWidth)) ||
(delta < 0 && (!col.minWidth || col.width + delta >= col.minWidth))
) {
col.width += delta;
Function forceFillColumnWidths
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
allColumns: any[],
expectedWidth: number,
startIdx: number,
allowBleed: boolean,
defaultColWidth: number = 300
Function updateIndexes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
updateIndexes(): void {
let first = 0;
let last = 0;
if (this.scrollbarV) {
- 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 checkVisibility
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function checkVisibility(element: any, callback: any, zone: NgZone) {
let timeout: any;
function check() {
// https://davidwalsh.name/offsetheight-visibility
- 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 sortInternalRows
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private sortInternalRows(): void {
// if there are no sort criteria we reset the rows with original rows
if (!this.sorts || !this.sorts?.length) {
this._internalRows = this._rows;
// if there is any tree relation then re-group rows accordingly
- 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 sortRows
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function sortRows(rows: any[], columns: any[], dirs: SortPropDir[]): any[] {
if (!rows) {
return [];
}
if (!dirs || !dirs.length || !columns) {
- 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 calcRowCount
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
calcRowCount(): number {
if (!this.externalPaging) {
if (!this.rows) {
return 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 getPrevNextRow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getPrevNextRow(rowElement: HTMLElement, keyCode: number): any {
const parentElement = rowElement.parentElement;
if (parentElement) {
let focusElement: 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 ngDoCheck
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ngDoCheck(): void {
const rowDiffers = this.rowDiffer.diff(this.rows);
if (rowDiffers || this.disableRowCheck) {
if (!this.externalSorting) {
this.sortInternalRows();
- 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 updateSubscriptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
updateSubscriptions(): void {
const diffs = this.differ.diff(this.createMapDiffs());
if (diffs) {
const subscribe = (record: KeyValueChangeRecord<string, DraggableDirective>) => {
- 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 columnTotalWidth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function columnTotalWidth(columns: any[], prop?: string) {
let totalWidth = 0;
if (columns) {
for (const c of columns) {
- 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"