gems-uff/sapos

View on GitHub

Showing 283 of 383 total issues

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

  def set_status(status, message)
    process_action_link_action(:set_status) do |record|
      if self.successful = record.set_status!(status)
        yield record if block_given?
        flash[:info] = I18n.t(message, count: 1)
Severity: Minor
Found in app/controllers/class_enrollment_requests_controller.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 headers_for has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def headers_for(action, opts)
    headers = super
    headers[:subject] = render_to_string(
      inline: @template.subject
    ) unless @template.subject.nil?
Severity: Minor
Found in app/mailers/devise_mailer.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 enrollment_header has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def enrollment_header(pdf, options = {})
    enrollment ||= options[:enrollment]
    pdf.bounding_box([0, pdf.cursor - 3], width: 560) do
      pdf.font("FreeMono", size: 8) do
        pdf.line_width 0.5
Severity: Minor
Found in app/helpers/enrollments_pdf_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