jamesrwhite/minicron

View on GitHub

Showing 181 of 181 total issues

File bootstrap.js has 1596 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Bootstrap v3.3.7 (http://getbootstrap.com)
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under the MIT license
 */
Severity: Major
Found in server/lib/minicron/hub/assets/js/bootstrap.js - About 4 days to fix

    File perfect-scrollbar.js has 1302 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* perfect-scrollbar v0.6.16 */
    (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    'use strict';
    
    var ps = require('../main');
    Severity: Major
    Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 3 days to fix

      Function 13 has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
      Open

      },{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){
      'use strict';
      
      var instances = require('../instances');
      var updateGeometry = require('../update-geometry');
      Severity: Minor
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 1 day 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 16 has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

      },{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(require,module,exports){
      'use strict';
      
      var _ = require('../../lib/helper');
      var instances = require('../instances');
      Severity: Minor
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 1 day 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

        function shouldPreventDefault(deltaX, deltaY) {
          var scrollTop = element.scrollTop;
          if (deltaX === 0) {
            if (!i.scrollbarYActive) {
              return false;
      Severity: Major
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 1 day to fix
      server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 568..589

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

      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

        function shouldPreventDefault(deltaX, deltaY) {
          var scrollTop = element.scrollTop;
          if (deltaX === 0) {
            if (!i.scrollbarYActive) {
              return false;
      Severity: Major
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 1 day to fix
      server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 715..736

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

      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 19 has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
      Open

      },{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){
      'use strict';
      
      var _ = require('../lib/helper');
      var cls = require('../lib/class');
      Severity: Minor
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 7 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 16 has 145 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(require,module,exports){
      'use strict';
      
      var _ = require('../../lib/helper');
      var instances = require('../instances');
      Severity: Major
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 5 hrs to fix

        Function 20 has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

        },{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(require,module,exports){
        'use strict';
        
        var instances = require('./instances');
        
        
        Severity: Minor
        Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.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

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

          i.event.bind(i.scrollbarY, 'mousedown', function (e) {
            currentPageY = e.pageY;
            currentTop = _.toInt(dom.css(i.scrollbarY, 'top')) * i.railYRatio;
            _.startScrolling(element, 'y');
        
        
        Severity: Major
        Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 5 hrs to fix
        server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 485..495

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

        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

          i.event.bind(i.scrollbarX, 'mousedown', function (e) {
            currentPageX = e.pageX;
            currentLeft = _.toInt(dom.css(i.scrollbarX, 'left')) * i.railXRatio;
            _.startScrolling(element, 'x');
        
        
        Severity: Major
        Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 5 hrs to fix
        server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 530..540

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

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

        },{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(require,module,exports){
        'use strict';
        
        var _ = require('../../lib/helper');
        var dom = require('../../lib/dom');
        Severity: Major
        Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 5 hrs to fix

          Function bindTouchHandler has 132 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function bindTouchHandler(element, i, supportsTouch, supportsIePointer) {
            function shouldPreventDefault(deltaX, deltaY) {
              var scrollTop = element.scrollTop;
              var scrollLeft = element.scrollLeft;
              var magnitudeX = Math.abs(deltaX);
          Severity: Major
          Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 5 hrs to fix

            Function bindKeyboardHandler has 128 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function bindKeyboardHandler(element, i) {
              var hovered = false;
              i.event.bind(element, 'mouseenter', function () {
                hovered = true;
              });
            Severity: Major
            Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 5 hrs to fix

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

                function Plugin(option) {
                  return this.each(function () {
                    var $this   = $(this)
                    var data    = $this.data('bs.popover')
                    var options = typeof option == 'object' && option
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/bootstrap.js and 1 other location - About 5 hrs to fix
              server/lib/minicron/hub/assets/js/bootstrap.js on lines 1750..1760

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

              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

                function Plugin(option) {
                  return this.each(function () {
                    var $this   = $(this)
                    var data    = $this.data('bs.tooltip')
                    var options = typeof option == 'object' && option
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/bootstrap.js and 1 other location - About 5 hrs to fix
              server/lib/minicron/hub/assets/js/bootstrap.js on lines 1859..1869

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

              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

                i.event.bind(i.scrollbarXRail, 'click', function (e) {
                  var positionLeft = e.pageX - window.pageXOffset - pageOffset(i.scrollbarXRail).left;
                  var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
              
                  updateScroll(element, 'left', element.scrollLeft + direction * i.containerWidth);
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 4 hrs to fix
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 417..425

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

              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

                i.event.bind(i.scrollbarYRail, 'click', function (e) {
                  var positionTop = e.pageY - window.pageYOffset - pageOffset(i.scrollbarYRail).top;
                  var direction = positionTop > i.scrollbarYTop ? 1 : -1;
              
                  updateScroll(element, 'top', element.scrollTop + direction * i.containerHeight);
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 4 hrs to fix
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 428..436

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

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

              },{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){
              'use strict';
              
              var _ = require('../lib/helper');
              var cls = require('../lib/class');
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 4 hrs to fix

                Function 13 has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){
                'use strict';
                
                var instances = require('../instances');
                var updateGeometry = require('../update-geometry');
                Severity: Major
                Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 4 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language