redmine/redmine

View on GitHub
extra/mail_handler/rdm-mailhandler.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Method initialize has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def initialize
    self.issue_attributes = {}

    optparse = OptionParser.new do |opts|
      opts.banner = "Usage: rdm-mailhandler.rb [options] --url=<Redmine URL> --key=<API key>"
Severity: Major
Found in extra/mail_handler/rdm-mailhandler.rb - About 3 hrs to fix

    Method submit has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def submit(email)
        uri = url.gsub(%r{/*$}, '') + '/mail_handler'
    
        headers = { 'User-Agent' => "Redmine mail handler/#{VERSION}" }
    
    
    Severity: Minor
    Found in extra/mail_handler/rdm-mailhandler.rb - About 1 hr to fix

      Avoid too many return statements within this method.
      Open

              return 75
      Severity: Major
      Found in extra/mail_handler/rdm-mailhandler.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return 0
        Severity: Major
        Found in extra/mail_handler/rdm-mailhandler.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return 1
          Severity: Major
          Found in extra/mail_handler/rdm-mailhandler.rb - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status