le0pard/mongodb_logger

View on GitHub

Showing 64 of 86 total issues

Method log_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def log_data(log)
      main_msg = "No message"
      if log['messages'] && log['messages']['info']
        main_msg = string_from_log_message(log['messages']['info']).truncate(300, :separator => ' ')
      end
Severity: Minor
Found in lib/mongodb_logger/server/helpers/mustache_helpers.rb - About 25 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 rescue_connection_failure has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def rescue_connection_failure(max_retries = 40)
      success = false
      retries = 0
      while !success
        begin
Severity: Minor
Found in lib/mongodb_logger/replica_set_helper.rb - About 25 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 Legend has a Cognitive Complexity of 6 (exceeds 5 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 25 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 addItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    addItem: function(item) {

        if (typeof(item.name) === 'undefined') {
            throw('addItem() needs a name');
        }
Severity: Minor
Found in app/assets/javascripts/vendors/rickshaw/rickshaw.js - About 25 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