Parses and exposes eventual warnings.
 @return   [warning_count]
432442
def parse_warnings
      @warning_count = @xcodebuild_json["warnings"].count
      @warning_count = @warning_count + @xcodebuild_json["ld_warnings"].count
      @warning_count = @warning_count + @xcodebuild_json["compile_warnings"].count
      if @warning_count > 0 && post_messages
        warning_string = @warning_count == 1 ? "warning" : "warnings"
        message = Array.new
        message.push (@build_title) unless @build_title.nil?
        message.push("Please fix **#{@warning_count}** #{warning_string} 😒")
        warn(message.reject(&:empty?).join(" "))
      end
      return @warning_count
    end
780013
def mentions_erb
      retdict = {
        enabled: @config[:mentions][:enabled],
        top: [],
        nottop: []
      }

      if @config[:mentions][:enabled]
        top = @parsed[:mentions].slice(0, @config[:mentions][:top]) # top X mentions
        top.each do |mention|
          retdict[:top] << mention[1]
        end

        nottop = @parsed[:mentions].slice(@config[:mentions][:top], @config[:mentions][:notop]) # not in the top X
        unless nottop.nil?
          nottop.each do |mention|
            mention[1].delete(:example)
            retdict[:nottop] << mention[1]
          end
        end
      end

      retdict
    end
943543
def summary
      # Guard against the exceptions array being removed/changed or emptied here
      if exceptions.respond_to?(:first) && exceptions.first
        {
          :error_class => exceptions.first[:errorClass],
          :message => exceptions.first[:message],
          :severity => severity
        }
      else
        {
          :error_class => "Unknown",
          :severity => severity
        }
      end
    end
309731
def formatWarnings(self, warnings):
        
        lines = []
        for modulename in sorted(warnings):
            lines.append(self.prefixModuleName + modulename)
            lines.extend(sorted(warnings[modulename],
                         key=lambda x: x.split(":")[1]))

        return "\n".join(lines)
1258217
def AddWarning(self, warning):
    
    self._RaiseIfNotWritable()

    warning = self._PrepareAttributeContainer(warning)

    self._warnings.append(warning)
    self.number_of_warnings += 1
1185343
def warning(self, message, *args, **kwargs):
        
        warncls = kwargs.pop('warning', None)
        if warncls and self.raise_warnings:
            warnings.warn(message, warncls)

        return self.log(logging.WARNING, message, *args, **kwargs)
760259
def parse(arguments_parser)
      if @parameter_count == 0
        return true
      elsif @parameter_count == 1
        parameter = arguments_parser.next_parameter
        fail CommandLine::ParameterExpected, self if parameter.nil?
        return parameter
      elsif @parameter_count == :any
        parameters = []
        while parameter = arguments_parser.next_parameter && parameter != '--'
          parameters << parameter
        end
        return parameters
      else
        parameters = []
        @parameter_count.times do |_n|
          parameter = arguments_parser.next_parameter
          fail CommandLine::ParameterExpected, self if parameter.nil?
          parameters << parameter
        end
        return parameters
      end
    end
1207536
def warning(self, msg):
        
        self._execActions('warning', msg)
        msg = self._execFilters('warning', msg)
        self._processMsg('warning', msg)
        self._sendMsg('warning', msg)
238432
def help_now!(message=nil)
      exception = OptionParser::ParseError.new(message)
      class << exception
        def exit_code; 64; end
      end
      raise exception
    end
1006101
def build_warnings
      flagged_results = Set.new

      changeset.each_changed_line do |filepath, line_no|
        dist_from_line_no = lambda do |res|
          return BigDecimal::INFINITY if line_no < res.first_line

          res_lines = res.first_line..res.last_line
          return BigDecimal::INFINITY unless res_lines.cover?(line_no)

          line_no - res.first_line
        end
        dist_from_line_no_sorter = lambda do |res1, res2|
          dist_from_line_no[res1] <=> dist_from_line_no[res2]
        end
        next unless results[filepath]

        res = results[filepath].min(&dist_from_line_no_sorter)
        flagged_results << res if res&.uncovered?(line_no)
      end
      flagged_results
    end
732071
def inits
      raise Erlang::ImproperListError if improper?
      return self if empty?
      prev = nil
      return map do |head|
        if prev.nil?
          Erlang::List.from_enum(prev = [head])
        else
          Erlang::List.from_enum(prev.push(head))
        end
      end
    end
