jonshaffer/angular-data-table

View on GitHub
src/components/header/HeaderController.js

Summary

Maintainability
A
1 hr
Test Coverage

Showing 2 of 2 total issues

Consider simplifying this complex logical expression.
Open

if ((this.options.sortType === 'single' && !(this.options.modifierActive && modifierPressed)) ||
(this.options.sortType === 'multiple' && this.options.modifierActive && modifierPressed)) {
this.columns.left.forEach(unsortColumn);
this.columns.center.forEach(unsortColumn);
this.columns.right.forEach(unsortColumn);
Severity: Major
Found in src/components/header/HeaderController.js - About 40 mins to fix

Function onSorted has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

onSorted(sortedColumn, modifierPressed) {
// if sort type is single, then only one column can be sorted at once,
// so we set the sort to undefined for the other columns
function unsortColumn(column) {
if (column !== sortedColumn) {
Severity: Minor
Found in src/components/header/HeaderController.js - About 25 mins to fix

There are no issues that match your filters.

Category
Status