def calculation(atom, base)
      initial = base.month + atom
      if initial <= 0
        month = base.month + atom

        if (initial % 12).zero?
          year = base.year + (initial / 12) - 1
          month = 12
        else
          year = base.year + (initial / 12).floor
          month = 12 + initial > 0 ? (12 + initial) : (12 + (initial % -12))
        end
      else
        month = initial <= 12 ? initial : (initial % 12)
        month = 12 if month.zero?
        year = initial <= 12 ? base.year : base.year + (initial / 12).to_i
      end

      (::Time.utc(year, month) - ::Time.utc(base.year, base.month)) / atom
    end
def calculation(atom, base)
      initial = base.month + atom
      if initial <= 0
        month = base.month + atom

        if (initial % 12).zero?
          year = base.year + (initial / 12) - 1
          month = 12
        else
          year = base.year + (initial / 12).floor
          month = 12 + initial > 0 ? (12 + initial) : (12 + (initial % -12))
        end
      else
        month = initial <= 12 ? initial : (initial % 12)
        month = 12 if month.zero?
        year = initial <= 12 ? base.year : base.year + (initial / 12).to_i
      end

      (::Time.utc(year, month) - ::Time.utc(base.year, base.month)) / atom
    end
rubocop:disable Metrics/AbcSize