764225
def open_notified_class
      class_eval do
        prepend NotificationActions
        attr_accessor :message, :notify_flag

        # Define association for the notified model
        has_many :notifications, class_name: 'SimpleNotifications::Record', as: :entity
        has_many :notifiers, through: :notifications, source: :sender, source_type: sender_class(@@options[:sender]).to_s
        has_many :read_deliveries, through: :notifications, source: :read_deliveries
        has_many :unread_deliveries, through: :notifications, source: :unread_deliveries

        # Callbacks
        after_create_commit :create_notification, if: proc {@@options[:callbacks].include?(:create)}
        after_update_commit :update_notification, if: proc {@@options[:callbacks].include?(:update)}
        after_destroy_commit :destroy_notification, if: proc {@@options[:callbacks].include?(:destroy)}

        NotificationActions.module_eval do
          @@options[:actions].each do |action|
            define_method(action) do
              run_callbacks action do
                super()
              end
            end

            define_method("before_#{action}".to_sym) do
            end

            define_method("after_#{action}".to_sym) do
              self.notify(sender: @@options[:sender], receivers: @@options[:receivers], message: default_message(self, @@options[:sender], action.to_s))
            end
          end
        end

        @@options[:actions].each do |action|
          define_model_callbacks action
          send("before_#{action}", "before_#{action}".to_sym)
          send("after_#{action}", "after_#{action}".to_sym)
        end

        #Example
        #post.notify(sender: :author, receivers: :followers, message: 'My Custom logic message')
        #post.create(content: '', notify: false) -> It does not create the notification.
        def notify(options = {})
          options[:sender] ||= @@options[:sender]
          options[:receivers] ||= @@options[:receivers]
          if notify_flag.nil? || (!notify_flag.nil? && !!notify_flag)
            raise 'SimpleNotification::SenderReceiverError' unless @@options[:sender] && @@options[:receivers]
            @message = options[:message] if options[:message]
            notification = notifications.build(entity: self, sender: get_obj(options[:sender]), message: default_message(self, get_obj(options[:sender]), 'created'))
            get_obj(options[:receivers]).each {|receiver| notification.deliveries.build(receiver: receiver)}
            notification.save
          end
        end

        def flush_notifications
          notifications.destroy_all
        end

        # Check if notifications has already been delivered.
        def notified?
          !notifications.blank?
        end

        def notificants
          SimpleNotifications::Record.includes(deliveries: :receiver)
              .collect(&:deliveries).flatten
              .collect(&:receiver)
        end

        def read_marked_notificants
          SimpleNotifications::Record.includes(deliveries: :receiver)
              .collect(&:deliveries).flatten
              .select{|record| record.is_read}
              .collect(&:receiver)
        end

        def unread_marked_notificants
          SimpleNotifications::Record.includes(deliveries: :receiver)
              .collect(&:deliveries).flatten
              .select{|record| !record.is_read}.collect(&:receiver)
        end

        # Mark notifications in read mode.
        # If notificants are provided then only those respective notifications will be marked read.
        # Else all will be marked as read.
        def mark_read(notificants = nil)
          (notificants ? unread_deliveries.where(receiver: notificants) : unread_deliveries).update_all(is_read: true)
        end

        # Mark notifications in unread mode.
        # If notificants are provided then only those respective notifications will be marked unread.
        # Else all will be marked as unread.
        def mark_unread(notificants = nil)
          (notificants ? read_deliveries.where(receiver: notificants) : read_deliveries).update_all(is_read: false)
        end

        def default_message(entity, sender, action)
          @message || (method(@@options[:notify_message]).call if !!@@options[:notify_message]) || "#{get_obj(sender).class.name} #{action} #{entity.class.name} #{entity.name}."
        end

        private

        def get_obj(sender_or_receivers)
          sender_or_receivers.kind_of?(Symbol) ? send(sender_or_receivers) : sender_or_receivers
        end

        def create_notification
          notify({sender: get_obj(@@options[:sender]), receivers: get_obj(@@options[:receivers]), message: default_message(self, get_obj(@@options[:sender]), 'created')})
        end

        def update_notification
          notify({sender: get_obj(@@options[:sender]), receivers: get_obj(@@options[:receivers]), message: default_message(self, get_obj(@@options[:sender]), 'updated')})
        end

        def destroy_notification
          notify({sender: get_obj(@@options[:sender]), receivers: get_obj(@@options[:receivers]), message: default_message(self, get_obj(@@options[:sender]), 'deleted')})
        end
      end
    end
