jamesrwhite/minicron

View on GitHub

Showing 181 of 181 total issues

Function mousewheelHandler has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function mousewheelHandler(e) {
    var delta = getDeltaFromEvent(e);

    var deltaX = delta[0];
    var deltaY = delta[1];
Severity: Minor
Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js - About 1 hr to fix

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

      i.railYMarginHeight = _.toInt(dom.css(i.scrollbarYRail, 'marginTop')) + _.toInt(dom.css(i.scrollbarYRail, 'marginBottom'));
    Severity: Major
    Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 1 hr to fix
    server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1255..1255

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

    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

    Method capture_output has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.capture_output(options = {})
        # Default options
        options[:type] ||= :both
    
        # Make copies of the origin STDOUT/STDERR
    Severity: Minor
    Found in server/lib/minicron.rb - About 1 hr to fix

      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

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

          i.railBorderXWidth = _.toInt(dom.css(i.scrollbarXRail, 'borderLeftWidth')) + _.toInt(dom.css(i.scrollbarXRail, 'borderRightWidth'));
        Severity: Major
        Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 1 hr to fix
        server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1561..1561

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

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

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

                i.railXMarginWidth = _.toInt(dom.css(i.scrollbarXRail, 'marginLeft')) + _.toInt(dom.css(i.scrollbarXRail, 'marginRight'));
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 3 other locations - About 1 hr to fix
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1275..1275
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1277..1277
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1560..1560

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

              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 4 locations. Consider refactoring.
              Open

                i.railBorderYWidth = _.toInt(dom.css(i.scrollbarYRail, 'borderTopWidth')) + _.toInt(dom.css(i.scrollbarYRail, 'borderBottomWidth'));
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 3 other locations - About 1 hr to fix
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1258..1258
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1277..1277
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1560..1560

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

              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 4 locations. Consider refactoring.
              Open

                i.railXMarginWidth = _.toInt(dom.css(i.scrollbarXRail, 'marginLeft')) + _.toInt(dom.css(i.scrollbarXRail, 'marginRight'));
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 3 other locations - About 1 hr to fix
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1258..1258
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1275..1275
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1277..1277

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

              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 4 locations. Consider refactoring.
              Open

                i.railYMarginHeight = _.toInt(dom.css(i.scrollbarYRail, 'marginTop')) + _.toInt(dom.css(i.scrollbarYRail, 'marginBottom'));
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 3 other locations - About 1 hr to fix
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1258..1258
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1275..1275
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 1560..1560

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

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

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

              exports.remove = function (element, className) {
                if (element.classList) {
                  element.classList.remove(className);
                } else {
                  oldRemove(element, className);
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 1 hr to fix
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 65..71

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

              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.add = function (element, className) {
                if (element.classList) {
                  element.classList.add(className);
                } else {
                  oldAdd(element, className);
              Severity: Major
              Found in server/lib/minicron/hub/assets/js/perfect-scrollbar.js and 1 other location - About 1 hr to fix
              server/lib/minicron/hub/assets/js/perfect-scrollbar.js on lines 73..79

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

              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 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
                      Severity
                      Category
                      Status
                      Source
                      Language