← every case

tokeigithub.com

measured at tokei 15.0.0 compiled with serialization support: json · downloaded from crates-io as tokei

What it fails

tokei.default.svgdoes not agree on 57 of 107 cases

1020-comment_then_code_then_comment ✗the line counts as a comment although there is code on it
1070-block_comment_closed_then_line_comment ✗the line counts as code, because it opens a block and does not end with that block's closer. Any number of blocks closed on one line ends the same way once a line comment follows them
1080-block_close_touching_a_line_comment ✗the line counts as code, for the reason case 1070 gives, and the shared byte adds nothing
1090-block_comment_closed_after_a_line_comment ✗the block is never closed, so the rest of the file counts as comment
1120-close_then_code_then_stray_and_reopen ✗a line that began inside a block is a comment, so the statement after the close is lost
1150-doc_comment_opening_after_code ✗the whole of the first line is given to the documentation, so the code in front of the doc marker is counted as a comment and lands in the Markdown block instead of in Rust
1180-cmake_bracket_comment ✗CMake has no bracket comment here, so the # opens a line comment that ends with its own line and the three lines under it count as code. A file holding no bare ]] at all counts the same way
1195-closer_sharing_a_byte_with_an_opener_in_the_text ✗the */ of assets/*/ does not close the comment, which runs on to the */ of the last line, so the code and the blank line between count as comments. With a space or a letter between the / and the */ the file reads right
1220-nested_block_comment_in_odin ✗the block is ended at the inner closer, so the two lines after it are counted as code
1230-a_comment_word_at_the_head_of_a_longer_word ✗a line whose first word begins with REM is taken as a comment whatever letters follow, so the command counts as one
1235-one_symbol_for_a_line_comment_and_a_string ✗the double quote at the head of the comment line opens a string, so that line counts as code. A file holding only that line counts as one line of code
1240-a_comment_opener_inside_a_vector_type ✗no <* *> pair is a comment to it, so both documentation comments count as code. The vector type costs it nothing, since the same file with int[<4>] comes out as ten code lines as well
1260-pod_closer_indented_inside_the_documentation ✗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
1280-matlab_block_markers_sharing_their_line ✗knows no MATLAB and counts every .m file as Objective-C, whose comments do not begin with %, so every line is code
2050-string_opening_after_block_close ✗the code after the closing */ is not seen, so the file is reported as holding no code at all
2062-template_hole_written_over_several_lines ✗the template is read as text from one backtick to the next, hole included, so the comment line inside the hole counts as code. With that line taken out the file is counted right
2064-template_inside_a_template_hole ✗the backticks pair off in order, hole or no hole, so the second one ends the outer template and the line inside the inner template counts as a comment. The file is counted the same with the ${ taken out
2072-verbatim_string_holding_a_doubled_quote ✗the verbatim string ends at the first quote of the first doubled pair and the second opens a plain string, in which the backslash escapes the quote after it, so that string closes on the first line, the two lines below count as comments and the lone quote on the fourth line opens a string that runs to the end of the file
2077-interpolation_hole_holding_the_strings_own_quote ✗the quote of the character in the hole ends the string, so the two lines below count as comments, and the real closing quote then opens a string that takes the real comment under it as code
2085-raw_string_ending_in_a_quote ✗the raw string closes at the first three of the four quotes, and the quote left over opens a string that takes the comment opener with it, so the comment's second line counts as code
2120-heredoc_holding_an_apostrophe ✗it reads no heredocs, so the apostrophe opens a string and every line under it is counted as code. Without the apostrophe the line beginning with # inside the heredoc counts as a comment
2125-operator_spelled_like_a_heredoc_opener ✗reads no heredoc in Ruby, so the apostrophe of it's on line 11 opens a string that runs to the end of the file, and the comment on line 15 counts as code
2127-heredoc_closing_word_indented_only_after_a_tilde_or_dash ✗reads no heredoc in Ruby, so the apostrophe of it's on line 3 opens a string that the one on line 11 closes. The blank line 7 inside it counts as code, and line 13, beginning with #, as a comment
2150-delimited_raw_string_names_its_own_closer ✗the delimited form is not recognised, so the four quotes of the opening line pair off as ordinary strings and the block opener under them opens a comment, which the block comment ending the file closes
2170-lua_level_bracket_holding_plain_close ✗its Lua carries only --[[ , so --[==[ reads as an ordinary -- line comment that ends with its own line and the three lines under it count as code. A file holding no bare ]] counts the same way
2180-lua_short_closer_hiding_the_real_one ✗its Lua carries only --[[ , so --[=[ reads as an ordinary -- line comment and the two lines under it count as code, whatever the closer is written like
2190-triple_quote_read_as_three_short_ones ✗an apostrophe does not open a string in Groovy, so the three apostrophes are code, the // below counts as a comment and the /* under it opens a block that nothing closes
2200-line_string_holding_a_comment_symbol_and_a_quote ✗its Zig carries no \\ string symbol, so the quote on line 3 opens a string that crosses lines and swallows both comments below it. With that quote taken out the file comes out right
3020-multiline_string_ending_in_backslash ✗its Odin has double and single quoted strings and no backtick one, so the // on line 3, inside the raw string, is read as a comment. The same /* comes out as code between double quotes and opens a comment between backticks
3070-backslash_before_a_closing_quote_in_sql ✗the backslash cancels the closing quote, and its strings cross lines, so the comment after the path is counted as string content
3080-backtick_escapes_inside_a_double_quoted_string ✗the backtick is no escape to it, so the last quote opens a string that crosses lines
3090-backtick_before_a_single_quoted_string ✗the apostrophe opens a string, and that form crosses lines, so everything after it is string
4010-char_literal_holding_a_quote ✗the quote opens a string, so the comment after it and the one under it are counted as code
4020-two_char_literals_holding_escapes ✗the quote inside '"' opens a string that is still open when the line ends, so the comment after it and every comment under it count as code. Without that character literal the line reads right
4030-character_written_with_a_backslash ✗line 2 sits inside the string opened on line 1 and begins with ;, and it is read as a comment. The string itself does run on: with plain text on that line the line comes out as code
4055-apostrophe_inside_a_comment ✗the double quote inside the character literal '"' opens a string that runs to the end of the file, so the three comment lines at the bottom count as code. With both apostrophes taken out the answer is the same
5030-line_splice_inside_a_comment ✗the comment ends at the newline, so the line joined to it is counted as code
5040-line_splice_in_a_comment_with_no_words ✗the comment ends at the newline, so the line joined to it is counted as code
5050-line_splice_after_a_closed_block_comment ✗two faults on one line, so it loses two. The line reads as code, which case 1070 holds on its own, and the splice does not carry, which case 5030 holds
5060-code_then_a_spliced_line_comment ✗the comment ends at the newline, so both lines joined to it are counted as code
5070-blank_line_inside_a_spliced_comment ✗the comment ends at the newline, so the empty line joined to it is counted as blank
6010-html_has_no_strings ✗the apostrophe opens a string, so the comment after it is counted as markup
6030-opening_tag_split_over_two_lines ✗the block is not found, so the comment inside it is read with the page's symbols, and HTML has no //
6040-script_tag_in_upper_case ✗the tag is not recognised, so the block is not found and the comment inside it counts as markup
6050-script_closer_written_with_a_space ✗the block is not found, so its line is counted as the page and not as JavaScript
6060-script_closer_inside_a_string ✗the closing line is counted once as markup and once as script, so the file is reported as one line longer than it is
6080-block_named_by_a_mime_type ✗the block is counted as JavaScript, although the mime type names TypeScript and their TypeScript is a language of its own
6090-vue_blocks_count_as_their_own_languages ✗the apostrophe of "it's" opens a string, and the template comment under it is counted as code
6100-block_language_named_by_the_tag ✗counts the same lines and calls the two blocks JavaScript and CSS, although each tag names its own language
6105-block_language_named_on_a_middle_line_of_the_tag ✗the block is found when its tag sits on one line and missed when the tag is split over four, so the comment inside it is read with Vue's own symbols, which count // as a comment. The totals come out right with no SCSS region
6110-php_block_holding_html_around_it ✗the file is read as php from beginning to end, so the html comment is counted as code
6115-php_closing_tag_on_the_closing_line_of_a_heredoc ✗the file is read as php from beginning to end, so the html comment is counted as code
6120-script_inside_html_inside_php ✗a php file never yields children, so the page that nests two levels deep in a markdown fence is counted flat here, everything php
7010-regex_literal_holding_a_quote ✗the quote opens a string that runs on, so the comment after it is counted as code
7020-regex_holding_a_comment_opener ✗the /* opens a comment that swallows the two lines under it, and the comment ending the file closes it
8040-doc_comment_with_no_text ✗the bare marker is counted blank, although a blank line inside a '/** */' doc comment of the same language counts as comment, so the answer turns on which of the two doc syntaxes was used
8050-doc_comment_with_no_text_ending_a_block ✗the '///' line is counted as neither comment nor blank, so a file of 3 lines is reported as 2

The rules it is judged by

default ruleset

code
anything-outside-spans-is-code
take the strings and the comments away and something is still there
code
a-string-is-code
part of the line is inside a string
comments
a-comment-alone-is-comments
part of the line is inside a comment
take the strings and the comments away and nothing is left but spaces
no part of the line is inside a string
blanks
blank-outside-everything-is-blank
the line is nothing but spaces and tabs
no part of the line is inside a comment
no part of the line is inside a string