le0pard/mongodb_logger

View on GitHub

Showing 64 of 86 total issues

File rickshaw.js has 1955 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var Rickshaw = {

    namespace: function(namespace, obj) {

        var parts = namespace.split('.');
Severity: Major
Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 5 days to fix

    Function ClassList has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

    Rickshaw.Compat.ClassList = function() {
    
        /* adapted from http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
    
        if (typeof document !== "undefined" && !("classList" in document.createElement("a"))) {
    Severity: Minor
    Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 1 day 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 Graph has 159 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Rickshaw.Graph = function(args) {
    
        this.element = args.element;
        this.series = args.series;
    
    
    Severity: Major
    Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 6 hrs to fix

      Function Color has 146 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Rickshaw.Fixtures.Color = function() {
      
          this.schemes = {};
      
          this.schemes.spectrum14 = [
      Severity: Major
      Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 5 hrs to fix

        Function ClassList has 115 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Rickshaw.Compat.ClassList = function() {
        
            /* adapted from http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
        
            if (typeof document !== "undefined" && !("classList" in document.createElement("a"))) {
        Severity: Major
        Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 4 hrs to fix

          Function Graph has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          Rickshaw.Graph = function(args) {
          
              this.element = args.element;
              this.series = args.series;
          
          
          Severity: Minor
          Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 4 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 Toggle has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

          Rickshaw.Graph.Behavior.Series.Toggle = function(args) {
          
              this.graph = args.graph;
              this.legend = args.legend;
          
          
          Severity: Minor
          Found in app/assets/javascripts/vendors/rickshaw/rickshaw.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 Time has 86 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Rickshaw.Fixtures.Time = function() {
          
              var tzOffset = new Date().getTimezoneOffset() * 60;
          
              var self = this;
          Severity: Major
          Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 3 hrs to fix

            Function Toggle has 85 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Rickshaw.Graph.Behavior.Series.Toggle = function(args) {
            
                this.graph = args.graph;
                this.legend = args.legend;
            
            
            Severity: Major
            Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 3 hrs to fix

              Function Annotate has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Rickshaw.Graph.Annotate = function(args) {
              
                  var graph = this.graph = args.graph;
                  this.elements = { timeline: args.element };
                  
              Severity: Major
              Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 2 hrs to fix

                Method build_mongo_conditions has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                      def build_mongo_conditions
                        @mongo_conditions = Hash.new
                        FIXED_PARAMS_ON_FORM.each do |param_key|
                          value = self.send param_key
                          mkey_val = case param_key
                Severity: Minor
                Found in lib/mongodb_logger/server/model/filter.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 Y has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Rickshaw.Graph.Axis.Y = function(args) {
                
                    var self = this;
                    var berthRate = 0.10;
                
                
                Severity: Major
                Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 2 hrs to fix

                  Function Y has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Rickshaw.Graph.Axis.Y = function(args) {
                  
                      var self = this;
                      var berthRate = 0.10;
                  
                  
                  Severity: Minor
                  Found in app/assets/javascripts/vendors/rickshaw/rickshaw.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 update has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      this.update = function() {
                  
                          Rickshaw.keys(self.data).forEach( function(time) {
                  
                              var annotation = self.data[time];
                  Severity: Major
                  Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 2 hrs to fix

                    Function Class has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var Class = (function() {
                      
                      // Some versions of JScript fail to enumerate over properties, names of which 
                      // correspond to non-enumerable properties in the prototype chain
                      var IS_DONTENUM_BUGGY = (function(){
                    Severity: Major
                    Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 2 hrs to fix

                      Class Logger has 22 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class Logger < RailsLogger
                          include ReplicaSetHelper
                      
                          DEFAULT_COLLECTION_SIZE = 250.megabytes
                          # Looks for configuration files in this order
                      Severity: Minor
                      Found in lib/mongodb_logger/logger.rb - About 2 hrs to fix

                        Function update has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            update: function(e) {
                        
                                e = e || this.lastEvent;
                                if (!e) return;
                                this.lastEvent = e;
                        Severity: Major
                        Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 2 hrs to fix

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

                          Rickshaw.Graph.Axis.Time = function(args) {
                          
                              var self = this;
                          
                              this.graph = args.graph;
                          Severity: Major
                          Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 2 hrs to fix

                            Function addAnchor has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                this.addAnchor = function(line) {
                                    var anchor = document.createElement('a');
                                    anchor.innerHTML = '&#10004;';
                                    anchor.classList.add('action');
                                    line.element.insertBefore(anchor, line.element.firstChild);
                            Severity: Minor
                            Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 1 hr to fix

                              Function Smoother has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              Rickshaw.Graph.Smoother = function(args) {
                              
                                  this.graph = args.graph;
                                  this.element = args.element;
                              
                              
                              Severity: Minor
                              Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language