jamesrwhite/minicron

View on GitHub

Showing 82 of 181 total issues

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

    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

        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

          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

            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

                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

                          Method add_db_cli_command has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                def self.add_db_cli_command(cli)
                                  cli.command :db do |c|
                                    c.syntax = 'minicron db [setup|migrate|version]'
                                    c.description = 'Sets up the minicron database schema.'
                          
                          
                          Severity: Minor
                          Found in server/lib/minicron/cli/commands.rb - About 1 hr to fix

                            Method add_server_cli_command has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  def self.add_server_cli_command(cli)
                                    cli.command :server do |c|
                                      c.syntax = 'minicron server [start|stop|restart|status]'
                                      c.description = 'Controls the minicron server.'
                                      c.option '--host STRING', String, "The host for the server to listen on. Default: #{Minicron.config['server']['host']}"
                            Severity: Minor
                            Found in server/lib/minicron/cli/commands.rb - About 1 hr to fix

                              Function _onUpdate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  _onUpdate: function($this) {
                                    this._checkInit();
                              
                                    // The 'id' of the event which we use to defer the type
                                    // it's either the href with the # stripped off if it's a
                              Severity: Minor
                              Found in server/lib/minicron/hub/assets/js/schedules.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language