IntegerMan/angularIF

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

Summary

Maintainability
F
3 days
Test Coverage

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/panelmenu/panelmenu.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 PanelMenu has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

var PanelMenu = (function (_super) {
    __extends(PanelMenu, _super);
    function PanelMenu() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.multiple = true;
Severity: Minor
Found in src/assets/primeng/components/panelmenu/panelmenu.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 PanelMenu has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var PanelMenu = (function (_super) {
    __extends(PanelMenu, _super);
    function PanelMenu() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.multiple = true;
Severity: Minor
Found in src/assets/primeng/components/panelmenu/panelmenu.js - About 1 hr to fix

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

    var BasePanelMenuItem = (function () {
        function BasePanelMenuItem() {
        }
        BasePanelMenuItem.prototype.handleClick = function (event, item) {
            if (item.disabled) {
    Severity: Minor
    Found in src/assets/primeng/components/panelmenu/panelmenu.js - About 25 mins 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

    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/panelmenu/panelmenu.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/datatable/datatable.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/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

    PanelMenuSub = __decorate([
        core_1.Component({
            selector: 'p-panelMenuSub',
            template: "\n        <ul class=\"ui-menu-list ui-helper-reset\" [@submenu]=\"expanded ? 'visible' : 'hidden'\">\n            <ng-template ngFor let-child [ngForOf]=\"item.items\">\n                <li *ngIf=\"child.separator\" class=\"ui-menu-separator ui-widget-content\">\n                <li *ngIf=\"!child.separator\" class=\"ui-menuitem ui-corner-all\" [ngClass]=\"{'ui-menu-parent':child.items}\" [class]=\"child.styleClass\" [ngStyle]=\"child.style\">\n                    <a *ngIf=\"!child.routerLink\" [href]=\"child.url||'#'\" class=\"ui-menuitem-link ui-corner-all\" [attr.tabindex]=\"item.expanded ? null : '-1'\"\n                        [ngClass]=\"{'ui-menuitem-link-hasicon':child.icon&&child.items,'ui-state-disabled':child.disabled}\" \n                        (click)=\"handleClick($event,child)\" [attr.target]=\"child.target\" [attr.title]=\"child.title\">\n                        <span class=\"ui-panelmenu-icon fa fa-fw\" [ngClass]=\"{'fa-caret-right':!child.expanded,'fa-caret-down':child.expanded}\" *ngIf=\"child.items\"></span\n                        ><span class=\"ui-menuitem-icon fa fa-fw\" [ngClass]=\"child.icon\" *ngIf=\"child.icon\"></span\n                        ><span class=\"ui-menuitem-text\">{{child.label}}</span>\n                    </a>\n                    <a *ngIf=\"child.routerLink\" [routerLink]=\"child.routerLink\" [routerLinkActive]=\"'ui-state-active'\" [routerLinkActiveOptions]=\"child.routerLinkActiveOptions||{exact:false}\" class=\"ui-menuitem-link ui-corner-all\" \n                        [ngClass]=\"{'ui-menuitem-link-hasicon':child.icon&&child.items,'ui-state-disabled':child.disabled}\" [attr.tabindex]=\"item.expanded ? null : '-1'\" \n                        (click)=\"handleClick($event,child)\" [attr.target]=\"child.target\" [attr.title]=\"child.title\">\n                        <span class=\"ui-panelmenu-icon fa fa-fw\" [ngClass]=\"{'fa-caret-right':!child.expanded,'fa-caret-down':child.expanded}\" *ngIf=\"child.items\"></span\n                        ><span class=\"ui-menuitem-icon fa fa-fw\" [ngClass]=\"child.icon\" *ngIf=\"child.icon\"></span\n                        ><span class=\"ui-menuitem-text\">{{child.label}}</span>\n                    </a>\n                    <p-panelMenuSub [item]=\"child\" [expanded]=\"child.expanded\" *ngIf=\"child.items\"></p-panelMenuSub>\n                </li>\n            </ng-template>\n        </ul>\n    ",
            animations: [
    Severity: Major
    Found in src/assets/primeng/components/panelmenu/panelmenu.js and 1 other location - About 4 hrs to fix
    src/assets/primeng/components/panelmenu/panelmenu.js on lines 130..147

    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 134.

    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

    PanelMenu = __decorate([
        core_1.Component({
            selector: 'p-panelMenu',
            template: "\n        <div [class]=\"styleClass\" [ngStyle]=\"style\" [ngClass]=\"'ui-panelmenu ui-widget'\">\n            <div *ngFor=\"let item of model;let f=first;let l=last;\" class=\"ui-panelmenu-panel\">\n                <div [ngClass]=\"{'ui-widget ui-panelmenu-header ui-state-default':true,'ui-corner-top':f,'ui-corner-bottom':l&&!item.expanded,\n                    'ui-state-active':item.expanded,'ui-state-disabled':item.disabled}\" [class]=\"item.styleClass\" [ngStyle]=\"item.style\">\n                    <a *ngIf=\"!item.routerLink\" [href]=\"item.url||'#'\" [ngClass]=\"{'ui-panelmenu-headerlink-hasicon':item.icon}\" (click)=\"handleClick($event,item)\"\n                        [attr.target]=\"item.target\" [attr.title]=\"item.title\">\n                        <span *ngIf=\"item.items\" class=\"ui-panelmenu-icon fa\" [ngClass]=\"{'fa-caret-right':!item.expanded,'fa-caret-down':item.expanded}\"></span\n                        ><span class=\"ui-menuitem-icon fa\" [ngClass]=\"item.icon\" *ngIf=\"item.icon\"></span\n                        ><span class=\"ui-menuitem-text\">{{item.label}}</span>\n                    </a>\n                    <a *ngIf=\"item.routerLink\" [routerLink]=\"item.routerLink\" [routerLinkActive]=\"'ui-state-active'\" [routerLinkActiveOptions]=\"item.routerLinkActiveOptions||{exact:false}\" [ngClass]=\"{'ui-panelmenu-headerlink-hasicon':item.icon}\" (click)=\"handleClick($event,item)\"\n                        [attr.target]=\"item.target\" [attr.title]=\"item.title\">\n                        <span *ngIf=\"item.items\" class=\"ui-panelmenu-icon fa\" [ngClass]=\"{'fa-caret-right':!item.expanded,'fa-caret-down':item.expanded}\"></span\n                        ><span class=\"ui-menuitem-icon fa\" [ngClass]=\"item.icon\" *ngIf=\"item.icon\"></span\n                        ><span class=\"ui-menuitem-text\">{{item.label}}</span>\n                    </a>\n                </div>\n                <div *ngIf=\"item.items\" class=\"ui-panelmenu-content-wrapper\" [@rootItem]=\"item.expanded ? 'visible' : 'hidden'\"  (@rootItem.done)=\"onToggleDone($event)\"\n                    [ngClass]=\"{'ui-panelmenu-content-wrapper-overflown': !item.expanded||animating}\">\n                    <div class=\"ui-panelmenu-content ui-widget-content\">\n                        <p-panelMenuSub [item]=\"item\" [expanded]=\"true\"></p-panelMenuSub>\n                    </div>\n                </div>\n            </div>\n        </div>\n    ",
            animations: [
    Severity: Major
    Found in src/assets/primeng/components/panelmenu/panelmenu.js and 1 other location - About 4 hrs to fix
    src/assets/primeng/components/panelmenu/panelmenu.js on lines 63..80

    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 134.

    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/panelmenu/panelmenu.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/datatable/datatable.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/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 7 locations. Consider refactoring.
    Open

    PanelMenuModule = __decorate([
        core_1.NgModule({
            imports: [common_1.CommonModule, router_1.RouterModule],
            exports: [PanelMenu, router_1.RouterModule],
            declarations: [PanelMenu, PanelMenuSub]
    Severity: Major
    Found in src/assets/primeng/components/panelmenu/panelmenu.js and 6 other locations - About 1 hr to fix
    src/assets/primeng/components/contextmenu/contextmenu.js on lines 242..248
    src/assets/primeng/components/menu/menu.js on lines 165..171
    src/assets/primeng/components/menubar/menubar.js on lines 114..120
    src/assets/primeng/components/slidemenu/slidemenu.js on lines 218..224
    src/assets/primeng/components/tieredmenu/tieredmenu.js on lines 170..176
    src/assets/primeng/components/treetable/treetable.js on lines 446..452

    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 59.

    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