Undev/redmine_reminder

View on GitHub

Showing 6 of 6 total issues

Method collect_reminders has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  def collect_reminders
    reminders = {}

    issues = issues_due_in_days
    issues.each do |issue|
Severity: Minor
Found in lib/redmine_reminder/collector.rb - About 1 hr 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 collect_reminders has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def collect_reminders
    reminders = {}

    issues = issues_due_in_days
    issues.each do |issue|
Severity: Minor
Found in lib/redmine_reminder/collector.rb - About 1 hr to fix

    Method reminder_all has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def reminder_all(user, assigned_issues, auth_issues, watched_issues, custom_user_issues, days)
        recipients          = user.mail
        day_tag             = [l(:mail_reminder_all_day1), l(:mail_reminder_all_day2),
          l(:mail_reminder_all_day2), l(:mail_reminder_all_day2),
          l(:mail_reminder_all_day5)]
    Severity: Minor
    Found in app/models/reminder_all_mailer.rb - About 1 hr to fix

      Method deliver_reminder_all_if_any has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def self.deliver_reminder_all_if_any(user, assigned_issues, auth_issues, watched_issues, custom_user_issues, days)
      Severity: Minor
      Found in app/models/reminder_all_mailer.rb - About 45 mins to fix

        Method reminder_all has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def reminder_all(user, assigned_issues, auth_issues, watched_issues, custom_user_issues, days)
        Severity: Minor
        Found in app/models/reminder_all_mailer.rb - About 45 mins to fix

          Method set_default_values has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def set_default_values
              self.days                  ||= 7
              self.issue_status_selector ||= ALL_OPENED
              self.project_selector      ||= ALL
              self.tracker_selector      ||= ALL
          Severity: Minor
          Found in app/models/reminder_configuration.rb - About 45 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