Showing 79 of 79 total issues
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"
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 = ({ currentValue, previousValue }: 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"
Further reading
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 getPrevNextRow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getPrevNextRow(rowElement: any, keyCode: number): any {
const parentElement = rowElement.parentElement;
if (parentElement) {
let focusElement: HTMLElement;
- 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 too many return
statements within this function. Open
if (parseFloat(a) < parseFloat(b)) return -1;
Avoid too many return
statements within this function. Open
return current;
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return this.count;
Avoid too many return
statements within this function. Open
if (parseFloat(a) > parseFloat(b)) return 1;
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return undefined;
Function elementText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function elementText(n: any): string {
if (n instanceof Array) {
return n.map(elementText).join('');
}
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
onHeaderSelect(event: any): 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 getterForProp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getterForProp(prop: TableColumnProp): ValueGetter {
if (prop == null) {
return emptyStringGetter;
}
- 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 isTarget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
isTarget(model: any, event: any): any {
let i = 0;
const x = event.x || event.clientX;
const y = event.y || event.clientY;
const targets = this.document.elementsFromPoint(x, y);
- 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 translateXY
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function translateXY(styles: any, x: number, y: number) {
if (typeof transform !== 'undefined' && hasCSSTransforms) {
if (!isSafari && hasCSS3DTransforms) {
styles[transform] = `translate3d(${x}px, ${y}px, 0)`;
styles[backfaceVisibility] = 'hidden';
- 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 flatten
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
flatten(f: any, recursive: boolean) {
if (this.row['treeStatus'] === 'expanded') {
for (let i = 0, l = this.children.length; i < l; i++) {
const child = this.children[i];
f.apply(child, Array.prototype.slice.call(arguments, 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
Function calcPages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
calcPages(page?: number): any[] {
const pages = [];
let startPage = 1;
let endPage = this.totalPages;
const maxSize = 5;
- 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"