le0pard/mongodb_logger

View on GitHub

Showing 86 of 86 total issues

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 = '✔';
              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

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

              request: function() {
          
                  $.ajax( {
                      url: this.dataURL,
                      dataType: 'json',
          Severity: Major
          Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/vendors/rickshaw/rickshaw.js on lines 1748..1756

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

          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

              request: function() {
          
                  $.ajax( {
                      url: this.dataURL,
                      dataType: 'jsonp',
          Severity: Major
          Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/vendors/rickshaw/rickshaw.js on lines 992..1000

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

          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

              hide: function() {
                  this.visible = false;
                  this.element.classList.add('inactive');
          
                  if (typeof this.onHide == 'function') {
          Severity: Major
          Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/vendors/rickshaw/rickshaw.js on lines 1665..1672

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

          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

              show: function() {
                  this.visible = true;
                  this.element.classList.remove('inactive');
          
                  if (typeof this.onShow == 'function') {
          Severity: Major
          Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/vendors/rickshaw/rickshaw.js on lines 1656..1663

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

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

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

                        graph.series.forEach( function(series) {
                            if (series.disabled) return;
                            series.path = nodes[0][i++];
                            this._styleSeries(series);
                        }, this );
                Severity: Major
                Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/vendors/rickshaw/rickshaw.js on lines 1948..1952

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

                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

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

                        graph.series.forEach( function(series) {
                            if (series.disabled) return;
                            series.path = nodes[0][i++];
                            this._styleSeries(series);
                        }, this );
                Severity: Major
                Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/vendors/rickshaw/rickshaw.js on lines 2236..2240

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

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

                      Severity
                      Category
                      Status
                      Source
                      Language