rubocop:enable LineLength
546329
def deliver!
      ::Notification.create!(
        :audience => Notification::AUDIENCE_USER,
        :notification_blueprint => blueprint,
        :initiator => initiator,
        :message => message,
        :subject => subject,
        :actions => {
          :links => links
        }
      )
    end
747034
function checkCommitMessage (commitMessage, settings) {
  const {
    summaryMaxLength,
    lineMaxLength,
    patterns = {},
    examples = {}
  } = settings

  const isSummaryValid = commitMessage
    ? commitMessage.split('\n')[0].length <= summaryMaxLength
    : true
  const linesExceedingMaxLength = commitMessage
    .split('\n')
    .slice(1) // skip the summary line
    .reduce((a, l, k) => {
      return l.length > lineMaxLength
        ? a.concat({ n: k + 2, text: l })
        : a
    }, [])
  const isLineLengthValid = linesExceedingMaxLength.length === 0
  const isPatternValid = Object.keys(patterns || {}).some(key => {
    return patterns[key].test(commitMessage)
  })

  let errors = []

  if (!isSummaryValid) {
    errors = errors.concat(
      Object.assign(new Error(`Summary is more than ${summaryMaxLength} characters.`), {
        code: 'ESUMRY'
      })
    )
  }

  if (!isLineLengthValid) {
    errors = errors.concat(
      Object.assign(new Error([
        `The following lines have more than ${lineMaxLength} characters :`,
        `${linesExceedingMaxLength.map(l => 'line ' + l.n + ' : ' + l.text).join('\n')}`
      ].join('\n')), { code: 'ELINES', lines: linesExceedingMaxLength })
    )
  }

  if (!isPatternValid) {
    errors = errors.concat(
      Object.assign(new Error([
        'Commit message doesn\'t follow any message pattern.'
      ].concat(
        Object.keys(examples || {})
          .map(key => ['', `${key}:`].concat(examples[key]))
          .reduce((a, b) => a.concat(b), [])
      ).join('\n')), { code: 'EFRMT' })
    )
  }

  return {
    isSummaryValid,
    isLineLengthValid,
    linesExceedingMaxLength,
    isPatternValid,
    isValid: isSummaryValid && isLineLengthValid && isPatternValid,
    errors
  }
}
647473
def add_line_number(node)
      node.line ||= line if node.is_a?(::Sass::Script::Tree::Node)
      node
    end
232162
def width
      string = to_s
      max_width = 0
      string.each_line do |line|
        max_width = [max_width, line.uncolored.chomp.size].max
      end
      max_width
    end
146259
def check_line_length(self, splitted_line, expected_length):
        
        if len(splitted_line) != expected_length:
            raise WrongLineFormat(
                            message='WRONG FORMATED PED LINE!',
                            ped_line = '\t'.join(splitted_line))
        return
342950
def _check(self):
        
        if conf.contribs['LLDP'].strict_mode() and self._length != 2:
            raise LLDPInvalidLengthField('length must be 2 - got '
                                         '{}'.format(self._length))
784967
def __process_line(line, strip_eol, strip):
    
    if strip:
        line = line.strip()
    elif strip_eol and line.endswith('\n'):
        line = line[:-1]
    return line
957907
def ReadLines(self, file_object):
    
    lines_size = len(self.lines)
    if lines_size < self._buffer_size:
      lines_size = self._buffer_size - lines_size
      while lines_size > 0:
        line = self._ReadLine(file_object)
        if not line:
          break

        self.lines = ''.join([self.lines, line])
        lines_size -= len(line)
