jamesrwhite/minicron

View on GitHub

Showing 82 of 181 total issues

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

  Tab.prototype.show = function () {
    var $this    = this.element
    var $ul      = $this.closest('ul:not(.dropdown-menu)')
    var selector = $this.data('target')

Severity: Minor
Found in server/lib/minicron/hub/assets/js/bootstrap.js - About 1 hr to fix

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

    },{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[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 hr to fix

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

      function updateCss(element, i) {
        var xRailOffset = {width: i.railXWidth};
        if (i.isRtl) {
          xRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth;
        } else {
      Severity: Minor
      Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 1 hr to fix

        Function checkPosition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Affix.prototype.checkPosition = function () {
            if (!this.$element.is(':visible')) return
        
            var height       = this.$element.height()
            var offset       = this.options.offset
        Severity: Minor
        Found in server/lib/minicron/hub/assets/js/bootstrap.js - About 1 hr to fix

          Function 11 has a Cognitive Complexity of 10 (exceeds 5 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: Minor
          Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - 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

          Method add_db_cli_command has a Cognitive Complexity of 10 (exceeds 5 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

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

            Collapse.prototype.hide = function () {
              if (this.transitioning || !this.$element.hasClass('in')) return
          
              var startEvent = $.Event('hide.bs.collapse')
              this.$element.trigger(startEvent)
          Severity: Minor
          Found in server/lib/minicron/hub/assets/js/bootstrap.js - About 1 hr to fix

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

                function next() {
                  $active
                    .removeClass('active')
                    .find('> .dropdown-menu > .active')
                      .removeClass('active')
            Severity: Minor
            Found in server/lib/minicron/hub/assets/js/bootstrap.js - About 1 hr to fix

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

                  _normaliseExpressionValue: function(value) {
                    var mappings = {
                      'jan': '1',
                      'feb': '2',
                      'mar': '3',
              Severity: Minor
              Found in server/lib/minicron/hub/assets/js/schedules.js - About 1 hr to fix

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

                  ScrollSpy.prototype.refresh = function () {
                    var that          = this
                    var offsetMethod  = 'offset'
                    var offsetBase    = 0
                
                
                Severity: Minor
                Found in server/lib/minicron/hub/assets/js/bootstrap.js - About 1 hr to fix

                  Function Command has 10 return statements (exceeds 4 allowed).
                  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 1 hr to fix

                    Function 18 has a Cognitive Complexity of 9 (exceeds 5 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: Minor
                    Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 55 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 deeply nested control flow statements.
                    Open

                                  for (var pos = parseInt(range[0]); pos <= parseInt(range[1]); pos++) {
                                    // If it's a step expression we need to "jump" over certain parts of the range
                                    if (type === 'each-range-step') {
                                      // Extract the step value from the expression
                                      var step = parseInt(value.split('/')[1], 10);
                    Severity: Major
                    Found in server/lib/minicron/hub/assets/js/schedules.js - About 45 mins to fix

                      Method client.post has 6 return statements (exceeds 4 allowed).
                      Open

                      func (c *client) post(method string, reqBody interface{}, respStruct interface{}) (interface{}, error) {
                          // Get the api base endpoint
                          apiBase := viper.Get("apiBase")
                      
                          // Build the URL for the request
                      Severity: Major
                      Found in client/api/api.go - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                          if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
                            throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
                          }
                        Severity: Major
                        Found in server/lib/minicron/hub/assets/js/bootstrap.js - About 40 mins to fix

                          Method parse_config_hash has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def self.parse_config_hash(options = {}, config = nil)
                              if config.nil?
                                config = @config
                              end
                          
                          
                          Severity: Minor
                          Found in server/lib/minicron.rb - 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 true;
                          Severity: Major
                          Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return true;
                            Severity: Major
                            Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return element.msMatchesSelector(query);
                              Severity: Major
                              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
                                Severity: Major
                                Found in server/lib/minicron/hub/assets/js/bootstrap.js - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language