afermon/angular-4-data-table-bootstrap-4

View on GitHub

Showing 23 of 106 total issues

Function View_DataTablePagination_0 has 263 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function View_DataTablePagination_0(_l:any):i0.ɵViewDefinition {
  return i0.ɵvid(0,[i0.ɵpid(0,i1.MinPipe,([] as any[])),(_l()(),i0.ɵted((null as any),
      ['\n'])),(_l()(),i0.ɵeld(0,(null as any),(null as any),69,'div',[['class','pagination-box']],
      (null as any),(null as any),(null as any),(null as any),(null as any))),(_l()(),
      i0.ɵted((null as any),['\n    '])),(_l()(),i0.ɵeld(0,(null as any),(null as any),
Severity: Major
Found in src/components/pagination.component.ngfactory.ts - About 1 day to fix

    DataTable has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Component({
      selector: 'data-table',
      template: TABLE_TEMPLATE,
      styles: [TABLE_STYLE]
    })
    Severity: Minor
    Found in src/components/table.component.ts - About 5 hrs to fix

      File table.component.ngfactory.ts has 369 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * @fileoverview This file is generated by the Angular template compiler.
       * Do not edit.
       * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride}
       */
      Severity: Minor
      Found in src/components/table.component.ngfactory.ts - About 4 hrs to fix

        Function View_DataTable_0 has 120 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function View_DataTable_0(_l:any):i0.ɵViewDefinition {
          return i0.ɵvid(0,[i0.ɵpid(0,i10.PixelConverter,([] as any[])),i0.ɵqud(671088640,
              1,{rows:1}),(_l()(),i0.ɵted((null as any),['\n'])),(_l()(),i0.ɵeld(0,(null as any),
              (null as any),52,'div',[['class','data-table-wrapper']],(null as any),(null as any),
              (null as any),(null as any),(null as any))),(_l()(),i0.ɵted((null as any),['\n    '])),
        Severity: Major
        Found in src/components/table.component.ngfactory.ts - About 4 hrs to fix

          Function View_DataTableRow_0 has 120 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function View_DataTableRow_0(_l:any):i0.ɵViewDefinition {
            return i0.ɵvid(0,[(_l()(),i0.ɵted((null as any),['\n'])),(_l()(),i0.ɵeld(0,(null as any),
                (null as any),28,'tr',[['class','data-table-row']],[[8,'title',0],[4,'background-color',
                    (null as any)],[2,'row-odd',(null as any)],[2,'row-even',(null as any)],
                    [2,'selected',(null as any)],[2,'clickable',(null as any)]],[[(null as any),
          Severity: Major
          Found in src/components/row.component.ngfactory.ts - About 4 hrs to fix

            File header.component.ngfactory.ts has 342 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * @fileoverview This file is generated by the Angular template compiler.
             * Do not edit.
             * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride}
             */
            Severity: Minor
            Found in src/components/header.component.ngfactory.ts - About 4 hrs to fix

              File pagination.component.ngfactory.ts has 281 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * @fileoverview This file is generated by the Angular template compiler.
               * Do not edit.
               * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride}
               */
              Severity: Minor
              Found in src/components/pagination.component.ngfactory.ts - About 2 hrs to fix

                Function View_DataTableHeader_0 has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function View_DataTableHeader_0(_l:any):i0.ɵViewDefinition {
                  return i0.ɵvid(0,[(_l()(),i0.ɵted((null as any),['\n'])),(_l()(),i0.ɵeld(0,(null as any),
                      (null as any),22,'div',[['class','data-table-header']],(null as any),(null as any),
                      (null as any),(null as any),(null as any))),(_l()(),i0.ɵted((null as any),['\n    '])),
                      (_l()(),i0.ɵeld(0,(null as any),(null as any),0,'h4',[['class','title']],[[8,
                Severity: Major
                Found in src/components/header.component.ngfactory.ts - About 2 hrs to fix

                  File table.component.ts has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {
                      Component, Input, Output, EventEmitter, ContentChildren, QueryList,
                      TemplateRef, ContentChild, ViewChildren, OnInit
                  } from '@angular/core';
                  import { DataTableColumn } from './column.component';
                  Severity: Minor
                  Found in src/components/table.component.ts - About 2 hrs to fix

                    Function View_DataTableHeader_3 has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function View_DataTableHeader_3(_l:any):i0.ɵViewDefinition {
                      return i0.ɵvid(0,[(_l()(),i0.ɵeld(0,(null as any),(null as any),14,'div',[['class',
                          'column-selector-fixed-column checkbox']],(null as any),(null as any),(null as any),
                          (null as any),(null as any))),(_l()(),i0.ɵted((null as any),['\n                    '])),
                          (_l()(),i0.ɵeld(0,(null as any),(null as any),11,'label',([] as any[]),(null as any),
                    Severity: Major
                    Found in src/components/header.component.ngfactory.ts - About 2 hrs to fix

                      Function View_DataTableHeader_2 has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function View_DataTableHeader_2(_l:any):i0.ɵViewDefinition {
                        return i0.ɵvid(0,[(_l()(),i0.ɵeld(0,(null as any),(null as any),14,'div',[['class',
                            'column-selector-fixed-column checkbox']],(null as any),(null as any),(null as any),
                            (null as any),(null as any))),(_l()(),i0.ɵted((null as any),['\n                    '])),
                            (_l()(),i0.ɵeld(0,(null as any),(null as any),11,'label',([] as any[]),(null as any),
                      Severity: Major
                      Found in src/components/header.component.ngfactory.ts - About 2 hrs to fix

                        Function View_DataTableHeader_4 has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function View_DataTableHeader_4(_l:any):i0.ɵViewDefinition {
                          return i0.ɵvid(0,[(_l()(),i0.ɵeld(0,(null as any),(null as any),14,'div',[['class',
                              'column-selector-fixed-column checkbox']],(null as any),(null as any),(null as any),
                              (null as any),(null as any))),(_l()(),i0.ɵted((null as any),['\n                    '])),
                              (_l()(),i0.ɵeld(0,(null as any),(null as any),11,'label',([] as any[]),(null as any),
                        Severity: Major
                        Found in src/components/header.component.ngfactory.ts - About 2 hrs to fix

                          Function View_DataTableHeader_5 has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function View_DataTableHeader_5(_l:any):i0.ɵViewDefinition {
                            return i0.ɵvid(0,[(_l()(),i0.ɵeld(0,(null as any),(null as any),13,'div',[['class',
                                'column-selector-column checkbox']],(null as any),(null as any),(null as any),
                                (null as any),(null as any))),(_l()(),i0.ɵted((null as any),['\n                    '])),
                                (_l()(),i0.ɵeld(0,(null as any),(null as any),10,'label',([] as any[]),(null as any),
                          Severity: Major
                          Found in src/components/header.component.ngfactory.ts - About 2 hrs to fix

                            Function View_DataTable_2 has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function View_DataTable_2(_l:any):i0.ɵViewDefinition {
                              return i0.ɵvid(0,[(_l()(),i0.ɵeld(0,[['th',1]],(null as any),16,'th',[['class','column-header']],
                                  [[2,'sortable',(null as any)],[2,'resizable',(null as any)],[4,'width',(null as any)]],
                                  [[(null as any),'click']],(_v,en,$event) => {
                                    var ad:boolean = true;
                            Severity: Minor
                            Found in src/components/table.component.ngfactory.ts - About 1 hr to fix

                              Function View_DataTable_9 has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function View_DataTable_9(_l:any):i0.ɵViewDefinition {
                                return i0.ɵvid(0,[(_l()(),i0.ɵeld(0,(null as any),(null as any),13,'tr',([] as any[]),
                                    [[2,'row-odd',(null as any)],[2,'row-even',(null as any)]],(null as any),(null as any),
                                    (null as any),(null as any))),(_l()(),i0.ɵted((null as any),['\n                    '])),
                                    (_l()(),i0.ɵeld(0,(null as any),(null as any),1,'td',([] as any[]),(null as any),
                              Severity: Minor
                              Found in src/components/table.component.ngfactory.ts - About 1 hr to fix

                                Function View_DataTable_5 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function View_DataTable_5(_l:any):i0.ɵViewDefinition {
                                  return i0.ɵvid(0,[(_l()(),i0.ɵeld(0,(null as any),(null as any),14,'span',[['class',
                                      'column-sort-icon']],(null as any),(null as any),(null as any),(null as any),
                                      (null as any))),(_l()(),i0.ɵted((null as any),['\n                           '])),
                                      (_l()(),i0.ɵeld(0,(null as any),(null as any),1,'i',[['class','fa fa-sort column-sortable-icon']],
                                Severity: Minor
                                Found in src/components/table.component.ngfactory.ts - About 1 hr to fix

                                  Function query has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      query(params: DataTableParams, filter?: (item: T, index: number, items: T[]) => boolean): Promise<T[]> {
                                  
                                          let result: T[] = [];
                                          if (filter) {
                                              result = this.items.filter(filter);
                                  Severity: Minor
                                  Found in src/tools/data-table-resource.ts - About 1 hr to fix

                                    Function onRowSelectChanged has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        onRowSelectChanged(row: DataTableRow) {
                                    
                                            // maintain the selectedRow(s) view
                                            if (this.multiSelect) {
                                                let index = this.selectedRows.indexOf(row);
                                    Severity: Minor
                                    Found in src/components/table.component.ts - About 1 hr to fix

                                    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 View_DataTableRow_1 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function View_DataTableRow_1(_l:any):i0.ɵViewDefinition {
                                      return i0.ɵvid(0,[(_l()(),i0.ɵeld(0,(null as any),(null as any),9,'td',[['class',
                                          'data-column']],[[4,'background-color',(null as any)]],(null as any),(null as any),
                                          (null as any),(null as any))),i0.ɵdid(278528,(null as any),0,i1.NgClass,[i0.IterableDiffers,
                                          i0.KeyValueDiffers,i0.ElementRef,i0.Renderer],{klass:[0,'klass'],ngClass:[1,
                                    Severity: Minor
                                    Found in src/components/row.component.ngfactory.ts - About 1 hr to fix

                                      Function View_DataTableHeader_1 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function View_DataTableHeader_1(_l:any):i0.ɵViewDefinition {
                                        return i0.ɵvid(0,[(_l()(),i0.ɵeld(0,(null as any),(null as any),13,'div',[['class',
                                            'column-selector-box card']],(null as any),(null as any),(null as any),(null as any),
                                            (null as any))),(_l()(),i0.ɵted((null as any),['\n                '])),(_l()(),
                                            i0.ɵand(16777216,(null as any),(null as any),1,(null as any),View_DataTableHeader_2)),
                                      Severity: Minor
                                      Found in src/components/header.component.ngfactory.ts - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language