jaumard/ngx-dashboard

View on GitHub

Showing 38 of 75 total issues

Function _onMouseMove has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  private _onMouseMove(e: any): boolean {
    if (this._isDragging) {
      //scroll while drag
      if (this._isTouchEvent(e))
        e = e.touches.length > 0 ? e.touches[0] : e.changedTouches[0];
Severity: Minor
Found in src/components/dashboard/dashboard.component.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function _onMouseMove has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    DashboardComponent.prototype._onMouseMove = function (e) {
        if (this._isDragging) {
            //scroll while drag
            if (this._isTouchEvent(e))
                e = e.touches.length > 0 ? e.touches[0] : e.changedTouches[0];
Severity: Minor
Found in demo/demoDist/main.bundle.js - About 1 hr to fix

    Function 53 has 37 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: Minor
    Found in demo/demoDist/styles.bundle.js - About 1 hr to fix

      Function _onMouseMove has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private _onMouseMove(e: any): boolean {
          if (this._isDragging) {
            //scroll while drag
            if (this._isTouchEvent(e))
              e = e.touches.length > 0 ? e.touches[0] : e.changedTouches[0];
      Severity: Minor
      Found in src/components/dashboard/dashboard.component.ts - About 1 hr to fix

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

        function addStyle(obj, options) {
            var styleElement, update, remove;
        
            if (options.singleton) {
                var styleIndex = singletonCounter++;
        Severity: Minor
        Found in demo/demoDist/styles.bundle.js - About 1 hr to fix

          Function exports has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (config) {
            config.set({
              basePath: '',
              frameworks: ['jasmine', 'angular-cli'],
              plugins: [
          Severity: Minor
          Found in demo/karma.conf.js - About 1 hr to fix

            Function exports has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function() {
                var list = [];
            
                // return the list of modules as css string
                list.toString = function toString() {
            Severity: Minor
            Found in demo/demoDist/styles.bundle.js - About 1 hr to fix

              Function AppComponent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var AppComponent = (function () {
                  function AppComponent() {
                      this.title = 'app works!';
                      this.widgetsSize = [300, 150];
                      this.dashboardMargin = 20;
              Severity: Minor
              Found in demo/demoDist/main.bundle.js - About 1 hr to fix

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

                module.exports = function(list, options) {
                    if(typeof DEBUG !== "undefined" && DEBUG) {
                        if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
                    }
                
                
                Severity: Minor
                Found in demo/demoDist/styles.bundle.js - About 1 hr to fix

                  Function 318 has 27 lines of code (exceeds 25 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 1 hr to fix

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

                        DashboardComponent.prototype._onMouseUp = function (e) {
                            if (this._isDragging) {
                                this._isDragging = false;
                                this._isScrolling = false;
                                if (this._currentElement) {
                    Severity: Minor
                    Found in demo/demoDist/main.bundle.js - About 1 hr to fix

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

                        private _onMouseUp(e: any): boolean {
                          if (this._isDragging) {
                            this._isDragging = false;
                            this._isScrolling = false;
                            if (this._currentElement) {
                      Severity: Minor
                      Found in src/components/dashboard/dashboard.component.ts - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                            } else if(obj.sourceMap &&
                                typeof URL === "function" &&
                                typeof URL.createObjectURL === "function" &&
                                typeof URL.revokeObjectURL === "function" &&
                                typeof Blob === "function" &&
                        Severity: Major
                        Found in demo/demoDist/styles.bundle.js - About 40 mins to fix

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

                              DashboardComponent.prototype._positionWidget = function (lines, items, index, column, row) {
                          Severity: Minor
                          Found in demo/demoDist/main.bundle.js - About 35 mins to fix

                            Function _onMouseUp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              private _onMouseUp(e: any): boolean {
                                if (this._isDragging) {
                                  this._isDragging = false;
                                  this._isScrolling = false;
                                  if (this._currentElement) {
                            Severity: Minor
                            Found in src/components/dashboard/dashboard.component.ts - About 35 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

                            Function 75 has a Cognitive Complexity of 7 (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 35 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

                            Avoid too many return statements within this function.
                            Open

                                return 0;
                            Severity: Major
                            Found in src/components/dashboard/dashboard.component.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return 0;
                              Severity: Major
                              Found in demo/demoDist/main.bundle.js - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language