def CheckForFunctionLengths(filename, clean_lines, linenum,<EOL>function_state, error):
lines = clean_lines.lines<EOL>line = lines[linenum]<EOL>joined_line = '<STR_LIT>'<EOL>starting_func = False<EOL>regexp = r'<STR_LIT>'  <EOL>match_result = Match(regexp, line)<EOL>if match_result:<EOL><INDENT>function_name = match_result.group(<NUM_LIT:1>).split()[-<NUM_LIT:1>]<EOL>if function_name == '<STR_LIT>' or function_name == '<STR_LIT>' or (<EOL>not Match(r'<STR_LIT>', function_name)):<EOL><INDENT>starting_func = True<EOL><DEDENT><DEDENT>if starting_func:<EOL><INDENT>body_found = False<EOL>for start_linenum in range(linenum, clean_lines.NumLines()):<EOL><INDENT>start_line = lines[start_linenum]<EOL>joined_line += '<STR_LIT:U+0020>' + start_line.lstrip()<EOL>if Search(r'<STR_LIT>', start_line):  <EOL><INDENT>body_found = True<EOL>break                              <EOL><DEDENT>elif Search(r'<STR_LIT:{>', start_line):<EOL><INDENT>body_found = True<EOL>function = Search(r'<STR_LIT>', line).group(<NUM_LIT:1>)<EOL>if Match(r'<STR_LIT>', function):    <EOL><INDENT>parameter_regexp = Search(r'<STR_LIT>', joined_line)<EOL>if parameter_regexp:             <EOL><INDENT>function += parameter_regexp.group(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>function += '<STR_LIT>'<EOL><DEDENT>function_state.Begin(function)<EOL>break<EOL><DEDENT><DEDENT>if not body_found:<EOL><INDENT>error(filename, linenum, '<STR_LIT>', <NUM_LIT:5>,<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>elif Match(r'<STR_LIT>', line):  <EOL><INDENT>function_state.Check(error, filename, linenum)<EOL>function_state.End()<EOL><DEDENT>elif not Match(r'<STR_LIT>', line):<EOL><INDENT>function_state.Count()<EOL><DEDENT>
Reports for long function bodies.

    For an overview why this is done, see:
    https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions

    Uses a simplistic algorithm assuming other style guidelines
    (especially spacing) are followed.
    Only checks unindented functions, so class members are unchecked.
    Trivial bodies are unchecked, so constructors with huge initializer lists
    may be missed.
    Blank/comment lines are not counted so as to avoid encouraging the removal
    of vertical space and comments just to get through a lint check.
    NOLINT *on the last line of a function* disables this check.

    Args:
      filename: The name of the current file.
      clean_lines: A CleansedLines instance containing the file.
      linenum: The number of the line to check.
      function_state: Current function name and lines in body so far.
      error: The function to call with any errors found.