le0pard/mongodb_logger

View on GitHub

Showing 64 of 86 total issues

Function Legend has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Rickshaw.Graph.Legend = function(args) {

    var element = this.element = args.element;
    var graph = this.graph = args.graph;

Severity: Minor
Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 1 hr to fix

    Function Palette has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Rickshaw.Color.Palette = function(args) {
    
        var color = new Rickshaw.Fixtures.Color();
    
        args = args || {};
    Severity: Minor
    Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 1 hr to fix

      Function RangeSlider has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function Palette has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        Rickshaw.Color.Palette = function(args) {
        
            var color = new Rickshaw.Fixtures.Color();
        
            args = args || {};
        Severity: Minor
        Found in app/assets/javascripts/vendors/rickshaw/rickshaw.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

        Function update has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            update: function(e) {
        
                e = e || this.lastEvent;
                if (!e) return;
                this.lastEvent = e;
        Severity: Minor
        Found in app/assets/javascripts/vendors/rickshaw/rickshaw.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 mongo_conditions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

              def mongo_conditions
                data = Hash.new
                return data if self.key.blank?
                m_value = case self.type
                when "integer"
        Severity: Minor
        Found in lib/mongodb_logger/server/model/additional_filter.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

        Method mongo_conditions has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def mongo_conditions
                data = Hash.new
                return data if self.key.blank?
                m_value = case self.type
                when "integer"
        Severity: Minor
        Found in lib/mongodb_logger/server/model/additional_filter.rb - About 1 hr to fix

          Function initialize has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              initialize: function (data, palette, options) {
          
                  var options = options || {}
          
                  if (typeof(options.timeInterval) === 'undefined') {
          Severity: Minor
          Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 1 hr to fix

            Method calculate_default_map_reduce has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def calculate_default_map_reduce(params = {})
                    addinional_params = case self.unit.to_i
                      when 1
                        "day: this.request_time.getDate()"
                      when 2
            Severity: Minor
            Found in lib/mongodb_logger/server/model/analytic.rb - About 1 hr to fix

              Function initialize has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  initialize: function (data, palette, options) {
              
                      var options = options || {}
              
                      if (typeof(options.timeInterval) === 'undefined') {
              Severity: Minor
              Found in app/assets/javascripts/vendors/rickshaw/rickshaw.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

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

                  render: function(args) {
              
                      var detail = args.detail;
                      var domainX = args.domainX;
              
              
              Severity: Minor
              Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 1 hr to fix

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

                                label.onclick = function(e){
                
                                        var disableAllOtherLines = line.series.disabled;
                                        if ( ! disableAllOtherLines ) {
                                                for ( var i = 0; i < self.legend.lines.length; i++ ) {
                Severity: Minor
                Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 1 hr to fix

                  Function Annotate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Rickshaw.Graph.Annotate = function(args) {
                  
                      var graph = this.graph = args.graph;
                      this.elements = { timeline: args.element };
                      
                  Severity: Minor
                  Found in app/assets/javascripts/vendors/rickshaw/rickshaw.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 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def add(severity, message = nil, progname = nil, &block)
                        $stdout.puts(message) if ENV['HEROKU_RACK'] # log in stdout on Heroku
                        if @level && @level <= severity && (message.present? || progname.present?) && Thread.current[:mongodb_logger_mongo_record].present?
                          add_log_message(severity, message, progname)
                        end
                  Severity: Minor
                  Found in lib/mongodb_logger/logger.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 validateSeries has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      this.validateSeries = function(series) {
                  
                          if (!(series instanceof Array) && !(series instanceof Rickshaw.Series)) {
                              var seriesSignature = Object.prototype.toString.apply(series);
                              throw "series is not an array: " + seriesSignature;
                  Severity: Minor
                  Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 1 hr to fix

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

                    Rickshaw.Graph.Behavior.Series.Highlight = function(args) {
                    
                        this.graph = args.graph;
                        this.legend = args.legend;
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 1 hr to fix

                      Function formatter has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          formatter: function(series, x, y, formattedX, formattedY, d) {
                      Severity: Minor
                      Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 45 mins to fix

                        Function formatKMBT has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Rickshaw.Fixtures.Number.formatKMBT = function(y) {
                            if (y >= 1000000000000)   { return y / 1000000000000 + "T" } 
                            else if (y >= 1000000000) { return y / 1000000000 + "B" } 
                            else if (y >= 1000000)    { return y / 1000000 + "M" } 
                            else if (y >= 1000)       { return y / 1000 + "K" }
                        Severity: Minor
                        Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 45 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

                        Function formatBase1024KMGTP has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Rickshaw.Fixtures.Number.formatBase1024KMGTP = function(y) {
                            if (y >= 1125899906842624)  { return y / 1125899906842624 + "P" }
                            else if (y >= 1099511627776){ return y / 1099511627776 + "T" }
                            else if (y >= 1073741824)   { return y / 1073741824 + "G" }
                            else if (y >= 1048576)      { return y / 1048576 + "M" }
                        Severity: Minor
                        Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 45 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

                        Method select_tag has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def select_tag(object, name, options_array, options = {})
                            value = nil
                            value = options.delete(:value) if options[:value]
                            value = object.send name if object && object.respond_to?(name)
                            attributes = options.map{ |key, val| "#{key}='#{val}'" }
                        Severity: Minor
                        Found in lib/mongodb_logger/server/helpers/view_helpers.rb - About 45 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

                        Severity
                        Category
                        Status
                        Source
                        Language