Showing 14 of 14 total issues
File BodyController.js
has 413 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { isOldAngular } from '../../utils/utils'; const TREE_TYPES = { GROUP: 'refreshGroups', TREE: 'refreshTree',
- Create a ticketCreate a ticket
Function buildRowsByGroup
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
buildRowsByGroup() { this.index = {}; this.rowsByGroup = {}; const parentProp = this.treeColumn ?
- Read upRead up
- Create a ticketCreate a ticket
Function rowsUpdated
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
rowsUpdated(newVal, oldVal) { if (!newVal) { this.getRows(true); } else { if (this.options.paging.mode !== 'external') {
- Read upRead up
- Create a ticketCreate a ticket
BodyController
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
export default class BodyController { /** * A body controller * @param {$scope} * @return {BodyController}
- Create a ticketCreate a ticket
Function getRows
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
getRows(refresh) { // only proceed when we have pre-aggregated the values if ((this.treeColumn || this.groupColumn) && !this.rowsByGroup) { return false; }
- Read upRead up
- Create a ticketCreate a ticket
Function buildRowsByGroup
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildRowsByGroup() { this.index = {}; this.rowsByGroup = {}; const parentProp = this.treeColumn ?
- Create a ticketCreate a ticket
Function getRows
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
getRows(refresh) { // only proceed when we have pre-aggregated the values if ((this.treeColumn || this.groupColumn) && !this.rowsByGroup) { return false; }
- Create a ticketCreate a ticket
Function rowsUpdated
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
rowsUpdated(newVal, oldVal) { if (!newVal) { this.getRows(true); } else { if (this.options.paging.mode !== 'external') {
- Create a ticketCreate a ticket
Function setConditionalWatches
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
setConditionalWatches() { for (let i = this.watchListeners.length - 1; i >= 0; i -= 1) { this.watchListeners[i](); this.watchListeners.splice(i, 1);
- Create a ticketCreate a ticket
Function calculateDepth
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
calculateDepth(row, depth = 0) { const parentProp = this.treeColumn ? this.treeColumn.relationProp : this.groupColumn.prop; const prop = this.treeColumn.prop; if (!row[parentProp]) {
- Read upRead up
- Create a ticketCreate a ticket
Function buildTree
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
buildTree() { const temp = []; const self = this; const addChildren = (fromArray, toArray, level) => {
- Read upRead up
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for (let j = 0; j < len; j += 1) { if (this.rows[j][prop] === relVal) { parent = this.rows[j]; break; }
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return depth;
- Create a ticketCreate a ticket
Similar blocks of code found in 3 locations. Consider refactoring. Open
constructor($scope) { Object.assign(this, { $scope, });
- Read upRead up
- Create a ticketCreate a ticket