IntegerMan/angularIF

View on GitHub
src/assets/primeng/components/datatable/datatable.js

Summary

Maintainability
F
1 mo
Test Coverage

Function DataTable has a Cognitive Complexity of 897 (exceeds 5 allowed). Consider refactoring.
Open

var DataTable = (function () {
    function DataTable(el, domHandler, differs, renderer, changeDetector, objectUtils, zone) {
        this.el = el;
        this.domHandler = domHandler;
        this.differs = differs;
Severity: Minor
Found in src/assets/primeng/components/datatable/datatable.js - About 2 wks 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 DataTable has 1599 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var DataTable = (function () {
    function DataTable(el, domHandler, differs, renderer, changeDetector, objectUtils, zone) {
        this.el = el;
        this.domHandler = domHandler;
        this.differs = differs;
Severity: Major
Found in src/assets/primeng/components/datatable/datatable.js - About 1 wk to fix

    File datatable.js has 2364 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    Severity: Major
    Found in src/assets/primeng/components/datatable/datatable.js - About 6 days to fix

      Function ScrollableView has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

      var ScrollableView = (function () {
          function ScrollableView(dt, domHandler, el, renderer, zone) {
              this.dt = dt;
              this.domHandler = domHandler;
              this.el = el;
      Severity: Minor
      Found in src/assets/primeng/components/datatable/datatable.js - About 5 hrs 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 DataTable has 120 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function DataTable(el, domHandler, differs, renderer, changeDetector, objectUtils, zone) {
              this.el = el;
              this.domHandler = domHandler;
              this.differs = differs;
              this.renderer = renderer;
      Severity: Major
      Found in src/assets/primeng/components/datatable/datatable.js - About 4 hrs to fix

        Function ScrollableView has 113 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var ScrollableView = (function () {
            function ScrollableView(dt, domHandler, el, renderer, zone) {
                this.dt = dt;
                this.domHandler = domHandler;
                this.el = el;
        Severity: Major
        Found in src/assets/primeng/components/datatable/datatable.js - About 4 hrs to fix

          Function handleRowClick has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              DataTable.prototype.handleRowClick = function (event, rowData, index) {
                  if (this.preventRowClickPropagation) {
                      this.preventRowClickPropagation = false;
                      return;
                  }
          Severity: Major
          Found in src/assets/primeng/components/datatable/datatable.js - About 4 hrs to fix

            Function __decorate has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

            var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
                var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
                if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
                else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
                return c > 3 && r && Object.defineProperty(target, key, r), r;
            Severity: Minor
            Found in src/assets/primeng/components/datatable/datatable.js - About 2 hrs 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 _filter has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                DataTable.prototype._filter = function () {
                    this._first = 0;
                    if (this.lazy) {
                        this.onLazyLoad.emit(this.createLazyLoadMetadata());
                    }
            Severity: Minor
            Found in src/assets/primeng/components/datatable/datatable.js - About 1 hr to fix

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

                  DataTable.prototype.onColumnResizeEnd = function (event) {
                      var delta = this.resizerHelper.offsetLeft - this.lastResizerHelperX;
                      var columnWidth = this.resizeColumn.offsetWidth;
                      var newColumnWidth = columnWidth + delta;
                      var minWidth = this.resizeColumn.style.minWidth || 15;
              Severity: Minor
              Found in src/assets/primeng/components/datatable/datatable.js - About 1 hr to fix

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

                    DataTable.prototype.exportCSV = function (options) {
                        var _this = this;
                        var data = this.filteredValue || this.value;
                        var csv = '\ufeff';
                        if (options && options.selectionOnly) {
                Severity: Minor
                Found in src/assets/primeng/components/datatable/datatable.js - About 1 hr to fix

                  Function sort has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      DataTable.prototype.sort = function (event, column) {
                          if (!column.sortable) {
                              return;
                          }
                          var targetNode = event.target.nodeName;
                  Severity: Minor
                  Found in src/assets/primeng/components/datatable/datatable.js - About 1 hr to fix

                    Function sortSingle has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        DataTable.prototype.sortSingle = function () {
                            var _this = this;
                            if (this.value) {
                                if (this.sortColumn && this.sortColumn.sortable === 'custom') {
                                    this.preventSortPropagation = true;
                    Severity: Minor
                    Found in src/assets/primeng/components/datatable/datatable.js - About 1 hr to fix

                      Function onColumnDragover has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          DataTable.prototype.onColumnDragover = function (event) {
                              var dropHeader = this.findParentHeader(event.target);
                              if (this.reorderableColumns && this.draggedColumn && dropHeader) {
                                  event.preventDefault();
                                  var container = this.el.nativeElement.children[0];
                      Severity: Minor
                      Found in src/assets/primeng/components/datatable/datatable.js - About 1 hr to fix

                        Function clearSelectionRange has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            DataTable.prototype.clearSelectionRange = function () {
                                var rangeStart, rangeEnd;
                                if (this.rangeRowIndex > this.anchorRowIndex) {
                                    rangeStart = this.anchorRowIndex;
                                    rangeEnd = this.rangeRowIndex;
                        Severity: Minor
                        Found in src/assets/primeng/components/datatable/datatable.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if ((targetNode == 'TH' && this.domHandler.hasClass(event.target, 'ui-sortable-column')) || ((targetNode == 'SPAN' || targetNode == 'DIV') && !this.domHandler.hasClass(event.target, 'ui-clickable'))) {
                                      if (!this.immutable) {
                                          this.preventSortPropagation = true;
                                      }
                                      var columnSortField = column.sortField || column.field;
                          Severity: Major
                          Found in src/assets/primeng/components/datatable/datatable.js - About 1 hr to fix

                            Function DataTable has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                function DataTable(el, domHandler, differs, renderer, changeDetector, objectUtils, zone) {
                            Severity: Major
                            Found in src/assets/primeng/components/datatable/datatable.js - About 50 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if (this.isSingleSelectionMode()) {
                                                          this._selection = rowData;
                                                          this.selectionChange.emit(rowData);
                                                          if (dataKeyValue) {
                                                              this.selectionKeys = {};
                              Severity: Major
                              Found in src/assets/primeng/components/datatable/datatable.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if (!localMatch) {
                                                            break;
                                                        }
                                Severity: Major
                                Found in src/assets/primeng/components/datatable/datatable.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (selected) {
                                                              this._selection = null;
                                                              this.selectionKeys = {};
                                                              this.onRowUnselect.emit({ originalEvent: event, data: rowData, type: 'row' });
                                                          }
                                  Severity: Major
                                  Found in src/assets/primeng/components/datatable/datatable.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if (nextColumn) {
                                                                colGroup.children[resizeColumnIndex + 1].style.width = nextColumnWidth + 'px';
                                                            }
                                    Severity: Major
                                    Found in src/assets/primeng/components/datatable/datatable.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if (this.isSingleSelectionMode()) {
                                                                  this._selection = null;
                                                                  this.selectionKeys = {};
                                                                  this.selectionChange.emit(null);
                                                              }
                                      Severity: Major
                                      Found in src/assets/primeng/components/datatable/datatable.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if (!filterConstraint(dataFieldValue, filterValue)) {
                                                                    localMatch = false;
                                                                }
                                        Severity: Major
                                        Found in src/assets/primeng/components/datatable/datatable.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if (selected) {
                                                                      var selectionIndex_2 = this.findIndexInSelection(rowData);
                                                                      this._selection = this.selection.filter(function (val, i) { return i != selectionIndex_2; });
                                                                      this.onRowUnselect.emit({ originalEvent: event, data: rowData, type: 'row' });
                                                                      if (dataKeyValue) {
                                          Severity: Major
                                          Found in src/assets/primeng/components/datatable/datatable.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                if (this.multiSortMeta[i].field == columnSortField) {
                                                                    order = this.multiSortMeta[i].order;
                                                                    break;
                                                                }
                                            Severity: Major
                                            Found in src/assets/primeng/components/datatable/datatable.js - About 45 mins to fix

                                              Function ScrollableView has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                  function ScrollableView(dt, domHandler, el, renderer, zone) {
                                              Severity: Minor
                                              Found in src/assets/primeng/components/datatable/datatable.js - About 35 mins to fix

                                                Similar blocks of code found in 77 locations. Consider refactoring.
                                                Open

                                                var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
                                                    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
                                                    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
                                                    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
                                                    return c > 3 && r && Object.defineProperty(target, key, r), r;
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 76 other locations - About 1 day to fix
                                                src/assets/primeng/components/accordion/accordion.js on lines 2..7
                                                src/assets/primeng/components/autocomplete/autocomplete.js on lines 2..7
                                                src/assets/primeng/components/blockui/blockui.js on lines 2..7
                                                src/assets/primeng/components/breadcrumb/breadcrumb.js on lines 2..7
                                                src/assets/primeng/components/button/button.js on lines 2..7
                                                src/assets/primeng/components/calendar/calendar.js on lines 2..7
                                                src/assets/primeng/components/captcha/captcha.js on lines 2..7
                                                src/assets/primeng/components/carousel/carousel.js on lines 2..7
                                                src/assets/primeng/components/chart/chart.js on lines 2..7
                                                src/assets/primeng/components/checkbox/checkbox.js on lines 2..7
                                                src/assets/primeng/components/chips/chips.js on lines 2..7
                                                src/assets/primeng/components/codehighlighter/codehighlighter.js on lines 2..7
                                                src/assets/primeng/components/colorpicker/colorpicker.js on lines 2..7
                                                src/assets/primeng/components/common/confirmationservice.js on lines 2..7
                                                src/assets/primeng/components/common/messageservice.js on lines 2..7
                                                src/assets/primeng/components/common/shared.js on lines 2..7
                                                src/assets/primeng/components/common/treedragdropservice.js on lines 2..7
                                                src/assets/primeng/components/confirmdialog/confirmdialog.js on lines 2..7
                                                src/assets/primeng/components/contextmenu/contextmenu.js on lines 2..7
                                                src/assets/primeng/components/datagrid/datagrid.js on lines 2..7
                                                src/assets/primeng/components/datalist/datalist.js on lines 2..7
                                                src/assets/primeng/components/datascroller/datascroller.js on lines 2..7
                                                src/assets/primeng/components/defer/defer.js on lines 2..7
                                                src/assets/primeng/components/dialog/dialog.js on lines 2..7
                                                src/assets/primeng/components/dom/domhandler.js on lines 2..7
                                                src/assets/primeng/components/dragdrop/dragdrop.js on lines 2..7
                                                src/assets/primeng/components/dropdown/dropdown.js on lines 2..7
                                                src/assets/primeng/components/editor/editor.js on lines 2..7
                                                src/assets/primeng/components/fieldset/fieldset.js on lines 2..7
                                                src/assets/primeng/components/fileupload/fileupload.js on lines 2..7
                                                src/assets/primeng/components/galleria/galleria.js on lines 2..7
                                                src/assets/primeng/components/gmap/gmap.js on lines 2..7
                                                src/assets/primeng/components/growl/growl.js on lines 2..7
                                                src/assets/primeng/components/inplace/inplace.js on lines 2..7
                                                src/assets/primeng/components/inputmask/inputmask.js on lines 2..7
                                                src/assets/primeng/components/inputswitch/inputswitch.js on lines 2..7
                                                src/assets/primeng/components/inputtext/inputtext.js on lines 2..7
                                                src/assets/primeng/components/inputtextarea/inputtextarea.js on lines 2..7
                                                src/assets/primeng/components/lightbox/lightbox.js on lines 2..7
                                                src/assets/primeng/components/listbox/listbox.js on lines 2..7
                                                src/assets/primeng/components/megamenu/megamenu.js on lines 2..7
                                                src/assets/primeng/components/menu/menu.js on lines 2..7
                                                src/assets/primeng/components/menubar/menubar.js on lines 2..7
                                                src/assets/primeng/components/messages/messages.js on lines 2..7
                                                src/assets/primeng/components/multiselect/multiselect.js on lines 2..7
                                                src/assets/primeng/components/orderlist/orderlist.js on lines 2..7
                                                src/assets/primeng/components/organizationchart/organizationchart.js on lines 2..7
                                                src/assets/primeng/components/overlaypanel/overlaypanel.js on lines 2..7
                                                src/assets/primeng/components/paginator/paginator.js on lines 2..7
                                                src/assets/primeng/components/panel/panel.js on lines 2..7
                                                src/assets/primeng/components/panelmenu/panelmenu.js on lines 12..17
                                                src/assets/primeng/components/password/password.js on lines 2..7
                                                src/assets/primeng/components/picklist/picklist.js on lines 2..7
                                                src/assets/primeng/components/progressbar/progressbar.js on lines 2..7
                                                src/assets/primeng/components/radiobutton/radiobutton.js on lines 2..7
                                                src/assets/primeng/components/rating/rating.js on lines 2..7
                                                src/assets/primeng/components/schedule/schedule.js on lines 2..7
                                                src/assets/primeng/components/selectbutton/selectbutton.js on lines 2..7
                                                src/assets/primeng/components/sidebar/sidebar.js on lines 2..7
                                                src/assets/primeng/components/slidemenu/slidemenu.js on lines 2..7
                                                src/assets/primeng/components/slider/slider.js on lines 2..7
                                                src/assets/primeng/components/spinner/spinner.js on lines 2..7
                                                src/assets/primeng/components/splitbutton/splitbutton.js on lines 2..7
                                                src/assets/primeng/components/steps/steps.js on lines 2..7
                                                src/assets/primeng/components/tabmenu/tabmenu.js on lines 2..7
                                                src/assets/primeng/components/tabview/tabview.js on lines 2..7
                                                src/assets/primeng/components/terminal/terminal.js on lines 2..7
                                                src/assets/primeng/components/terminal/terminalservice.js on lines 2..7
                                                src/assets/primeng/components/tieredmenu/tieredmenu.js on lines 2..7
                                                src/assets/primeng/components/togglebutton/togglebutton.js on lines 2..7
                                                src/assets/primeng/components/toolbar/toolbar.js on lines 2..7
                                                src/assets/primeng/components/tooltip/tooltip.js on lines 2..7
                                                src/assets/primeng/components/tree/tree.js on lines 2..7
                                                src/assets/primeng/components/treetable/treetable.js on lines 2..7
                                                src/assets/primeng/components/tristatecheckbox/tristatecheckbox.js on lines 2..7
                                                src/assets/primeng/components/utils/objectutils.js on lines 2..7

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 237.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    DataTable.prototype.resolveFieldData = function (data, field) {
                                                        if (data && field) {
                                                            if (field.indexOf('.') == -1) {
                                                                return data[field];
                                                            }
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 6 hrs to fix
                                                src/assets/primeng/components/utils/objectutils.js on lines 62..82

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 158.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                var RowExpansionLoader = (function () {
                                                    function RowExpansionLoader(viewContainer) {
                                                        this.viewContainer = viewContainer;
                                                    }
                                                    RowExpansionLoader.prototype.ngOnInit = function () {
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 5 hrs to fix
                                                src/assets/primeng/components/common/shared.js on lines 64..78

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 139.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    DataTable.prototype.findNextEditableColumn = function (cell) {
                                                        var nextCell = cell.nextElementSibling;
                                                        if (!nextCell) {
                                                            var nextRow = cell.parentElement.nextElementSibling;
                                                            if (nextRow) {
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 4 hrs to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1466..1483

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 120.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    DataTable.prototype.findPreviousEditableColumn = function (cell) {
                                                        var prevCell = cell.previousElementSibling;
                                                        if (!prevCell) {
                                                            var previousRow = cell.parentElement.previousElementSibling;
                                                            if (previousRow) {
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 4 hrs to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1484..1501

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 120.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                            notEquals: function (value, filter) {
                                                                if (filter === undefined || filter === null || (typeof filter === 'string' && filter.trim() === '')) {
                                                                    return false;
                                                                }
                                                                if (value === undefined || value === null) {
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 4 hrs to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 445..453

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 116.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                            equals: function (value, filter) {
                                                                if (filter === undefined || filter === null || (typeof filter === 'string' && filter.trim() === '')) {
                                                                    return true;
                                                                }
                                                                if (value === undefined || value === null) {
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 4 hrs to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 454..462

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 116.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    DataTable.prototype.moveToNextCell = function (event) {
                                                        var currentCell = this.findCell(event.target);
                                                        var row = currentCell.parentElement;
                                                        var targetCell = this.findNextEditableColumn(currentCell);
                                                        if (targetCell) {
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 3 hrs to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1448..1456

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 99.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    DataTable.prototype.moveToPreviousCell = function (event) {
                                                        var currentCell = this.findCell(event.target);
                                                        var row = currentCell.parentElement;
                                                        var targetCell = this.findPreviousEditableColumn(currentCell);
                                                        if (targetCell) {
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 3 hrs to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1457..1465

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 99.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    Object.defineProperty(DataTable.prototype, "totalRecords", {
                                                        get: function () {
                                                            return this._totalRecords;
                                                        },
                                                        set: function (val) {
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 2 hrs to fix
                                                src/assets/primeng/components/tabview/tabview.js on lines 90..100

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 78.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                        for (var _i = 0, headerColumnsGroups_1 = headerColumnsGroups; _i < headerColumnsGroups_1.length; _i++) {
                                                            var columnGroup = headerColumnsGroups_1[_i];
                                                            if (columnGroup.frozen)
                                                                this.frozenHeaderColumnGroup = columnGroup;
                                                            else
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 1 hr to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 666..672

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 74.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                        for (var _a = 0, footerColumnsGroups_1 = footerColumnsGroups; _a < footerColumnsGroups_1.length; _a++) {
                                                            var columnGroup = footerColumnsGroups_1[_a];
                                                            if (columnGroup.frozen)
                                                                this.frozenFooterColumnGroup = columnGroup;
                                                            else
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 1 hr to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 659..665

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 74.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                Open

                                                    DataTable.prototype.ngDoCheck = function () {
                                                        if (!this.immutable) {
                                                            var changes = this.differ.diff(this.value);
                                                            if (changes) {
                                                                this.handleDataChange();
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 3 other locations - About 1 hr to fix
                                                src/assets/primeng/components/autocomplete/autocomplete.js on lines 67..74
                                                src/assets/primeng/components/datagrid/datagrid.js on lines 72..79
                                                src/assets/primeng/components/datalist/datalist.js on lines 72..79

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 73.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                Open

                                                ColumnHeaders = __decorate([
                                                    core_1.Component({
                                                        selector: '[pColumnHeaders]',
                                                        template: "\n        <ng-template ngFor let-col [ngForOf]=\"columns\" let-lastCol=\"last\">\n            <th #headerCell [attr.id]=\"col.colId\" [ngStyle]=\"col.style\" [class]=\"col.styleClass\" (click)=\"dt.sort($event,col)\" [attr.colspan]=\"col.colspan\" [attr.rowspan]=\"col.rowspan\"\n                [ngClass]=\"{'ui-state-default ui-unselectable-text':true, 'ui-sortable-column': col.sortable, 'ui-state-active': dt.isSorted(col), 'ui-resizable-column': dt.resizableColumns, 'ui-selection-column':col.selectionMode,\n                            'ui-helper-hidden': col.hidden}\"\n                (dragstart)=\"dt.onColumnDragStart($event)\" (dragleave)=\"dt.onColumnDragleave($event)\" (drop)=\"dt.onColumnDrop($event)\" (mousedown)=\"dt.onHeaderMousedown($event,headerCell)\"\n                [attr.tabindex]=\"col.sortable ? tabindex : null\" (keydown)=\"dt.onHeaderKeydown($event,col)\">\n                <span class=\"ui-column-resizer ui-clickable\" *ngIf=\"dt.resizableColumns && ((dt.columnResizeMode == 'fit' && !lastCol) || dt.columnResizeMode == 'expand')\" (mousedown)=\"dt.initColumnResize($event)\"></span>\n                <span class=\"ui-column-title\" *ngIf=\"!col.selectionMode&&!col.headerTemplate\">{{col.header}}</span>\n                <span class=\"ui-column-title\" *ngIf=\"col.headerTemplate\">\n                    <p-columnHeaderTemplateLoader [column]=\"col\"></p-columnHeaderTemplateLoader>\n                </span>\n                <span class=\"ui-sortable-column-icon fa fa-fw fa-sort\" *ngIf=\"col.sortable\"\n                     [ngClass]=\"{'fa-sort-desc': (dt.getSortOrder(col) == -1),'fa-sort-asc': (dt.getSortOrder(col) == 1)}\"></span>\n                <input [attr.type]=\"col.filterType\" class=\"ui-column-filter ui-inputtext ui-widget ui-state-default ui-corner-all\" [attr.maxlength]=\"col.filterMaxlength\" [attr.placeholder]=\"col.filterPlaceholder\" *ngIf=\"col.filter&&!col.filterTemplate\" [value]=\"dt.filters[col.filterField||col.field] ? dt.filters[col.filterField||col.field].value : ''\"\n                    (click)=\"dt.onFilterInputClick($event)\" (input)=\"dt.onFilterKeyup($event.target.value, col.filterField||col.field, col.filterMatchMode)\"/>\n                <p-columnFilterTemplateLoader [column]=\"col\" *ngIf=\"col.filterTemplate\"></p-columnFilterTemplateLoader>\n                <p-dtCheckbox *ngIf=\"col.selectionMode=='multiple'\" (onChange)=\"dt.toggleRowsWithCheckbox($event)\" [checked]=\"dt.allSelected\" [disabled]=\"dt.isEmpty()\"></p-dtCheckbox>\n            </th>\n        </ng-template>\n    "
                                                    }),
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 5 other locations - About 1 hr to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 141..148
                                                src/assets/primeng/components/datatable/datatable.js on lines 167..174
                                                src/assets/primeng/components/menu/menu.js on lines 29..36
                                                src/assets/primeng/components/slidemenu/slidemenu.js on lines 76..83
                                                src/assets/primeng/components/treetable/treetable.js on lines 96..103

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 71.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                Open

                                                ColumnFooters = __decorate([
                                                    core_1.Component({
                                                        selector: '[pColumnFooters]',
                                                        template: "\n        <td *ngFor=\"let col of columns\" [ngStyle]=\"col.style\" [class]=\"col.styleClass\"\n            [attr.colspan]=\"col.colspan\" [attr.rowspan]=\"col.rowspan\"\n            [ngClass]=\"{'ui-state-default':true, 'ui-helper-hidden': col.hidden}\">\n            <span class=\"ui-column-footer\" *ngIf=\"!col.footerTemplate\">{{col.footer}}</span>\n            <span class=\"ui-column-footer\" *ngIf=\"col.footerTemplate\">\n                <p-columnFooterTemplateLoader [column]=\"col\"></p-columnFooterTemplateLoader>\n            </span>\n        </td>\n    "
                                                    }),
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 5 other locations - About 1 hr to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 122..129
                                                src/assets/primeng/components/datatable/datatable.js on lines 167..174
                                                src/assets/primeng/components/menu/menu.js on lines 29..36
                                                src/assets/primeng/components/slidemenu/slidemenu.js on lines 76..83
                                                src/assets/primeng/components/treetable/treetable.js on lines 96..103

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 71.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                Open

                                                TableBody = __decorate([
                                                    core_1.Component({
                                                        selector: '[pTableBody]',
                                                        template: "\n        <ng-template ngFor let-rowData [ngForOf]=\"data\" let-even=\"even\" let-odd=\"odd\" let-rowIndex=\"index\" [ngForTrackBy]=\"dt.rowTrackBy\">\n            <tr #rowGroupElement class=\"ui-widget-header ui-rowgroup-header\"\n                *ngIf=\"dt.rowGroupMode=='subheader' && (rowIndex === 0||(dt.resolveFieldData(rowData,dt.groupField) !== dt.resolveFieldData(dt.dataToRender[rowIndex - 1], dt.groupField)))\"\n                (click)=\"dt.onRowGroupClick($event)\" [ngStyle]=\"{'cursor': dt.sortableRowGroup ? 'pointer' : 'auto'}\">\n                <td [attr.colspan]=\"dt.visibleColumns().length\">\n                    <a href=\"#\" *ngIf=\"dt.expandableRowGroups\" (click)=\"dt.toggleRowGroup($event,rowData)\">\n                        <span class=\"fa fa-fw\" [ngClass]=\"dt.isRowGroupExpanded(rowData) ? dt.expandedIcon : dt.collapsedIcon\"></span>\n                    </a>\n                    <span class=\"ui-rowgroup-header-name\">\n                        <p-templateLoader [template]=\"dt.rowGroupHeaderTemplate\" [data]=\"rowData\"></p-templateLoader>\n                    </span>\n                </td>\n            </tr>\n            <tr #rowElement *ngIf=\"!dt.expandableRowGroups||dt.isRowGroupExpanded(rowData)\"\n                    (click)=\"dt.handleRowClick($event, rowData, rowIndex)\" (dblclick)=\"dt.rowDblclick($event,rowData)\" (contextmenu)=\"dt.onRowRightClick($event,rowData)\" (touchend)=\"dt.handleRowTouchEnd($event)\"\n                    [ngClass]=\"[even&&dt.rowGroupMode!='rowspan'? 'ui-datatable-even':'',\n                                odd&&dt.rowGroupMode!='rowspan'?'ui-datatable-odd':'',\n                                dt.isSelected(rowData)? 'ui-state-highlight': '',\n                                dt.isRowExpanded(rowData) ? 'ui-expanded-row': '',\n                                dt.getRowStyleClass(rowData,rowIndex)]\">\n                <ng-template ngFor let-col [ngForOf]=\"columns\" let-colIndex=\"index\">\n                    <td #cell *ngIf=\"!dt.rowGroupMode || (dt.rowGroupMode == 'subheader') ||\n                        (dt.rowGroupMode=='rowspan' && ((dt.sortField==col.field && dt.rowGroupMetadata[dt.resolveFieldData(rowData,dt.sortField)].index == rowIndex) || (dt.sortField!=col.field)))\"\n                        [ngStyle]=\"col.style\" [class]=\"col.styleClass\" (click)=\"dt.switchCellToEditMode(cell,col,rowData)\"\n                        [ngClass]=\"{'ui-editable-column':col.editable,'ui-selection-column':col.selectionMode, 'ui-helper-hidden': col.hidden}\"\n                        [attr.rowspan]=\"(dt.rowGroupMode=='rowspan' && dt.sortField == col.field && dt.rowGroupMetadata[dt.resolveFieldData(rowData,dt.sortField)].index == rowIndex) ? dt.rowGroupMetadata[dt.resolveFieldData(rowData,dt.sortField)].size : null\">\n                        <span class=\"ui-column-title\" *ngIf=\"dt.responsive\">{{col.header}}</span>\n                        <span class=\"ui-cell-data\" *ngIf=\"!col.bodyTemplate && !col.expander && !col.selectionMode\">{{dt.resolveFieldData(rowData,col.field)}}</span>\n                        <span class=\"ui-cell-data\" *ngIf=\"col.bodyTemplate\">\n                            <p-columnBodyTemplateLoader [column]=\"col\" [rowData]=\"rowData\" [rowIndex]=\"rowIndex + dt.first\"></p-columnBodyTemplateLoader>\n                        </span>\n                        <div class=\"ui-cell-editor\" *ngIf=\"col.editable\">\n                            <input *ngIf=\"!col.editorTemplate\" type=\"text\" [(ngModel)]=\"rowData[col.field]\" required=\"true\"\n                                (keydown)=\"dt.onCellEditorKeydown($event, col, rowData, rowIndex)\" (blur)=\"dt.onCellEditorBlur($event, col, rowData, rowIndex)\"\n                                (input)=\"dt.onCellEditorInput($event, col, rowData, rowIndex)\" (change)=\"dt.onCellEditorChange($event, col, rowData, rowIndex)\"\n                                class=\"ui-inputtext ui-widget ui-state-default ui-corner-all\"/>\n                            <a *ngIf=\"col.editorTemplate\" class=\"ui-cell-editor-proxy-focus\" href=\"#\" (focus)=\"dt.onCustomEditorFocusPrev($event, colIndex)\"></a>\n                            <p-columnEditorTemplateLoader *ngIf=\"col.editorTemplate\" [column]=\"col\" [rowData]=\"rowData\" [rowIndex]=\"rowIndex\"></p-columnEditorTemplateLoader>\n                            <a *ngIf=\"col.editorTemplate\" class=\"ui-cell-editor-proxy-focus\" href=\"#\" (focus)=\"dt.onCustomEditorFocusNext($event, colIndex)\"></a>\n                        </div>\n                        <a href=\"#\" *ngIf=\"col.expander\" (click)=\"dt.toggleRow(rowData,$event)\">\n                            <span class=\"ui-row-toggler fa fa-fw ui-clickable\" [ngClass]=\"dt.isRowExpanded(rowData) ? dt.expandedIcon : dt.collapsedIcon\"></span>\n                        </a>\n                        <p-dtRadioButton *ngIf=\"col.selectionMode=='single'\" (onClick)=\"dt.selectRowWithRadio($event, rowData)\" [checked]=\"dt.isSelected(rowData)\"></p-dtRadioButton>\n                        <p-dtCheckbox *ngIf=\"col.selectionMode=='multiple'\" (onChange)=\"dt.toggleRowWithCheckbox($event,rowData)\" [checked]=\"dt.isSelected(rowData)\"></p-dtCheckbox>\n                    </td>\n                </ng-template>\n            </tr>\n            <tr *ngIf=\"dt.expandableRows && dt.isRowExpanded(rowData)\" class=\"ui-expanded-row-content\">\n                <td [attr.colspan]=\"dt.visibleColumns().length\">\n                    <p-rowExpansionLoader [rowData]=\"rowData\" [rowIndex]=\"rowIndex\" [template]=\"dt.rowExpansionTemplate\"></p-rowExpansionLoader>\n                </td>\n            </tr>\n            <tr class=\"ui-widget-header\" *ngIf=\"dt.rowGroupFooterTemplate && dt.rowGroupMode=='subheader' && ((rowIndex === dt.dataToRender.length - 1)||(dt.resolveFieldData(rowData,dt.groupField) !== dt.resolveFieldData(dt.dataToRender[rowIndex + 1],dt.groupField))) && (!dt.expandableRowGroups || dt.isRowGroupExpanded(rowData))\">\n                <p-templateLoader class=\"ui-helper-hidden\" [data]=\"rowData\" [template]=\"dt.rowGroupFooterTemplate\"></p-templateLoader>\n            </tr>\n        </ng-template>\n\n        <tr *ngIf=\"dt.isEmpty()\" class=\"ui-widget-content ui-datatable-emptymessage-row\">\n            <td [attr.colspan]=\"dt.visibleColumns().length\" class=\"ui-datatable-emptymessage\">\n                <span *ngIf=\"!dt.emptyMessageTemplate\">{{dt.emptyMessage}}</span>\n                <p-templateLoader [template]=\"dt.emptyMessageTemplate\"></p-templateLoader>\n            </td>\n        </tr>\n    "
                                                    }),
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 5 other locations - About 1 hr to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 122..129
                                                src/assets/primeng/components/datatable/datatable.js on lines 141..148
                                                src/assets/primeng/components/menu/menu.js on lines 29..36
                                                src/assets/primeng/components/slidemenu/slidemenu.js on lines 76..83
                                                src/assets/primeng/components/treetable/treetable.js on lines 96..103

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 71.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 71 locations. Consider refactoring.
                                                Open

                                                var __metadata = (this && this.__metadata) || function (k, v) {
                                                    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
                                                };
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 70 other locations - About 1 hr to fix
                                                src/assets/primeng/components/accordion/accordion.js on lines 8..10
                                                src/assets/primeng/components/autocomplete/autocomplete.js on lines 8..10
                                                src/assets/primeng/components/blockui/blockui.js on lines 8..10
                                                src/assets/primeng/components/breadcrumb/breadcrumb.js on lines 8..10
                                                src/assets/primeng/components/button/button.js on lines 8..10
                                                src/assets/primeng/components/calendar/calendar.js on lines 8..10
                                                src/assets/primeng/components/captcha/captcha.js on lines 8..10
                                                src/assets/primeng/components/carousel/carousel.js on lines 8..10
                                                src/assets/primeng/components/chart/chart.js on lines 8..10
                                                src/assets/primeng/components/checkbox/checkbox.js on lines 8..10
                                                src/assets/primeng/components/chips/chips.js on lines 8..10
                                                src/assets/primeng/components/codehighlighter/codehighlighter.js on lines 8..10
                                                src/assets/primeng/components/colorpicker/colorpicker.js on lines 8..10
                                                src/assets/primeng/components/common/shared.js on lines 8..10
                                                src/assets/primeng/components/confirmdialog/confirmdialog.js on lines 8..10
                                                src/assets/primeng/components/contextmenu/contextmenu.js on lines 8..10
                                                src/assets/primeng/components/datagrid/datagrid.js on lines 8..10
                                                src/assets/primeng/components/datalist/datalist.js on lines 8..10
                                                src/assets/primeng/components/datascroller/datascroller.js on lines 8..10
                                                src/assets/primeng/components/defer/defer.js on lines 8..10
                                                src/assets/primeng/components/dialog/dialog.js on lines 8..10
                                                src/assets/primeng/components/dragdrop/dragdrop.js on lines 8..10
                                                src/assets/primeng/components/dropdown/dropdown.js on lines 8..10
                                                src/assets/primeng/components/editor/editor.js on lines 8..10
                                                src/assets/primeng/components/fieldset/fieldset.js on lines 8..10
                                                src/assets/primeng/components/fileupload/fileupload.js on lines 8..10
                                                src/assets/primeng/components/galleria/galleria.js on lines 8..10
                                                src/assets/primeng/components/gmap/gmap.js on lines 8..10
                                                src/assets/primeng/components/growl/growl.js on lines 8..10
                                                src/assets/primeng/components/inplace/inplace.js on lines 8..10
                                                src/assets/primeng/components/inputmask/inputmask.js on lines 8..10
                                                src/assets/primeng/components/inputswitch/inputswitch.js on lines 8..10
                                                src/assets/primeng/components/inputtext/inputtext.js on lines 8..10
                                                src/assets/primeng/components/inputtextarea/inputtextarea.js on lines 8..10
                                                src/assets/primeng/components/lightbox/lightbox.js on lines 8..10
                                                src/assets/primeng/components/listbox/listbox.js on lines 8..10
                                                src/assets/primeng/components/megamenu/megamenu.js on lines 8..10
                                                src/assets/primeng/components/menu/menu.js on lines 8..10
                                                src/assets/primeng/components/menubar/menubar.js on lines 8..10
                                                src/assets/primeng/components/messages/messages.js on lines 8..10
                                                src/assets/primeng/components/multiselect/multiselect.js on lines 8..10
                                                src/assets/primeng/components/orderlist/orderlist.js on lines 8..10
                                                src/assets/primeng/components/organizationchart/organizationchart.js on lines 8..10
                                                src/assets/primeng/components/overlaypanel/overlaypanel.js on lines 8..10
                                                src/assets/primeng/components/paginator/paginator.js on lines 8..10
                                                src/assets/primeng/components/panel/panel.js on lines 8..10
                                                src/assets/primeng/components/panelmenu/panelmenu.js on lines 18..20
                                                src/assets/primeng/components/password/password.js on lines 8..10
                                                src/assets/primeng/components/picklist/picklist.js on lines 8..10
                                                src/assets/primeng/components/progressbar/progressbar.js on lines 8..10
                                                src/assets/primeng/components/radiobutton/radiobutton.js on lines 8..10
                                                src/assets/primeng/components/rating/rating.js on lines 8..10
                                                src/assets/primeng/components/schedule/schedule.js on lines 8..10
                                                src/assets/primeng/components/selectbutton/selectbutton.js on lines 8..10
                                                src/assets/primeng/components/sidebar/sidebar.js on lines 8..10
                                                src/assets/primeng/components/slidemenu/slidemenu.js on lines 8..10
                                                src/assets/primeng/components/slider/slider.js on lines 8..10
                                                src/assets/primeng/components/spinner/spinner.js on lines 8..10
                                                src/assets/primeng/components/splitbutton/splitbutton.js on lines 8..10
                                                src/assets/primeng/components/steps/steps.js on lines 8..10
                                                src/assets/primeng/components/tabmenu/tabmenu.js on lines 8..10
                                                src/assets/primeng/components/tabview/tabview.js on lines 8..10
                                                src/assets/primeng/components/terminal/terminal.js on lines 8..10
                                                src/assets/primeng/components/tieredmenu/tieredmenu.js on lines 8..10
                                                src/assets/primeng/components/togglebutton/togglebutton.js on lines 8..10
                                                src/assets/primeng/components/toolbar/toolbar.js on lines 8..10
                                                src/assets/primeng/components/tooltip/tooltip.js on lines 8..10
                                                src/assets/primeng/components/tree/tree.js on lines 8..10
                                                src/assets/primeng/components/treetable/treetable.js on lines 8..10
                                                src/assets/primeng/components/tristatecheckbox/tristatecheckbox.js on lines 8..10

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 62.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                        if (this.expandedRows) {
                                                            for (var i = 0; i < this.expandedRows.length; i++) {
                                                                if (this.expandedRows[i] == row) {
                                                                    index = i;
                                                                    break;
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 1 hr to fix
                                                src/assets/primeng/components/organizationchart/organizationchart.js on lines 188..195

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 62.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    DataTable.prototype.visibleColumns = function () {
                                                        return this.columns ? this.columns.filter(function (c) { return !c.hidden; }) : [];
                                                    };
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 1 hr to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 154..156

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 61.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                    TableBody.prototype.visibleColumns = function () {
                                                        return this.columns ? this.columns.filter(function (c) { return !c.hidden; }) : [];
                                                    };
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 1 hr to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1927..1929

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 61.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                                for (var i = 0; i < columns.length; i++) {
                                                                    bodyCols[i].style.width = columns[i].offsetWidth + 'px';
                                                                }
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 1 hr to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1623..1625

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 58.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                        for (var i = 0; i < columns.length; i++) {
                                                            columns[i].style.width = columns[i].offsetWidth + 'px';
                                                        }
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 1 hr to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1630..1632

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 58.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        this.columnsSubscription = this.cols.changes.subscribe(function (_) {
                                                            _this.initColumns();
                                                            _this.changeDetector.markForCheck();
                                                        });
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 1 hr to fix
                                                src/assets/primeng/components/treetable/treetable.js on lines 128..131

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 57.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 15 locations. Consider refactoring.
                                                Open

                                                    DataTable.prototype.unbindDocumentEditListener = function () {
                                                        if (this.documentEditListener) {
                                                            this.documentEditListener();
                                                            this.documentEditListener = null;
                                                        }
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 14 other locations - About 50 mins to fix
                                                src/assets/primeng/components/autocomplete/autocomplete.js on lines 421..426
                                                src/assets/primeng/components/calendar/calendar.js on lines 1093..1098
                                                src/assets/primeng/components/colorpicker/colorpicker.js on lines 203..208
                                                src/assets/primeng/components/colorpicker/colorpicker.js on lines 222..227
                                                src/assets/primeng/components/colorpicker/colorpicker.js on lines 239..244
                                                src/assets/primeng/components/contextmenu/contextmenu.js on lines 183..188
                                                src/assets/primeng/components/dialog/dialog.js on lines 158..163
                                                src/assets/primeng/components/dialog/dialog.js on lines 323..328
                                                src/assets/primeng/components/dropdown/dropdown.js on lines 370..375
                                                src/assets/primeng/components/multiselect/multiselect.js on lines 288..293
                                                src/assets/primeng/components/sidebar/sidebar.js on lines 106..111
                                                src/assets/primeng/components/splitbutton/splitbutton.js on lines 100..105
                                                src/assets/primeng/components/tieredmenu/tieredmenu.js on lines 107..112
                                                src/assets/primeng/components/tooltip/tooltip.js on lines 254..259

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 52.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                                    this.reorderIndicatorUp.style.left = (targetLeft + dropHeader.offsetWidth - Math.ceil(this.iconWidth / 2)) + 'px';
                                                Severity: Minor
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 50 mins to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1663..1663

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 51.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                                    this.reorderIndicatorDown.style.left = (targetLeft + dropHeader.offsetWidth - Math.ceil(this.iconWidth / 2)) + 'px';
                                                Severity: Minor
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 50 mins to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1662..1662

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 51.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                Open

                                                    DataTable.prototype.rowDblclick = function (event, rowData) {
                                                        this.onRowDblclick.emit({ originalEvent: event, data: rowData });
                                                    };
                                                Severity: Minor
                                                Found in src/assets/primeng/components/datatable/datatable.js and 2 other locations - About 40 mins to fix
                                                src/assets/primeng/components/tabview/tabview.js on lines 28..33
                                                src/assets/primeng/components/tabview/tabview.js on lines 34..39

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 48.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                        this.zone.runOutsideAngular(function () {
                                                            window.document.addEventListener('dragover', _this.onColumnDragover.bind(_this));
                                                        });
                                                Severity: Minor
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 35 mins to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1538..1540

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 47.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                                if (this.isSingleSelectionMode()) {
                                                                    this.selection = rowData;
                                                                    this.selectionChange.emit(rowData);
                                                                }
                                                                else if (this.isMultipleSelectionMode()) {
                                                Severity: Minor
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 35 mins to fix
                                                src/assets/primeng/components/treetable/treetable.js on lines 226..232

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 47.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                        this.zone.runOutsideAngular(function () {
                                                            window.document.addEventListener('mousemove', _this.onDocumentMouseMove.bind(_this));
                                                        });
                                                Severity: Minor
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 35 mins to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1644..1646

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 47.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                        if (expandedRowIndex != -1) {
                                                            this.expandedRows.splice(expandedRowIndex, 1);
                                                            this.onRowCollapse.emit({
                                                                originalEvent: event,
                                                                data: row
                                                Severity: Minor
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 35 mins to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1828..1842

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 46.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

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

                                                        if (index >= 0) {
                                                            this.expandedRowsGroups.splice(index, 1);
                                                            this.onRowGroupCollapse.emit({
                                                                originalEvent: event,
                                                                group: rowGroupField
                                                Severity: Minor
                                                Found in src/assets/primeng/components/datatable/datatable.js and 1 other location - About 35 mins to fix
                                                src/assets/primeng/components/datatable/datatable.js on lines 1771..1787

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 46.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Identical blocks of code found in 9 locations. Consider refactoring.
                                                Open

                                                var __param = (this && this.__param) || function (paramIndex, decorator) {
                                                    return function (target, key) { decorator(target, key, paramIndex); }
                                                };
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 8 other locations - About 30 mins to fix
                                                src/assets/primeng/components/contextmenu/contextmenu.js on lines 11..13
                                                src/assets/primeng/components/growl/growl.js on lines 11..13
                                                src/assets/primeng/components/menu/menu.js on lines 11..13
                                                src/assets/primeng/components/messages/messages.js on lines 11..13
                                                src/assets/primeng/components/organizationchart/organizationchart.js on lines 11..13
                                                src/assets/primeng/components/slidemenu/slidemenu.js on lines 11..13
                                                src/assets/primeng/components/tree/tree.js on lines 11..13
                                                src/assets/primeng/components/treetable/treetable.js on lines 11..13

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 45.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 13 locations. Consider refactoring.
                                                Open

                                                RowExpansionLoader = __decorate([
                                                    core_1.Component({
                                                        selector: 'p-rowExpansionLoader',
                                                        template: ""
                                                    }),
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 12 other locations - About 30 mins to fix
                                                src/assets/primeng/components/accordion/accordion.js on lines 81..87
                                                src/assets/primeng/components/chart/chart.js on lines 106..112
                                                src/assets/primeng/components/common/shared.js on lines 325..331
                                                src/assets/primeng/components/common/shared.js on lines 351..357
                                                src/assets/primeng/components/common/shared.js on lines 377..383
                                                src/assets/primeng/components/common/shared.js on lines 403..409
                                                src/assets/primeng/components/common/shared.js on lines 439..445
                                                src/assets/primeng/components/common/shared.js on lines 472..478
                                                src/assets/primeng/components/organizationchart/organizationchart.js on lines 43..49
                                                src/assets/primeng/components/tabview/tabview.js on lines 147..153
                                                src/assets/primeng/components/tabview/tabview.js on lines 317..323
                                                src/assets/primeng/components/tree/tree.js on lines 43..49

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 45.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                Open

                                                    DataTable.prototype.isEmpty = function () {
                                                        return !this.dataToRender || (this.dataToRender.length == 0);
                                                    };
                                                Severity: Major
                                                Found in src/assets/primeng/components/datatable/datatable.js and 3 other locations - About 30 mins to fix
                                                src/assets/primeng/components/datagrid/datagrid.js on lines 118..120
                                                src/assets/primeng/components/datalist/datalist.js on lines 118..120
                                                src/assets/primeng/components/datascroller/datascroller.js on lines 95..97

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 45.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                There are no issues that match your filters.

                                                Category
                                                Status