Cloc

Software Screenshot:
Cloc
Software Details:
Version: 1.62
Upload Date: 17 Feb 15
Developer: Al Danial
Distribution Type: Freeware
Downloads: 29

Rating: 3.0/5 (Total Votes: 1)

Cloc is an open source and cross-platform command-line software implemented in Perl and designed from the ground up to be used as a programming tool for counting blank lines, physical lines, as well as comment lines of a source code. It supports numerous programming languages.

The software is capable of reading language comment definitions, count code within compressed archives, offers several troubleshooting options, gathers results from multiple runs together by project and by language, and handles directory and file names with unusual characters or spaces.

Command-line options

The Cloc program offers a wide range of command-line options, which can be viewed at a glance by running the ‘cloc --help’ command in a terminal emulator. The commands are organized in various categories, such as input options, processing options, filter options, debug options, as well as output options.

Among the most interesting command-line options, we can mention the ability to report results for every source file, to process all the files that have a specific extension, to use custom langguage processing filters, as well as to ignore horizontal white space when comparing files.

Getting started with Cloc

As mentioned, Cloc is a very simple application that does not even require installation. To use it, simply download the latest version from Softoware using the dedicated download button on the right, save the archive on your computer, unpack it, open a terminal emulator app, navigate to the location of the extracted archive files (e.g. cd /home/softoware/cloc-1.62) and run the ‘cloc’ command.

Under the hood and supported operating systems

Taking a look under the hood of Cloc, we can notice that the software is written entirely in the Perl programming langauge and it is a supported under GNU/Linux, Solaris, AIX, z/OS, IRIX64, and Microsoft Windows operating systems. Both 32-bit (x86) and 64-bit (x86_64) hardware architectures are supported at this time.

