thiagofm/memcached-manager

View on GitHub

Showing 168 of 168 total issues

Function split_equal has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        split_equal: function(str, length) {
            var formatting = false;
            var in_text = false;
            var braket = 0;
            var prev_format = '';
Severity: Major
Found in lib/public/javascripts/jquery-terminal.js - About 3 hrs to fix

    Function format_ansi has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                function format_ansi(code) {
                    var controls = code.split(';');
                    var num;
                    var faited = false;
                    var reverse = false;
    Severity: Major
    Found in lib/public/javascripts/jquery-terminal.js - About 3 hrs to fix

      Function noty has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      window.noty = function noty(options) {
      
          // This is for BC  -  Will be deleted on v2.2.0
          var using_old = 0
              , old_to_new = {
      Severity: Major
      Found in lib/public/javascripts/noty/jquery.noty.js - About 3 hrs to fix

        Function noty has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

        window.noty = function noty(options) {
        
            // This is for BC  -  Will be deleted on v2.2.0
            var using_old = 0
                , old_to_new = {
        Severity: Minor
        Found in lib/public/javascripts/noty/jquery.noty.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

        Function date has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          humanize.date = function(format, timestamp) {
            var jsdate = ((timestamp === undefined) ? new Date() : // Not provided
                          (timestamp instanceof Date) ? new Date(timestamp) : // JS Date()
                          new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int)
                         );
        Severity: Major
        Found in lib/public/javascripts/humanize.js - About 3 hrs to fix

          Function History has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function History(name, size) {
                  var enabled = true;
                  var storage_key = '';
                  if (typeof name === 'string' && name !== '') {
                      storage_key = name + '_';
          Severity: Major
          Found in lib/public/javascripts/jquery-terminal.js - About 2 hrs to fix

            File humanize_duration.js has 286 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // HumanizeDuration.js - http://git.io/j0HgmQ
            
            (function() {
            
              var UNITS = {
            Severity: Minor
            Found in lib/public/javascripts/humanize_duration.js - About 2 hrs to fix

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

                  Configs.save(config, function(response) {
                    if (Response.valid(response)){ // Checks if response is valid
                      Notification.success('Yay! Memcached config updated with success.');
              
                      // Refreshing list
              Severity: Major
              Found in lib/public/javascripts/angular/controllers.js and 1 other location - About 2 hrs to fix
              lib/public/javascripts/angular/controllers.js on lines 69..81

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

              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

                  Key.delete({key: pair.key}, function(response) {
                    if (Response.valid(response)){ // Checks if response is valid
                      Notification.info('Yay! Key deleted with success.');
              
                      // Refreshing list
              Severity: Major
              Found in lib/public/javascripts/angular/controllers.js and 1 other location - About 2 hrs to fix
              lib/public/javascripts/angular/controllers.js on lines 11..23

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

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

                              login: function(auth, infinite, success, error) {
                                  if (in_login) {
                                      throw new Error(strings.notWhileLogin);
                                  }
                                  if (typeof auth !== 'function') {
              Severity: Major
              Found in lib/public/javascripts/jquery-terminal.js - About 2 hrs to fix

                Function json_stringify has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    $.json_stringify = function(object, level) {
                        var result = '', i;
                        level = level === undefined ? 1 : level;
                        var type = typeof object;
                        switch (type) {
                Severity: Major
                Found in lib/public/javascripts/jquery-terminal.js - About 2 hrs to fix

                  Function test has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          test: function() {
                              var term = $.terminal.active();
                              if (!term) {
                                  term = $('body').terminal($.noop).css('margin', 0);
                                  var margin = term.outerHeight() - term.height();
                  Severity: Major
                  Found in lib/public/javascripts/jquery-terminal.js - About 2 hrs to fix

                    Function commands has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function commands(command, silent, exec) {
                                try {
                                    if (!ghost()) {
                                        prev_command = $.terminal.splitCommand(command).name;
                                        if (exec && typeof settings.historyFilter == 'function' &&
                    Severity: Major
                    Found in lib/public/javascripts/jquery-terminal.js - About 2 hrs to fix

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

                          if (timeDiff < 3600 && timeDiff > -3600) {
                            return (timeDiff >= 0 ? Math.floor(timeDiff / 60) + ' minutes ago' : 'in ' + Math.floor(-timeDiff / 60) + ' minutes');
                          }
                      Severity: Major
                      Found in lib/public/javascripts/humanize.js and 1 other location - About 2 hrs to fix
                      lib/public/javascripts/humanize.js on lines 323..325

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

                      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

                          if (timeDiff < 86400 && timeDiff > -86400) {
                            return (timeDiff >= 0 ? Math.floor(timeDiff / 3600) + ' hours ago' : 'in ' + Math.floor(-timeDiff / 3600) + ' hours');
                          }
                      Severity: Major
                      Found in lib/public/javascripts/humanize.js and 1 other location - About 2 hrs to fix
                      lib/public/javascripts/humanize.js on lines 313..315

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

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

                              close:function () {
                      
                                  if (this.closed) return;
                                  if (this.$bar && this.$bar.hasClass('i-am-closing-now')) return;
                      
                      
                      Severity: Minor
                      Found in lib/public/javascripts/noty/jquery.noty.js - About 1 hr to fix

                        Function format has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            sprintf.format = function(parse_tree, argv) {
                                var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;
                                for (i = 0; i < tree_length; i++) {
                                    node_type = get_type(parse_tree[i]);
                                    if (node_type === 'string') {
                        Severity: Minor
                        Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

                          Function relativeTime has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            humanize.relativeTime = function(timestamp) {
                              timestamp = (timestamp === undefined) ? humanize.time() : timestamp;
                          
                              var currTime = humanize.time();
                              var timeDiff = currTime - timestamp;
                          Severity: Minor
                          Found in lib/public/javascripts/humanize.js - About 1 hr to fix

                            Function add has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        add: function(element, interval, label, fn, times, belay) {
                                            var counter = 0;
                            
                                            if (jQuery.isFunction(label)) {
                                                if (!times) {
                            Severity: Minor
                            Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                  sprintf.parse = function(fmt) {
                                      var _fmt = fmt, match = [], parse_tree = [], arg_names = 0;
                                      while (_fmt) {
                                          if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
                                              parse_tree.push(match[0]);
                              Severity: Minor
                              Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language