dtsato/agile_brazil

View on GitHub

Showing 25 of 52 total issues

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

  def organizer_section_for(_user, _conference)
    section = Section.new t('actions.section.organize')

    section.add t('actions.manage_conferences'), conferences_path if can? :read, Conference
    section.add t('actions.manage_organizers'), organizers_path(@conference) if can? :read, Organizer
Severity: Minor
Found in app/helpers/actions_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

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

def setup_droplet(droplet)
  setup = "cd #{ROOT}/config && #{link_files(droplet[:ipv4], 'config.yml')} &&\
    #{link_files(droplet[:ipv4], 'database.yml')} &&\
    #{link_files(droplet[:ipv4], 'newrelic.yml')} &&\
    cd #{ROOT}/certs && #{link_files(droplet[:ipv4], 'server.crt')} &&\
Severity: Minor
Found in deploy/digital_ocean/new_machine.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 apply has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def apply(scope)
    scope = scope.for_user(@user_id) if @user_id.present?
    scope = scope.tagged_with(to_tag_keys(@tags)) if @tags.present?
    scope = scope.with_state(@state.to_sym) if @state.present?
    scope = scope.for_tracks(@track_id) if @track_id.present?
Severity: Minor
Found in app/models/session_filter.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 reviewer_section_for has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def reviewer_section_for(user, conference, safe_params)
    section = Section.new t('actions.section.review')
    if (conference.in_early_review_phase? ||
          conference.in_final_review_phase?) &&
       can?(:read, 'reviewer_sessions')
Severity: Minor
Found in app/helpers/actions_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

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

  def sections_for(user, conference, safe_filter_params)
    sections = []

    sections << session_section_for(user, conference) if user_signed_in?
    sections << reviewer_section_for(user, conference, safe_filter_params) if user.reviewer? || user.admin?
Severity: Minor
Found in app/helpers/actions_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

Severity
Category
Status
Source
Language