← every case · 1000 · comments

1260-pod_closer_indented_inside_the_documentation

Perl's documentation, POD, runs from a line beginning with =pod down to a line beginning with =cut. This documentation shows a =cut as an example, indented, and Perl closes the block only at a =cut that starts its line, so the indented one is text and the block runs on to the real one. A counter that closes at any =cut reads the sentence under the example and the real =cut as code. The block opens with =pod, the one word every counter that reads POD knows, so the indented closer is the only thing the file asks about

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.pm
1codepackage Example;
2blanks
3comments=pod
4blanks
5commentsEnd every block of documentation with a line like this one:
6blanks
7comments =cut
8blanks
9commentsThe block above is an example, and this line is still documentation.
10blanks
11comments=cut
12blanks
13codesub run { return 1 }
14blanks
15code1;

stringcommentthe tag around another language

What each tool answered

cloc.default ✓ agrees
the rules ask15 lines · 7 blanks · 3 code · 5 comments
it answers15 lines · 7 blanks · 3 code · 5 comments

cloc --json --config /tmp/linejudge-empty-file cases/1000-comments/1260-pod_closer_indented_inside_the_documentation/input.pm

cloc.default ✓ agrees

--strip-str-comments

the rules ask15 lines · 7 blanks · 3 code · 5 comments
it answers15 lines · 7 blanks · 3 code · 5 comments

cloc --json --config /tmp/linejudge-empty-file cases/1000-comments/1260-pod_closer_indented_inside_the_documentation/input.pm --strip-str-comments

cloc.docstring-as-code ✓ agrees
the rules ask15 lines · 7 blanks · 3 code · 5 comments
it answers15 lines · 7 blanks · 3 code · 5 comments

cloc --json --config /tmp/linejudge-empty-file cases/1000-comments/1260-pod_closer_indented_inside_the_documentation/input.pm --docstring-as-code

codestats.default ✓ agrees
the rules ask15 lines · 7 blanks · 3 code · 5 comments
it answers15 lines · 7 blanks · 3 code · 5 comments

codestats cases/1000-comments/1260-pod_closer_indented_inside_the_documentation/input.pm --output json-compact --include-generated --no-gitignore --hidden --no-config

mezura.content ✓ agrees
the rules ask15 lines · 3 code · 5 comments · 7 extra
it answers15 lines · 3 code · 5 comments · 7 extra

mezura cases/1000-comments/1260-pod_closer_indented_inside_the_documentation/input.pm --output json --hide timing --no-default-config --no-local --counting content

mezura.region ✓ agrees
the rules ask15 lines · 3 blanks · 3 code · 9 comments
it answers15 lines · 3 blanks · 3 code · 9 comments

mezura cases/1000-comments/1260-pod_closer_indented_inside_the_documentation/input.pm --output json --hide timing --no-default-config --no-local --counting region

scc.default ✗ fails

the indented =cut of the example closes the documentation, so the sentence under it and the real =cut count as code. With that line written as plain text the file reads right

the rules ask15 lines · 3 blanks · 3 code · 9 comments
it answers15 lines · 5 blanks · 5 code · 5 comments

scc --format json --no-config cases/1000-comments/1260-pod_closer_indented_inside_the_documentation/input.pm

tokei.default ✗ fails

the indented =cut of the example closes the documentation, so the sentence under it and the real =cut count as code. With that line written as plain text the file reads right

the rules ask15 lines · 3 blanks · 3 code · 9 comments
it answers15 lines · 5 blanks · 5 code · 5 comments

tokei --output json cases/1000-comments/1260-pod_closer_indented_inside_the_documentation/input.pm