jonshaffer/angular-data-table

View on GitHub
src/components/DataTableDirective.js

Summary

Maintainability
C
1 day
Test Coverage

Showing 5 of 6 total issues

Function DataTableDirective has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function DataTableDirective($window, $timeout, $parse) {
return {
restrict: 'E',
replace: true,
controller: DataTableController,
Severity: Major
Found in src/components/DataTableDirective.js - About 4 hrs to fix

Function DataTableDirective has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

export default function DataTableDirective($window, $timeout, $parse) {
return {
restrict: 'E',
replace: true,
controller: DataTableController,
Severity: Minor
Found in src/components/DataTableDirective.js - About 3 hrs to fix

Function compile has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

compile() {
return {
pre($scope, $elm, $attrs, ctrl) {
DataTableService.buildColumns($scope, $parse);
 
 
Severity: Minor
Found in src/components/DataTableDirective.js - About 1 hr to fix

Function pre has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

pre($scope, $elm, $attrs, ctrl) {
DataTableService.buildColumns($scope, $parse);
 
// Check and see if we had expressive columns
// and if so, lets use those
Severity: Minor
Found in src/components/DataTableDirective.js - About 1 hr to fix

Function template has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

template(element) {
// Gets the column nodes to transposes to column objects
// http://stackoverflow.com/questions/30845397/angular-expressive-directive-design/30847609#30847609
const columns = element[0].getElementsByTagName('column');
const id = ObjectId();
Severity: Minor
Found in src/components/DataTableDirective.js - About 1 hr to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Invalid

bindToController: {
options: '=',
rows: '=',
selected: '=?',
expanded: '=?',
Severity: Major
Found in src/components/DataTableDirective.js and 1 other location - About 1 hr to fix
src/components/body/BodyDirective.js on lines 8..20

There are no issues that match your filters.

Category
Status