MakersNetwork/agenda-saude

View on GitHub
app/controllers/community/appointments_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use the return of the conditional for variable assignment and comparison.
Open

      if current_patient.doses.exists?
        @appointments_count = Appointment.waiting.not_scheduled
                                        .where(start: from..to, ubs_id: allowed_ubs_ids)
                                        .count
      else

Align .count with .waiting on line 25.
Open

                                        .count

This cop checks the indentation of the method name part in method calls that span more than one line.

Example: EnforcedStyle: aligned (default)

# bad
while myvariable
.b
  # do something
end

# good
while myvariable
      .b
  # do something
end

# good
Thing.a
     .b
     .c

Example: EnforcedStyle: indented

# good
while myvariable
  .b

  # do something
end

Example: EnforcedStyle: indentedrelativeto_receiver

# good
while myvariable
        .a
        .b

  # do something
end

# good
myvariable = Thing
               .a
               .b
               .c

Use the return of the conditional for variable assignment and comparison.
Open

      if current_patient.doses.exists?
        rescheduled = true
      else
        rescheduled = false
      end

Align .where with .waiting on line 25.
Open

                                        .where(start: from..to, ubs_id: allowed_ubs_ids)

This cop checks the indentation of the method name part in method calls that span more than one line.

Example: EnforcedStyle: aligned (default)

# bad
while myvariable
.b
  # do something
end

# good
while myvariable
      .b
  # do something
end

# good
Thing.a
     .b
     .c

Example: EnforcedStyle: indented

# good
while myvariable
  .b

  # do something
end

Example: EnforcedStyle: indentedrelativeto_receiver

# good
while myvariable
        .a
        .b

  # do something
end

# good
myvariable = Thing
               .a
               .b
               .c

There are no issues that match your filters.

Category
Status