590548
def expected_count

      if h.ccount.nil?
        count_list_size
      elsif h.ccount >= 0
        [ h.ccount, count_list_size ].min
      else # all but 1, 2, ...
        i = count_list_size + h.ccount
        i < 1 ? 1 : i
      end
    end
1236137
def display_messages
      [:errors, :warnings].each do |type|
        send(type).each do |msg|
          output.puts(msg.to_s)
        end
      end
    end
133724
def warn_for_unused_rules(compiled_grammar)
      compiled_grammar.rules.each_with_index do |rule, index|
        next if index == 0 || rule.references > 0

        compiled_grammar.add_warning(
          "Unused rule #{rule.name.inspect}",
          rule.source_line
        )
      end
    end
354963
def detect_valid_handler(servers)
      handler = nil
      while (server_name = servers.shift) && handler.nil?
        begin
          handler = ::Rack::Handler.get(server_name)
          return [handler, server_name]
        rescue LoadError
          handler = nil
        rescue NameError
          handler = nil
        end
      end
    end
35860
public int countAndLogWarnings() {
        final List<String> warnings = new LinkedList<>();

        // find elements with a missing description
        getModel().getElements().stream()
                .filter(e -> !(e instanceof ContainerInstance) && !(e instanceof DeploymentNode))
                .filter(e -> e.getDescription() == null || e.getDescription().trim().length() == 0)
                .forEach(e -> warnings.add("The " + typeof(e) + " \"" + e.getCanonicalName().substring(1) + "\" is missing a description."));

        // find containers with a missing technology
        getModel().getElements().stream()
                .filter(e -> e instanceof Container)
                .map(e -> (Container)e)
                .filter(c -> c.getTechnology() == null || c.getTechnology().trim().length() == 0)
                .forEach(c -> warnings.add("The container \"" + c.getCanonicalName().substring(1) + "\" is missing a technology."));

        // find components with a missing technology
        getModel().getElements().stream()
                .filter(e -> e instanceof Component)
                .map(e -> (Component)e)
                .filter(c -> c.getTechnology() == null || c.getTechnology().trim().length() == 0)
                .forEach(c -> warnings.add("The component \"" + c.getCanonicalName().substring(1) + "\" is missing a technology."));

        // find component relationships with a missing description
        for (Relationship relationship : getModel().getRelationships()) {
            if (relationship.getSource() instanceof Component && relationship.getDestination() instanceof Component &&
                    relationship.getSource().getParent().equals(relationship.getDestination().getParent())) {
                // ignore component-component relationships inside the same container because these are
                // often identified using reflection and won't have a description
                // (i.e. let's not flood the user with warnings)
            } else {
                if (relationship.getDescription() == null || relationship.getDescription().trim().length() == 0) {
                    warnings.add("The relationship between " + typeof(relationship.getSource()) + " \"" + relationship.getSource().getCanonicalName().substring(1) + "\" and " + typeof(relationship.getDestination()) + " \"" + relationship.getDestination().getCanonicalName().substring(1) + "\" is missing a description.");
                }
            }
        }

        // diagram keys have not been specified - this is only applicable to
        // workspaces created with the early versions of Structurizr for Java
        getViews().getSystemLandscapeViews().stream()
                .filter(v -> v.getKey() == null)
                .forEach(v -> warnings.add("System Landscape view \"" + v.getName() + "\": Missing key"));
        getViews().getSystemContextViews().stream()
                .filter(v -> v.getKey() == null)
                .forEach(v -> warnings.add("System Context view \"" + v.getName() + "\": Missing key"));
        getViews().getContainerViews().stream()
                .filter(v -> v.getKey() == null)
                .forEach(v -> warnings.add("Container view \"" + v.getName() + "\": Missing key"));
        getViews().getComponentViews().stream()
                .filter(v -> v.getKey() == null)
                .forEach(v -> warnings.add("Component view \"" + v.getName() + "\": Missing key"));
        getViews().getDynamicViews().stream()
                .filter(v -> v.getKey() == null)
                .forEach(v -> warnings.add("Dynamic view \"" + v.getName() + "\": Missing key"));
        getViews().getDeploymentViews().stream()
                .filter(v -> v.getKey() == null)
                .forEach(v -> warnings.add("Deployment view \"" + v.getName() + "\": Missing key"));

        warnings.forEach(log::warn);

        return warnings.size();
    }