Showing 89 of 89 total issues
File body.component.ts
has 714 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
EventEmitter,
File datatable.component.ts
has 634 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
AfterContentInit,
AfterViewInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
DatatableComponent
has 58 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'ngx-datatable',
templateUrl: './datatable.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
// eslint-disable-next-line @angular-eslint/use-component-view-encapsulation
Function scaleColumns
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
function scaleColumns(colsByGroup: any, maxWidth: any, totalFlexGrow: any) {
// calculate total width and flexgrow points for columns that can be resized
for (const attr in colsByGroup) {
if (colsByGroup.hasOwnProperty(attr)) {
for (const column of colsByGroup[attr]) {
- 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 checkGroup
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
checkGroup(event, row, rowIndex, group) {
let groupStatus = 'Pending';
let expectedPaymentDealtWith = true;
row.exppayyes = 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
DataTableBodyComponent
has 49 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'datatable-body',
template: `
<ng-container *ngIf="loadingIndicator">
<div class="custom-loading-indicator-wrapper">
File body-cell.component.ts
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
DoCheck,
DataTableBodyCellComponent
has 39 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'datatable-body-cell',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<ng-container *ngIf="row else ghostLoaderTemplate;">
Function setColumnDefaults
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export function setColumnDefaults(columns: TableColumn[]) {
if (!columns) {return;}
// Only one column should hold the tree view
// Thus if multiple columns are provided with
- 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 datatable.component.spec.ts
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { ColumnChangesService } from '../services/column-changes.service';
Function columnCssClasses
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
@HostBinding('class')
get columnCssClasses(): any {
let cls = 'datatable-body-cell';
if (this.column.cellClass) {
if (typeof this.column.cellClass === '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
File header.component.ts
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
EventEmitter,
Function checkGroup
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
checkGroup(event, row, rowIndex, group) {
let groupStatus = 'Pending';
let expectedPaymentDealtWith = true;
row.exppayyes = 0;
DataTableHeaderComponent
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'datatable-header',
template: `
<div
role="row"
Function columnCssClasses
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
@HostBinding('class')
get columnCssClasses(): any {
let cls = 'datatable-header-cell';
if (this.column.sortable) {cls += ' sortable';}
- 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 forceFillColumnWidths
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function forceFillColumnWidths(
allColumns: any[],
expectedWidth: number,
startIdx: number,
allowBleed: 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 orderByComparator
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function orderByComparator(a: any, b: any): number {
if (a === null || typeof a === 'undefined') {a = 0;}
if (b === null || typeof b === 'undefined') {b = 0;}
if (a instanceof Date && b instanceof Date) {
if (a < b) {return -1;}
- 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 scaleColumns
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function scaleColumns(colsByGroup: any, maxWidth: any, totalFlexGrow: any) {
// calculate total width and flexgrow points for columns that can be resized
for (const attr in colsByGroup) {
if (colsByGroup.hasOwnProperty(attr)) {
for (const column of colsByGroup[attr]) {
Function cssClass
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
@HostBinding('class')
get cssClass() {
let cls = 'datatable-body-row';
if (this.isSelected) {
cls += ' active';
- 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 updateRows
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
updateRows(): void {
const { first, last } = this.indexes;
let rowIndex = first;
let idx = 0;
const temp: any[] = [];
- 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"