jamesrwhite/minicron

View on GitHub

Showing 181 of 181 total issues

Function 3 has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

},{}],3:[function(require,module,exports){
'use strict';

var DOM = {};

Severity: Minor
Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.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 15 has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"../instances":18,"../update-geometry":19}],15:[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 4 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.affix')
          var options = typeof option == 'object' && option
    Severity: Major
    Found in server/lib/minicron/hub/assets/js/bootstrap.js and 1 other location - About 4 hrs to fix
    server/lib/minicron/hub/assets/js/bootstrap.js on lines 2022..2031

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

    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.scrollspy')
          var options = typeof option == 'object' && option
    Severity: Major
    Found in server/lib/minicron/hub/assets/js/bootstrap.js and 1 other location - About 4 hrs to fix
    server/lib/minicron/hub/assets/js/bootstrap.js on lines 2334..2343

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

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

    function bindMouseWheelHandler(element, i) {
      var shouldPrevent = false;
    
      function shouldPreventDefault(deltaX, deltaY) {
        var scrollTop = element.scrollTop;
    Severity: Major
    Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 4 hrs to fix

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

        if (axis === 'left' && value >= i.contentWidth - i.containerWidth) {
          // don't allow scroll past container
          value = i.contentWidth - i.containerWidth;
          if (value - element.scrollLeft <= 1) {
            // mitigates rounding errors on non-subpixel scroll values
      Severity: Major
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 3 hrs to fix
      server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1478..1488

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

      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 (axis === 'top' && value >= i.contentHeight - i.containerHeight) {
          // don't allow scroll past container
          value = i.contentHeight - i.containerHeight;
          if (value - element.scrollTop <= 1) {
            // mitigates rounding errors on non-subpixel scroll values
      Severity: Major
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 3 hrs to fix
      server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1490..1500

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

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

      function bindSelectionHandler(element, i) {
        function getRangeNode() {
          var selection = window.getSelection ? window.getSelection() :
                          document.getSelection ? document.getSelection() : '';
          if (selection.toString().length === 0) {
      Severity: Major
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 3 hrs to fix

        Function 12 has a Cognitive Complexity of 26 (exceeds 5 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: Minor
        Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - 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 18 has 90 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[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 3 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.alert')
          
          
          Severity: Major
          Found in server/lib/minicron/hub/assets/js/bootstrap.js and 1 other location - About 3 hrs to fix
          server/lib/minicron/hub/assets/js/bootstrap.js on lines 880..888

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

          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.dropdown')
          
          
          Severity: Major
          Found in server/lib/minicron/hub/assets/js/bootstrap.js and 1 other location - About 3 hrs to fix
          server/lib/minicron/hub/assets/js/bootstrap.js on lines 142..150

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

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

          (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');
          var psInstances = require('../plugin/instances');
          Severity: Minor
          Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - 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 11 has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[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 3 hrs to fix

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

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

            File schedules.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            'use strict';
            
            (function() {
              var Schedule = {
                _default_schedule: {
            Severity: Minor
            Found in server/lib/minicron/hub/assets/js/schedules.js - About 3 hrs to fix

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

                if (!element.contains(i.scrollbarXRail)) {
                  existingRails = dom.queryChildren(element, '.ps-scrollbar-x-rail');
                  if (existingRails.length > 0) {
                    existingRails.forEach(function (rail) {
                      dom.remove(rail);
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 3 hrs to fix
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1382..1390

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

              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 (!element.contains(i.scrollbarYRail)) {
                  existingRails = dom.queryChildren(element, '.ps-scrollbar-y-rail');
                  if (existingRails.length > 0) {
                    existingRails.forEach(function (rail) {
                      dom.remove(rail);
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 3 hrs to fix
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1373..1381

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

              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 20 has 72 lines of code (exceeds 25 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: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 2 hrs to fix

                Function 6 has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{}],6:[function(require,module,exports){
                'use strict';
                
                var cls = require('./class');
                var dom = require('./dom');
                Severity: Major
                Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language