← 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 40 of 84 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
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
1240-a_comment_opener_inside_a_vector_type ✗no <* *> pair is a comment to it, so the three documentation lines count as code. The vector type costs it nothing, since the same file with int[<4>] comes out as eight code lines as well
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
2120-heredoc_holding_an_apostrophe ✗the apostrophe opens a string and every comment under it is counted as code
2150-delimited_raw_string_names_its_own_closer ✗the delimited form is not recognised, so the two quotes on the opening line pair off as an ordinary string and the block opener under them, outside it, opens a comment. Without the lone quote the file comes out right
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
3070-backslash_before_a_closing_quote_in_sql ✗the backslash cancels the closing quote, and its strings cross lines, so the comment under 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 below it is string
4010-char_literal_holding_a_quote ✗the quote opens a string, so both comments under it are counted as code
4020-two_char_literals_holding_escapes ✗every comment under the line is lost
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 the line joined to it is 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 under 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
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
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 under it is counted as code
7020-regex_holding_a_comment_opener ✗the /* opens a comment and swallows the two lines under 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