What is new in this release:

  • New Languages:
  • CUDA
  • ECPP
  • Grails
  • Haml
  • Handlebars
  • Harbour
  • HLSL
  • JSON
  • Kotlin
  • Mustache
  • PL/I
  • Puppet manifest
  • Racket
  • Rake
  • RobotFramework
  • Swift
  • TypeScript
  • Unity-Prefab
  • Velocity Template Language
  • Windows Message
  • Windows Module Definition
  • Windows Resource
  • WiX include
  • WiX source
  • WiX string localization
  • xBase
  • xBase Header
  • XQuery
  • Updates:
  • JSP Added extension .jspf
  • MSBuild script Added extensions .vcproj, .wixproj, .vbproj
  • DOS Batch Added extensions .cmd, .btm
  • C++ Added extension .c++
  • Pascal Lines that begin with {! are counted as code as some compilers treat these as a compiler directives.
  • Lisp Treat text between #| and |# as a block comment.
  • Suppress progress rate display if --quiet is set.
  • --exclude-dir directories are pruned before the file search descends into those directories instead of just ignoring files there
  • The logic that aligns file pairs between --diff sets was rewritten. Corner cases such as diff between one file and a set of files are handled much more precisely.
  • New options and features:
  • --explain=LANG Print the filters used to remove comments for language LANG and exit. In some cases the filters refer to Perl subroutines rather than regular expressions. An examination of the source code may be needed for further explanation.
  • Added new filter macros:
  • remove_between_general, which accepts start and end comment marker.
  • remove_between_regex, which accepts start and end comment regexes.
  • Properly handle text files that begin with Unicode Byte Order Marks.
  • Bug Fixes:
  • Remove spurious newlines produced by bad comment removal regexes
  • which could cause incorrect diff's.
  • Correctly handle file extensions with non-alphanumeric characters.
  • Show file count with --sum-reports.
  • Properly encode characters &,,",' in XML output.
  • Properly read and write entries for the 'remove_between_general'
  • macro in language definition text files.

What is new in version 1.60:

  • This version adds support for LESS, Razor, JavaServer Faces, SASS, Apex Trigger, Visualforce Component, Visualforce Page, Verilog-SystemVerilog, and Pig Latin.
  • Language filters for MXML, CMake, Groovy, and Vala were improved.
  • An undefined array reference error was corrected.

What is new in version 1.54:

  • Release Notes for cloc version 1.54 http://cloc.sourceforge.net October 1, 2011
  • New Languages:
  • CMake
  • Cython
  • Objective C++
  • Ocaml
  • Smarty
  • New options and features:
  • --autoconf
  • Count files of recognized languages that end with ".in" (for example, code.h.in, Makefile.in) as used by GNU automake/autoconf.
  • --match-d, --not-match-d
  • Include, or skip over, directories whose names match provided regular expressions.
  • --follow-links
  • Follow symbolic links (on Unix-like OS's).
  • YAML and XML output: header lines now include the cloc URL,
  • version, # lines and files counted, etc.
  • YAML and XML output: if writing to a file (rather than STDOUT),
  • save the file name as an element inside the file.
  • Include support for languages with double extensions. First
  • implementation of these uses .spc.sql for SQL Stored Procedures
  • and .data.sql as SQL Data as distinct from just SQL.
  • Handle archive files (tar files, zip files, etc) with spaces
  • in their names.
  • Bug Fixes:
  • Lisp: Include .lisp as a valid file extension.
  • Correctly identify operating system as Windows if MKS Toolkit is
  • installed.
  • Fix incorrectly handled .inc files (could be PHP or Pascal).
  • --counted
  • Correct output to show only files which were actually used to produce the code count. Also show the output by language rather than by filename.
  • --diff
  • Fixed null output when one input has a single file while the comparison input has multiple files.
  • Fixed null output when no lines of code are modified in common files (only entire files were added or removed).
  • Handle cases where one of the two inputs is an empty file or directory.
  • --diff + --exclude-file-list
  • --diff now skips files defined by --exclude-file-list
  • --diff + --exclude-lang
  • --diff now skips languages defined by --exclude-lang
  • --diff + --xml
  • Include user-provided xsl file name in XML --diff output.
  • XML output for --by-file and --by-file-by-lang.
  • --diff + --csv
  • Added comma separated value output for --diff.
  • --diff + --sum-reports
  • Can now use the --sum-reports option with --diff.
  • --exclude-dir
  • Quote metacharacters when comparing directory names against
  • --exclude-dir value.
  • --strip-comments
  • Do not remove blank lines if they follow lines with (language-dependent) continuation markers.
  • --sum-reports + --list-file
  • Allow the --sum-reports option to take its inputs from files defined by --list-file
  • Outstanding issues:
  • --sql output formats remain unimplemented for --diff.

What is new in version 1.53:

  • This version adds support for Go and MXML, improves XML/XSLT output, and includes bug fixes for the --diff option.

What is new in version 1.52:

  • This release adds support for Groovy, Scala, and XAML, improves the counters for Fortran and COBOL, and adds new options for ignoring whitespace when computing diffs and excluding files with given extensions. Several minor bugs in the diff option were also fixed.

What is new in version 1.07:

  • This release adds support for the VHDL language and improves the filter that distinguishes between MATLAB, MUMPS, and Objective C files.
  • Additionally, the tool now processes archive files directly on Unix-like operating systems.
  • One can issue, for example, "cloc perl-5.10.0.tar.gz" to count code within this compressed tar file.

What is new in version 1.05:

  • New languages: ActionScript, D.
  • New options: --skip-uniqueness, --original-dir, --match-f, --not-match-f Python triple quoted strings now treated as comments.
  • JSP is now also processed with C/C++ filters.
  • Exit (instead of warn and continue) if incorrect options are given.
  • Fixed a bug in the duplicate file identifying code.
  • Previous versions counted duplicate files twice.
  • Fix output column alignment when working with long file names or languages.

Requirements:

  • Perl

Similar Software

CLText
CLText

14 Apr 15

LyX
LyX

22 Jun 18

Comments to Cloc

Comments not found
Add Comment
Turn on images!