1189312
def parse_line(line)
      case line
      when /^SF:([\.\/\w]+)/
        @current_filename = $~[1].gsub(/^\.\//, '')
        source_files[@current_filename] = []
      when /^DA:(\d+),(\d+)/
        line_no = $~[1]
        covered = $~[2]
        source_files[@current_filename] << [line_no.to_i, covered.to_i]
      when /^end_of_record$/, /^$/
        @current_filename = nil
      else
        raise LcovParseError, "could not recognise '#{line}' as valid LCOV"
      end
    end
264035
private void matchEndLine() {
		// First, parse all whitespace characters except for new lines
		index = skipLineSpace(index);

		// Second, check whether we've reached the end-of-file (as signaled by
		// running out of tokens), or we've encountered some token which not a
		// newline.
		if (index >= tokens.size()) {
			return; // EOF
		} else if (tokens.get(index).kind != NewLine) {
			syntaxError("expected end-of-line", tokens.get(index));
		} else {
			index = index + 1;
		}
	}
897812
def get_line(exception)
      # SyntaxErrors have weird line reporting
      # when there's trailing whitespace
      if exception.is_a?(::SyntaxError)
        return (exception.message.scan(/:(\d+)/).first || ["??"]).first
      end
      (exception.backtrace[0].scan(/:(\d+)/).first || ["??"]).first
    end
1326206
def text
      content = source_code
      indent = content[/^ */]

      content.gsub(/^#{indent}/, '')
             .gsub(/^-#/, '')
             .gsub(/^  /, '')
             .rstrip
    end
1123323
private function _checkLargeLine() {
		$checkHTMLLines = $this->_config->getTestProperty('lineLength', 'checkHTMLLines');

		// If the current token is HTML we don't check the line size
		if ($checkHTMLLines === "true" || !$this->tokenizer->checkNextValidToken(T_INLINE_HTML)) {
			$maxLength = $this->_config->getTestProperty('lineLength', 'maxLineLength');
			$lineString = ""; // String assembled from tokens
			$currentTokenIndex = $this->tokenizer->getCurrentPosition();
			$currentToken = $this->tokenizer->getCurrentToken($currentTokenIndex);

			do {
				$currentTokenString = $currentToken->text;
				$lineString .= $currentTokenString;

				$currentTokenIndex += 1;
				$currentToken = $this->tokenizer->peekTokenAt($currentTokenIndex);

				$isNull = ($currentToken === null);
				$isNewLine = !$isNull && $this->tokenizer->checkToken($currentToken, T_NEW_LINE);
			} while (!($isNull || $isNewLine));

			$lineLength = strlen($lineString);

			// Reporting the error if the line length exceeds the defined maximum.
			if ($lineLength > $maxLength) {
				// Does not report if the line is a multiline comment - i.e. has /* in it)
				if (strpos($lineString, "/*")) {
					return;
				}
				$msg = $this->_getMessage('LONG_LINE', $lineLength, $maxLength);
				$this->_writeError('lineLength', $msg);
			}
		}
	}
1047161
def shorten_comment(line, max_line_length, last_comment=False):
    
    assert len(line) > max_line_length
    line = line.rstrip()

    # PEP 8 recommends 72 characters for comment text.
    indentation = _get_indentation(line) + '# '
    max_line_length = min(max_line_length,
                          len(indentation) + 72)

    MIN_CHARACTER_REPEAT = 5
    if (
        len(line) - len(line.rstrip(line[-1])) >= MIN_CHARACTER_REPEAT and
        not line[-1].isalnum()
    ):
        # Trim comments that end with things like ---------
        return line[:max_line_length] + '\n'
    elif last_comment and re.match(r'\s*#+\s*\w+', line):
        split_lines = textwrap.wrap(line.lstrip(' \t#'),
                                    initial_indent=indentation,
                                    subsequent_indent=indentation,
                                    width=max_line_length,
                                    break_long_words=False,
                                    break_on_hyphens=False)
        return '\n'.join(split_lines) + '\n'

    return line + '\n'
836683
def run_line_length_cop_auto_gen_config(paths)
      puts Rainbow(PHASE_1).yellow
      @options[:only] = ['Metrics/LineLength']
      execute_runner(paths)
      @options.delete(:only)
      @config_store = ConfigStore.new
      # Save the todo configuration of the LineLength cop.
      IO.read(ConfigLoader::AUTO_GENERATED_FILE)
        .lines
        .drop_while { |line| line.start_with?('#') }
        .join
    end
1077569
def maximum_length(text)
      lines = text.split(/\n/, -1)
      display_width(lines.max_by { |line| display_width(line) } || '')
    end
811675
def adjust_for_length(self, key, r, kwargs):
        
        length = len(str(kwargs))
        if length > settings.defaults["max_detail_length"]:
            self._log_length_error(key, length)
            r["max_detail_length_error"] = length
            return r
        return kwargs