Showing 96 of 96 total issues
Function ngDoCheck
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
ngDoCheck(): void {
if (this.disableCheck) {
const isRowDisabled = this.disableCheck(this.row);
if (isRowDisabled !== this.disable$.value) {
this.disable$.next(isRowDisabled);
- 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 focusCell
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
focusCell(
cellElement: HTMLElement,
rowElement: HTMLElement,
keyCode: number,
cellIndex: number
- 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 recalculateColumns
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
recalculateColumns(
columns: TableColumn[] = this._internalColumns,
forceIdx: number = -1,
allowBleed: boolean = this.scrollbarH
): TableColumn[] | undefined {
Function columnCssClasses
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
@HostBinding('class')
get columnCssClasses(): string {
let cls = 'datatable-header-cell';
if (this.column.sortable) {
Function orderByComparator
has 31 lines of code (exceeds 25 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') {
Function throttle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function throttle(func: any, wait: number, options?: any) {
options = options || {};
let context: any;
let args: any;
let result: any;
Function setPage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
setPage(pageInfo: PageInfo) {
// Current page number is determined by last call to setPage
// This is the page the UI is currently displaying
// The current page is based on the UI pagesize and scroll position
// Pagesize can change depending on browser size
Function checkValueUpdates
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
checkValueUpdates(): void {
let value = '';
if (!this.row || !this.column) {
value = '';
- 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 onActivate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
onActivate(model: Model<TRow>, index: number): void {
const { type, event, row } = model;
const chkbox = this.selectionType === SelectionType.checkbox;
const select =
(!chkbox && (type === 'click' || type === 'dblclick')) || (chkbox && type === 'checkbox');
- 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 exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
Function cssClass
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
@HostBinding('class')
get cssClass() {
let cls = 'datatable-body-row';
if (this.isSelected) {
cls += ' active';
Function onMouseDown
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
@HostListener('mousedown', ['$event'])
onMouseDown(event: MouseEvent): void {
// don't do right/middle clicks
if (event.which !== 1 || !this.pressEnabled) {
return;
Function onColumnReorder
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
onColumnReorder({ column, newValue, prevValue }: ReorderEvent): void {
const cols = this._internalColumns.map(c => ({ ...c }));
if (this.swapColumns) {
const prevCol = cols[newValue];
Consider simplifying this complex logical expression. Open
if (
group.filter(rowFilter => rowFilter.exppaypending === 1).length === 0 &&
group.filter(
rowFilter =>
rowFilter.exppaypending === 0 && rowFilter.exppayyes === 0 && rowFilter.exppayno === 0
Function deepValueGetter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function deepValueGetter(obj: any, path: string): any {
if (obj == null) {
return '';
}
if (!obj || !path) {
- 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 onKeyboardFocus
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
onKeyboardFocus(model: Model<TRow>): void {
const { keyCode } = model.event as KeyboardEvent;
const shouldFocus =
keyCode === Keys.up ||
keyCode === Keys.down ||
- 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 offset
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@Input() set offset(val: number) {
if (val !== this._offset) {
this._offset = val;
if (!this.scrollbarV || (this.scrollbarV && !this.virtualization)) {
if (!isNaN(this._offset) && this.ghostLoadingIndicator) {
- 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 onHeaderSelect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
onHeaderSelect(): void {
if (this.bodyComponent && this.selectAllRowsOnPage) {
// before we splice, chk if we currently have all selected
const first = this.bodyComponent.indexes.first;
const last = this.bodyComponent.indexes.last;
- 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 nextSortDir
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function nextSortDir(
sortType: SortType,
current: SortDirection | 'desc' | 'asc'
): SortDirection | undefined {
if (sortType === SortType.single) {
- 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 onTargetChanged
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
onTargetChanged({ prevIndex, newIndex, initialIndex }: TargetChangedEvent): void {
if (prevIndex || prevIndex === 0) {
const oldColumn = this.getColumn(prevIndex);
oldColumn.isTarget = false;
oldColumn.targetMarkerContext = undefined;
- 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"