logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

countcode - counts per known source file type the number of source lines

Author

       This manual page was written with the help of help2man by Benda Xu <heroxbd@gentoo.org>, for  the  Debian
       GNU/Linux system.

caascore                                           2016-03-25                                       countcode(1)

Description

countcode  counts  per  known  source  file  type  the  number  of source lines in the files in the given
       directory and recursively in its subdirectories.  It supports many file types.  The  type  is  recognized
       from the file name extension or the shebang script type. Use -s to see all supported types.

       The following line types are counted:

         code:     pure code lines
         comment:  pure comment lines
         blank:    empty lines or lines containing whitespace only
         header:   the copyright header (leading comment lines)
         other:    all other lines

       Unless  -b is given, a pure code or comment line has to contain an alphanumeric character; e.g., a single
       } does not count as code line.  It calculates the percentage of code  and  comment  lines  in  the  total
       number  of  lines or (if -l is given) in the sum of code and comment lines.  Unless -t is given, files in
       test directories are counted separately.  Normal output is written on stdout; verbose on  stderr.   Files
       with  an unknown type are reported on stderr.  Note that -bt should give about the same results as a tool
       like cloc.

   positionalarguments:
       directory
              name of top directory to count source files (default is .)

   optionalarguments:-h, --help
              show this help message and exit

       -b, --basic
              count copyright header and lines without an alphanumeric character as code/comment lines

       -c, --code
              only use source files containing code (e.g. no .parset)

       -s, --sum
              only calculate and print the sum of all file types

       -l, --limitperc
              limit to the nr of code and comment lines to determine percentages

       -p PRINTLEVEL, --printlevel PRINTLEVEL
              first directory level to print (default 0 (=top))

       -d, --displaytypes
              display the currently recognized file types (full info with -v)

       -t, --testinclude
              do not count test directories separately

       -v, --verbose
              print count for each source file

Name

       countcode - counts per known source file type the number of source lines

Synopsis

countcode [-h] [-b] [-c] [-s] [-l] [-p PRINTLEVEL] [-d] [-t] [-v] [directory]

See Also