AgileVentures/WebsiteOne

View on GitHub

Showing 63 of 206 total issues

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

  def profile_completeness
    awarded = 0
    awarded += 2 if skill_list.present?
    awarded += 2 if github_profile_url.present?
    awarded += 2 if youtube_user_name.present?
Severity: Minor
Found in app/models/user.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 final_datetime_for_collection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def final_datetime_for_collection(options = {})
    final_datetime = if repeating_and_ends? && options[:end_time].present?
                       [options[:end_time], repeat_ends_on.to_datetime].min
                     elsif repeating_and_ends?
                       repeat_ends_on.to_datetime
Severity: Minor
Found in app/models/event.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 render_error has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def render_error(status, error)
    raise error unless Features.enabled?(:custom_errors)

    Rails.logger.error error.message
    error.backtrace.each_with_index do |line, index|
Severity: Minor
Found in lib/custom_errors.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

Severity
Category
Status
Source
Language