steelThread/redmon

View on GitHub

Showing 10 of 12 total issues

Function Redmon has 460 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Redmon = (function() {
  var config
    , events = $({});

  /**
Severity: Major
Found in lib/redmon/public/redmon.js - About 2 days to fix

    Function Redmon has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
    Open

    var Redmon = (function() {
      var config
        , events = $({});
    
      /**
    Severity: Minor
    Found in lib/redmon/public/redmon.js - About 7 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 redmon.js has 462 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var Redmon = (function() {
      var config
        , events = $({});
    
      /**
    Severity: Minor
    Found in lib/redmon/public/redmon.js - About 7 hrs to fix

      Function cli has 148 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var cli = (function() {
          var terminal;
      
          function init() {
            var prompt = [
      Severity: Major
      Found in lib/redmon/public/redmon.js - About 5 hrs to fix

        Function keyspaceWidget has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var keyspaceWidget = (function() {
            var chart
              , dataset = {
                hits:   {key: 'Hits'   , values: []},
                misses: {key: 'Misses' , values: []},
        Severity: Major
        Found in lib/redmon/public/redmon.js - About 2 hrs to fix

          Function toolbar has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            var toolbar = (function() {
              var mapping = {}
                , current = {};
          
              function init() {
          Severity: Minor
          Found in lib/redmon/public/redmon.js - About 1 hr to fix

            Function memoryWidget has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var memoryWidget = (function() {
                var chart
                  , dataset = [];
            
                function render(data) {
            Severity: Minor
            Found in lib/redmon/public/redmon.js - About 1 hr to fix

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

                var configWidget = (function() {
                  var selects = {
                    'appendonly'                : 'yes,no',
                    'no-appendfsync-on-rewrite' : 'yes,no',
                    'slave-serve-stale-data'    : 'yes,no',
              Severity: Minor
              Found in lib/redmon/public/redmon.js - About 1 hr to fix

                Function infoWidget has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var infoWidget = (function() {
                    function render(data) {
                      if (data && data.length)
                        updateTable(data[data.length-1]);
                    }
                Severity: Minor
                Found in lib/redmon/public/redmon.js - About 1 hr to fix

                  Avoid too many return statements within this function.
                  Open

                      else                     { return y }
                  Severity: Major
                  Found in lib/redmon/public/redmon.js - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language