jamesrwhite/minicron

View on GitHub

Showing 181 of 181 total issues

Function 3 has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

var DOM = {};

Severity: Major
Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 2 hrs to fix

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

      if (supportsTouch) {
        i.event.bind(window, 'touchstart', globalTouchStart);
        i.event.bind(window, 'touchend', globalTouchEnd);
        i.event.bind(element, 'touchstart', touchStart);
        i.event.bind(element, 'touchmove', touchMove);
    Severity: Major
    Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 2 other locations - About 2 hrs to fix
    server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1138..1150
    server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1144..1150

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

    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

        if (window.PointerEvent) {
          i.event.bind(window, 'pointerdown', globalTouchStart);
          i.event.bind(window, 'pointerup', globalTouchEnd);
          i.event.bind(element, 'pointerdown', touchStart);
          i.event.bind(element, 'pointermove', touchMove);
    Severity: Major
    Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 2 other locations - About 2 hrs to fix
    server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1131..1151
    server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1144..1150

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

    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

        } else if (window.MSPointerEvent) {
          i.event.bind(window, 'MSPointerDown', globalTouchStart);
          i.event.bind(window, 'MSPointerUp', globalTouchEnd);
          i.event.bind(element, 'MSPointerDown', touchStart);
          i.event.bind(element, 'MSPointerMove', touchMove);
    Severity: Major
    Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 2 other locations - About 2 hrs to fix
    server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1131..1151
    server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1138..1150

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

    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

    exports.stopScrolling = function (element, axis) {
      cls.remove(element, 'ps-in-scrolling');
      if (typeof axis !== 'undefined') {
        cls.remove(element, 'ps-' + axis);
      } else {
    Severity: Major
    Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 2 hrs to fix
    server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 322..330

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

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

    module.exports = function (element) {
      var i = instances.get(element);
    
      i.containerWidth = element.clientWidth;
      i.containerHeight = element.clientHeight;
    Severity: Major
    Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 2 hrs to fix

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

      exports.startScrolling = function (element, axis) {
        cls.add(element, 'ps-in-scrolling');
        if (typeof axis !== 'undefined') {
          cls.add(element, 'ps-' + axis);
        } else {
      Severity: Major
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 2 hrs to fix
      server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 332..340

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

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

      module.exports = function (element, axis, value) {
        if (typeof element === 'undefined') {
          throw 'You must provide an element to the update-scroll function';
        }
      
      
      Severity: Major
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 2 hrs to fix

        Method call has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

                def call(env)
                  # Get an easier to work with request object
                  req = Rack::Request.new(env)
        
                  # Authenticate API requests using API keys
        Severity: Minor
        Found in server/lib/minicron/hub/middleware/auth.rb - 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 Command has 85 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func Command(command string, output chan string) (int, error) {
            // Get the hostnasme of the server we're running on
            hostname, err := os.Hostname()
        
            if err != nil {
        Severity: Major
        Found in client/run/run.go - About 2 hrs to fix

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

              } else if (i.scrollbarXActive && !i.scrollbarYActive) {
                // useBothWheelAxes and only horizontal bar is active, so use both
                // wheel axes for horizontal bar
                if (deltaX) {
                  updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed));
          Severity: Major
          Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 2 hrs to fix
          server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 807..825

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

          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

              } else if (i.scrollbarYActive && !i.scrollbarXActive) {
                // only vertical scrollbar is active and useBothWheelAxes option is
                // active, so let's scroll vertical bar using both mouse wheel axes
                if (deltaY) {
                  updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed));
          Severity: Major
          Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 2 hrs to fix
          server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 816..825

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

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

          function Instance(element) {
            var i = this;
          
            i.settings = _.clone(defaultSettings);
            i.containerWidth = null;
          Severity: Major
          Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 2 hrs to fix

            Function 4 has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            },{}],4:[function(require,module,exports){
            'use strict';
            
            var EventElement = function (element) {
              this.element = element;
            Severity: Major
            Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 2 hrs to fix

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

                  _updateGui: function(parsed_schedule) {
                    this._checkInit();
                    var self = this;
              
                    if (parsed_schedule.type === 'special') {
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/schedules.js - About 2 hrs to fix

                `` has 21 functions (exceeds 20 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 2 hrs to fix

                  Function show has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    Tooltip.prototype.show = function () {
                      var e = $.Event('show.bs.' + this.type)
                  
                      if (this.hasContent() && this.enabled) {
                        this.$element.trigger(e)
                  Severity: Major
                  Found in server/lib/minicron/hub/assets/js/bootstrap.js - About 2 hrs to fix

                    Function e has a Cognitive Complexity of 16 (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){
                    Severity: Minor
                    Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.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

                    Method start! has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def start!
                          # Activate the monitor
                          @active = true
                    
                          # Connect to the database
                    Severity: Minor
                    Found in server/lib/minicron/monitor.rb - 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

                    Severity
                    Category
                    Status
                    Source
                    Language