jaumard/ngx-dashboard

View on GitHub

Showing 75 of 75 total issues

Function 129 has a Cognitive Complexity of 191 (exceeds 5 allowed). Consider refactoring.
Open

/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
Severity: Minor
Found in demo/demoDist/main.bundle.js - About 3 days 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 129 has 458 lines of code (exceeds 25 allowed). Consider refactoring.
Open

/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
Severity: Major
Found in demo/demoDist/main.bundle.js - About 2 days to fix

    Function DashboardComponent has 418 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var DashboardComponent = (function () {
        function DashboardComponent(_componentFactoryResolver, _ngEl, _renderer) {
            this._componentFactoryResolver = _componentFactoryResolver;
            this._ngEl = _ngEl;
            this._renderer = _renderer;
    Severity: Major
    Found in demo/demoDist/main.bundle.js - About 2 days to fix

      Function 319 has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
      Open

      /***/ (function(module, exports) {
      
      /*
          MIT License http://www.opensource.org/licenses/mit-license.php
          Author Tobias Koppers @sokra
      Severity: Minor
      Found in demo/demoDist/styles.bundle.js - About 2 days 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

      File main.bundle.js has 790 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      webpackJsonp([0,3],{
      
      /***/ 129:
      /***/ (function(module, exports, __webpack_require__) {
      
      
      Severity: Major
      Found in demo/demoDist/main.bundle.js - About 1 day to fix

        Similar blocks of code found in 3 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 demo/demoDist/main.bundle.js and 2 other locations - About 1 day to fix
        demo/demoDist/main.bundle.js on lines 530..535
        demo/demoDist/main.bundle.js on lines 928..933

        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 3 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 demo/demoDist/main.bundle.js and 2 other locations - About 1 day to fix
        demo/demoDist/main.bundle.js on lines 928..933
        demo/demoDist/main.bundle.js on lines 1016..1021

        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 3 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 demo/demoDist/main.bundle.js and 2 other locations - About 1 day to fix
        demo/demoDist/main.bundle.js on lines 530..535
        demo/demoDist/main.bundle.js on lines 1016..1021

        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

        Function 319 has 209 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        /***/ (function(module, exports) {
        
        /*
            MIT License http://www.opensource.org/licenses/mit-license.php
            Author Tobias Koppers @sokra
        Severity: Major
        Found in demo/demoDist/styles.bundle.js - About 1 day to fix

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

          import {
            AfterViewInit,
            Component,
            ComponentFactoryResolver,
            ComponentRef,
          Severity: Minor
          Found in src/components/dashboard/dashboard.component.ts - About 7 hrs to fix

            Function 81 has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
            Open

            /***/ (function(module, __webpack_exports__, __webpack_require__) {
            
            "use strict";
            /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(9);
            /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dist__ = __webpack_require__(77);
            Severity: Minor
            Found in demo/demoDist/main.bundle.js - About 6 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

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

            describe('MyWidgetComponent', () => {
              let component: MyWidgetComponent;
              let fixture: ComponentFixture<MyWidgetComponent>;
            
              beforeEach(async(() => {
            Severity: Major
            Found in demo/src/app/my-widget/my-widget.component.spec.ts and 1 other location - About 6 hrs to fix
            src/components/dashboard/dashboard.component.spec.ts on lines 5..25

            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

            describe('DashboardComponent', () => {
              let component: DashboardComponent;
              let fixture: ComponentFixture<DashboardComponent>;
            
              beforeEach(async(() => {
            Severity: Major
            Found in src/components/dashboard/dashboard.component.spec.ts and 1 other location - About 6 hrs to fix
            demo/src/app/my-widget/my-widget.component.spec.ts on lines 8..28

            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

            Function 80 has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

            /***/ (function(module, __webpack_exports__, __webpack_require__) {
            
            "use strict";
            /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(9);
            /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dist__ = __webpack_require__(77);
            Severity: Minor
            Found in demo/demoDist/main.bundle.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 53 has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
            Open

            /***/ (function(module, exports) {
            
            /*
                MIT License http://www.opensource.org/licenses/mit-license.php
                Author Tobias Koppers @sokra
            Severity: Minor
            Found in demo/demoDist/styles.bundle.js - About 4 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

            DashboardComponent has 33 functions (exceeds 20 allowed). Consider refactoring.
            Open

            @Component({
              selector: 'dashboard',
              template: '<div #target><ng-content></ng-content></div>',
              host: {
                '(window:resize)': '_onResize($event)',
            Severity: Minor
            Found in src/components/dashboard/dashboard.component.ts - About 4 hrs to fix

              Function 137 has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

              /***/ (function(module, __webpack_exports__, __webpack_require__) {
              
              "use strict";
              /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__ = __webpack_require__(43);
              /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(9);
              Severity: Minor
              Found in demo/demoDist/main.bundle.js - About 4 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 75 has 101 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              /***/ (function(module, exports, __webpack_require__) {
              
              "use strict";
              
              Object.defineProperty(exports, "__esModule", { value: true });
              Severity: Major
              Found in demo/demoDist/main.bundle.js - About 4 hrs to fix

                Function _positionWidget has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                  private _positionWidget(lines: number[], items: ComponentRef<WidgetComponent>[], index: number, column: number, row: number): void {
                    if (!items[index]) {
                      let remainingHeight = 0;
                      for (let i = 0; i < lines.length; i++) {
                        if (remainingHeight < lines[i]) {
                Severity: Minor
                Found in src/components/dashboard/dashboard.component.ts - About 3 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 WidgetComponent has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var WidgetComponent = (function () {
                    function WidgetComponent(_ngEl, _renderer) {
                        this._ngEl = _ngEl;
                        this._renderer = _renderer;
                        this.size = [1, 1];
                Severity: Major
                Found in demo/demoDist/main.bundle.js - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language