Showing preview only (3,381K chars total). Download the full file or copy to clipboard to get everything.
Repository: AlDanial/cloc
Branch: master
Commit: 26f78e2f1443
Files: 1027
Total size: 3.1 MB
Directory structure:
gitextract_92_lc_1g/
├── .devcontainer/
│ ├── Dockerfile
│ └── devcontainer.json
├── .dockerignore
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── report-a-bug.md
│ │ └── request-an-enhancement.md
│ └── workflows/
│ ├── build.yml
│ ├── release-ready.yml
│ └── release-staging.yml
├── .gitignore
├── .vscode/
│ └── launch.json
├── Dockerfile
├── Dockerfile.build
├── LICENSE
├── README.md
├── Unix/
│ ├── AUTHORS
│ ├── COPYING
│ ├── INSTALL
│ ├── Makefile
│ ├── NEWS
│ ├── README
│ ├── cloc
│ ├── cloc.1.pod
│ ├── pod2man.mk
│ ├── t/
│ │ ├── 00_C.t
│ │ ├── 01_opts.t
│ │ └── 02_git.t
│ └── why_this_directory_exists.txt
├── cloc
├── sqlite_formatter
└── tests/
├── README
├── inputs/
│ ├── 955.bpmn
│ ├── 955.hbm.xml
│ ├── 955.jrxml
│ ├── 955.lb.xml
│ ├── 955.tld
│ ├── AnsProlog.lp
│ ├── Application_Data_Test.feature.cs
│ ├── Arturo.art
│ ├── Assembler-Intel.asm
│ ├── Assembly-sysv.S
│ ├── BUILD
│ ├── BasicPlane.Figures-Rectangle.ixx
│ ├── BoxWidget.ui
│ ├── Buchberger.cocoa5
│ ├── C#.cs
│ ├── C++-MFC.cc
│ ├── C++-uppercase.CPP
│ ├── C-Ansi.c
│ ├── C.g4
│ ├── ChangeProperties.il
│ ├── Chapel.chpl
│ ├── Cobol.cbl
│ ├── CodeQL.ql
│ ├── ColdFusion.cfm
│ ├── Combinators.idr
│ ├── Containerfile
│ ├── Counter.razor
│ ├── DIEnumerator-10.0.ll
│ ├── DocTest.thrift
│ ├── Dockerfile
│ ├── ERC20.cairo
│ ├── ExprParser.g
│ ├── FOCUS.focexec
│ ├── Fortran77.f
│ ├── Fortran90.f90
│ ├── FreemarkerTemplate.ftl
│ ├── GamePanel.tscn
│ ├── Gencat-NLS.msg
│ ├── Haskell.hs
│ ├── Hello.lidr
│ ├── HelpersView.axaml
│ ├── IDL.idl
│ ├── ItemView.vue
│ ├── Java.java
│ ├── JetCar.cls
│ ├── LaTeX.tex
│ ├── Lanczos.m
│ ├── LogMain.re
│ ├── Lookup.agda
│ ├── MSDOS.bat
│ ├── Makefile
│ ├── Mako.mako
│ ├── Mathematica_1.m
│ ├── Mathematica_2.wlt
│ ├── Mojo.mojom
│ ├── Mumps.mps
│ ├── Octave.m
│ ├── Once.HC
│ ├── Pascal.p
│ ├── Pascal.pas
│ ├── Pascal.pp
│ ├── PlusCalExample.tla
│ ├── Prelude.dhall
│ ├── ProcessPO.odx
│ ├── RedBlackTree.res
│ ├── RemoteSiteHelperTest.cls
│ ├── RenderTest.metal
│ ├── Rounds.scad
│ ├── Sample.mc
│ ├── SimpleODE.mo
│ ├── Slim.html.slim
│ ├── Slint-helloworld.slint
│ ├── Snakefile
│ ├── Splice.hs-boot
│ ├── Sys.hx
│ ├── TLAExample.tla
│ ├── TableGen-ARM.td
│ ├── Test.daml
│ ├── Tk
│ ├── Trapezoid_Rule.ipynb
│ ├── TypeScript.ts
│ ├── TypeScript_2.ts
│ ├── USS.uss
│ ├── UXML.uxml
│ ├── X++.xpo
│ ├── XML.xml
│ ├── XSL-FO.xsl
│ ├── XSLT.xslt
│ ├── XmlToJSONSendPipeline.btp
│ ├── Xtend.xtend
│ ├── ZosMsg.mc
│ ├── ZosNet.rc
│ ├── ZosNp.def
│ ├── aa/
│ │ └── bb/
│ │ └── cc/
│ │ └── plasma.c
│ ├── acpclust.R
│ ├── apertium-dan.dan.rlx
│ ├── args.janet
│ ├── arvo.hoon
│ ├── asciidoctor.adoc
│ ├── assembly.cs
│ ├── basic.luau
│ ├── basic.p4
│ ├── bbf-device.yang
│ ├── beluga.bel
│ ├── birds.pro
│ ├── blur.glsl
│ ├── body.gjs
│ ├── bubs_tak_ard.prc
│ ├── build.bzl
│ ├── build.cake
│ ├── cad.asy
│ ├── cadence_test.cdc
│ ├── captcha.cs
│ ├── capture.ecr
│ ├── certificates.sls
│ ├── ch10-REPL-oriented-repl-interactions.cj
│ ├── chat.st
│ ├── child_template.jinja2
│ ├── child_template.njk
│ ├── clarityfiles.clar
│ ├── class.imba
│ ├── cli-args.nf
│ ├── cloc-dev.code-workspace
│ ├── cloc_counts.csv
│ ├── clusterConf.ttcn
│ ├── comments.rhai
│ ├── comments_in_str.svelte
│ ├── comp.ecpp
│ ├── complex_union.derw
│ ├── conditions.CBL
│ ├── config.junos
│ ├── cpp-example.inc
│ ├── cross-platform.just
│ ├── csharp-designer.designer.cs
│ ├── cucumber.feature
│ ├── custom.triple.extension.js
│ ├── darwin-configuration.nix
│ ├── dd/
│ │ └── bb/
│ │ ├── cc/
│ │ │ └── MoreTeapotsRenderer.cpp
│ │ ├── config.c
│ │ └── ee/
│ │ └── TeapotRenderer.cpp
│ ├── demo.odin
│ ├── dev.exs
│ ├── diff/
│ │ ├── A/
│ │ │ ├── d1/
│ │ │ │ └── hello.f90
│ │ │ ├── d2/
│ │ │ │ ├── hello.java
│ │ │ │ └── hi.py
│ │ │ └── hello.C
│ │ └── B/
│ │ ├── d1/
│ │ │ └── hello.f90
│ │ ├── d2/
│ │ │ └── hi.py
│ │ ├── extra_file.pl
│ │ └── hello.C
│ ├── dlist.lean
│ ├── door.tres
│ ├── dotNET_intermediate.il
│ ├── double_doors.dsc
│ ├── drools.drl
│ ├── drupal.mxml
│ ├── eddsa.circom
│ ├── elixir.ex
│ ├── en_AU.po
│ ├── example_2d.gdshader
│ ├── fib.dfy
│ ├── fib_class.pkl
│ ├── fibonacci.ncl
│ ├── find.plm
│ ├── flatbuffers.fbs
│ ├── fmt.ha
│ ├── foo_bar/
│ │ ├── bar/
│ │ │ └── foo/
│ │ │ └── momo/
│ │ │ └── tbfm.sh
│ │ └── foo/
│ │ └── bar/
│ │ └── lala/
│ │ └── tfbl.sh
│ ├── fortran.inc
│ ├── fractal.um
│ ├── fsharp.fs
│ ├── fsharp_script.fsx
│ ├── functional.cj
│ ├── futhark.fut
│ ├── generate.fnl
│ ├── git_helpers.fish
│ ├── github_user.aria
│ ├── glade-search-popover.ui
│ ├── glossary.json
│ ├── glossary.json5
│ ├── gnureadline.vala
│ ├── graphql.gql
│ ├── greeter.tsx
│ ├── groovy_triple.gvy
│ ├── guard_talking.yarn
│ ├── guestbook.tpl
│ ├── hanoi.inc
│ ├── harbour_xbase.prg
│ ├── hello.C
│ ├── hello.bf
│ ├── hello.f
│ ├── hello.f90
│ ├── hello.java
│ ├── hello.kt
│ ├── hello.lua
│ ├── hello.pas
│ ├── hello.pl1
│ ├── hello.sp
│ ├── hello1.pas
│ ├── hello_1.0.bb
│ ├── hello_app.go
│ ├── hello_app.ʕ◔ϖ◔ʔ
│ ├── hello_app_autogen.go
│ ├── hello_app_autogen.ʕ◔ϖ◔ʔ
│ ├── helloworld.raml
│ ├── hi.mojo
│ ├── hi.py
│ ├── htlc.teal
│ ├── html_heex_example.heex
│ ├── i18n_de.ts
│ ├── iclean.icl
│ ├── idris_block_comments.idr
│ ├── igorpro.ipf
│ ├── includes_demo.mustache
│ ├── inner_ref.jsonnet
│ ├── input.gts
│ ├── insertJournalEntry.ipl
│ ├── invoices.prql
│ ├── io.c3
│ ├── issue_875.bdy
│ ├── issue_876.vue
│ ├── issues/
│ │ ├── 114/
│ │ │ ├── bar/
│ │ │ │ ├── bee/
│ │ │ │ │ └── inner_most.js
│ │ │ │ └── under_Bar.js
│ │ │ └── foo/
│ │ │ └── under_foo.js
│ │ ├── 131/
│ │ │ ├── README
│ │ │ └── hi.py
│ │ ├── 132/
│ │ │ ├── .gitignore
│ │ │ ├── C-Ansi.c
│ │ │ ├── README
│ │ │ └── ignore_dir/
│ │ │ └── Fortran77.f
│ │ ├── 166/
│ │ │ ├── X
│ │ │ └── fake.thy
│ │ ├── 183/
│ │ │ ├── eval1957.SACunidir.fr
│ │ │ └── file.fth
│ │ ├── 245/
│ │ │ └── complex_regular_subexpression.scala
│ │ ├── 280/
│ │ │ ├── L/
│ │ │ │ └── hello_1.c
│ │ │ └── R/
│ │ │ └── hello_2.c
│ │ ├── 286/
│ │ │ └── project/
│ │ │ ├── ignore_subdir/
│ │ │ │ └── test.py
│ │ │ └── read_subdir/
│ │ │ └── hi.c
│ │ ├── 296/
│ │ │ ├── Lanczos.m
│ │ │ ├── Mathematica_1.m
│ │ │ ├── Octave.m
│ │ │ ├── hello.lua
│ │ │ ├── nested.lua
│ │ │ └── qsort_demo.m
│ │ ├── 312/
│ │ │ └── sam #ple.py
│ │ ├── 318/
│ │ │ ├── Rcs.yaml
│ │ │ └── Réponse.cs
│ │ ├── 327/
│ │ │ ├── example.smarty2
│ │ │ └── lang.config
│ │ ├── 341/
│ │ │ ├── cItems.cls
│ │ │ └── thesis.cls
│ │ ├── 350/
│ │ │ └── fs.go
│ │ ├── 365/
│ │ │ └── RSpecTests.java
│ │ ├── 370/
│ │ │ └── arduino_issue_370.ino
│ │ ├── 375/
│ │ │ └── docstring.py
│ │ ├── 378/
│ │ │ └── git_script.sh
│ │ ├── 380/
│ │ │ └── wrapper.pl
│ │ ├── 381/
│ │ │ ├── issue381.c
│ │ │ └── issue381.java
│ │ ├── 386/
│ │ │ └── make_386_repo.sh
│ │ ├── 405/
│ │ │ └── globs.py
│ │ ├── 407/
│ │ │ ├── count_dir/
│ │ │ │ ├── C-Ansi.c
│ │ │ │ └── Test/
│ │ │ │ └── Java.java
│ │ │ ├── level2/
│ │ │ │ ├── Java.java
│ │ │ │ └── level/
│ │ │ │ └── Test/
│ │ │ │ ├── C-Ansi.c
│ │ │ │ └── level2/
│ │ │ │ └── hi.py
│ │ │ └── linked_dir/
│ │ │ └── hello.f
│ │ ├── 408/
│ │ │ └── badly_named_ruby.pl
│ │ ├── 420/
│ │ │ └── mixed_case_ext.Pl
│ │ ├── 433/
│ │ │ └── excl.txt
│ │ ├── 454/
│ │ │ └── createServer.js
│ │ ├── 455/
│ │ │ ├── list.txt
│ │ │ └── list_align.txt
│ │ ├── 456/
│ │ │ ├── XML_no_ext
│ │ │ └── XML_weird_ext.profile
│ │ ├── 463/
│ │ │ ├── left.C
│ │ │ └── right.C
│ │ ├── 472/
│ │ │ ├── lua_def.txt
│ │ │ └── not_really.lua
│ │ ├── 476/
│ │ │ ├── A/
│ │ │ │ ├── bye.C
│ │ │ │ ├── bye.f90
│ │ │ │ ├── hello.C
│ │ │ │ └── hello.f90
│ │ │ └── B/
│ │ │ ├── bye.f90
│ │ │ ├── hello.C
│ │ │ ├── hello.f90
│ │ │ └── yo.C
│ │ ├── 482/
│ │ │ └── A/
│ │ │ ├── C-Ansi.c
│ │ │ ├── hi.py
│ │ │ └── temp.c
│ │ ├── 494/
│ │ │ ├── P_EDI_Book.sql
│ │ │ └── P_EDI_BookF8.sql
│ │ ├── 502/
│ │ │ ├── FileCounter20200715140433.txt
│ │ │ └── Điếm LOC/
│ │ │ └── P_EDI_Book.sql
│ │ ├── 513/
│ │ │ ├── L/
│ │ │ │ └── empty.c
│ │ │ └── diff_list.txt
│ │ ├── 520/
│ │ │ └── julia_docstr.jl
│ │ ├── 521/
│ │ │ ├── Test 188/
│ │ │ │ ├── Test1.sql
│ │ │ │ └── UP0PB.sql
│ │ │ └── Test188New/
│ │ │ └── Test 188/
│ │ │ ├── Test1.sql
│ │ │ └── UP0PB.sql
│ │ ├── 528/
│ │ │ ├── Fortran77.f
│ │ │ ├── Lanczos.m
│ │ │ ├── Mathematica_1.m
│ │ │ ├── Octave.m
│ │ │ ├── hello.C
│ │ │ ├── hello.f
│ │ │ ├── matlab_line_colors.m
│ │ │ └── qsort_demo.m
│ │ ├── 530/
│ │ │ └── C-Ansi.c
│ │ ├── 537/
│ │ │ ├── my_define.txt
│ │ │ └── sourceCounter.vsql
│ │ ├── 538/
│ │ │ └── add.elm
│ │ ├── 539/
│ │ │ └── nested_comments.elm
│ │ ├── 540/
│ │ │ └── Hello.f
│ │ ├── 542/
│ │ │ └── txt_lang_def.txtt
│ │ ├── 577/
│ │ │ ├── diff_list_file.txt
│ │ │ ├── options.txt
│ │ │ ├── tour.swift
│ │ │ └── tour2.swift
│ │ ├── 579/
│ │ │ └── csharp-autogen.cs
│ │ ├── 580/
│ │ │ └── encodingtest.cs
│ │ ├── 596/
│ │ │ ├── def.txt
│ │ │ └── hello.C
│ │ ├── 597/
│ │ │ └── hello.C
│ │ ├── 606/
│ │ │ └── in/
│ │ │ └── nomad_job.hcl
│ │ ├── 611/
│ │ │ └── cmakelists.txt
│ │ ├── 613/
│ │ │ └── nav.scss
│ │ ├── 619/
│ │ │ └── RA.s
│ │ ├── 625/
│ │ │ ├── new/
│ │ │ │ └── hello.C
│ │ │ └── old/
│ │ │ └── .gitignore
│ │ ├── 628/
│ │ │ └── sample.graphql
│ │ ├── 644/
│ │ │ └── UInt8.cs
│ │ ├── 657/
│ │ │ ├── C-Ansi.c
│ │ │ ├── extra/
│ │ │ │ └── Mathematica_1.m
│ │ │ └── hello.f
│ │ ├── 670/
│ │ │ ├── hello.C
│ │ │ └── hi.py
│ │ ├── 692/
│ │ │ ├── A.txt
│ │ │ └── B.txt
│ │ ├── 701/
│ │ │ └── demo.ml
│ │ ├── 710/
│ │ │ ├── A/
│ │ │ │ ├── cal.data
│ │ │ │ └── hello.C
│ │ │ ├── B/
│ │ │ │ └── hello.C
│ │ │ └── test_files.list
│ │ ├── 712/
│ │ │ ├── dir1/
│ │ │ │ ├── main.c
│ │ │ │ └── sub_dir1/
│ │ │ │ └── foo.txt
│ │ │ └── dir2/
│ │ │ ├── foo.txt
│ │ │ └── main.c
│ │ ├── 713/
│ │ │ └── hello.C
│ │ ├── 720/
│ │ │ └── inputs.txt
│ │ ├── 722/
│ │ │ ├── Fortran77.f
│ │ │ ├── hello.f90
│ │ │ └── hello.lua
│ │ ├── 735/
│ │ │ └── excludes.txt
│ │ ├── 753/
│ │ │ ├── Application_Data_Test.feature.cs
│ │ │ ├── assembly.cs
│ │ │ └── csharp-designer.designer.cs
│ │ ├── 781/
│ │ │ ├── fortran.inc
│ │ │ ├── pascal.inc
│ │ │ └── test1.inc
│ │ ├── 784/
│ │ │ ├── .cloc-ignore
│ │ │ └── src/
│ │ │ └── net/
│ │ │ └── companies/
│ │ │ ├── assembly.cs
│ │ │ └── captcha.cs
│ │ ├── 785/
│ │ │ ├── (dir)/
│ │ │ │ └── test.svelte
│ │ │ ├── .cloc-ignore
│ │ │ └── ok/
│ │ │ └── ok.sh
│ │ ├── 804/
│ │ │ └── infoSQL.java
│ │ ├── 805/
│ │ │ └── text_block.java
│ │ ├── 806/
│ │ │ └── huffman.java
│ │ ├── 811/
│ │ │ └── inline_comment.xml
│ │ ├── 816/
│ │ │ └── star_slash_star.go
│ │ ├── 822/
│ │ │ ├── a/
│ │ │ │ └── b/
│ │ │ │ └── c.csv
│ │ │ └── a.csv
│ │ ├── 833/
│ │ │ └── Developer/
│ │ │ ├── abc.txt
│ │ │ └── clocTest/
│ │ │ └── foo/
│ │ │ ├── bar/
│ │ │ │ └── bar.swift
│ │ │ └── foo.swift
│ │ ├── 851/
│ │ │ └── level_1/
│ │ │ ├── flatbuffers.fbs
│ │ │ ├── hello.lua
│ │ │ └── level_2/
│ │ │ └── hello_2.lua
│ │ ├── 862/
│ │ │ ├── Fortran77.f
│ │ │ ├── a.py
│ │ │ ├── b.py
│ │ │ └── hello.c
│ │ ├── 898/
│ │ │ ├── irregular'file.md
│ │ │ └── regular.md
│ │ └── 906/
│ │ ├── current_version.py
│ │ └── previous_version.py
│ ├── julia.jl
│ ├── just_stuff.haml
│ ├── kvlang.kv
│ ├── layer.conf
│ ├── layout.dt
│ ├── linker.ld
│ ├── locale_facets.h
│ ├── logos.x
│ ├── logos.xm
│ ├── logtalk.lgt
│ ├── machineDefFreshIds.lem
│ ├── magikfile.magik
│ ├── main.f03
│ ├── master.blade.php
│ ├── matlab_line_colors.m
│ ├── md5.rkt
│ ├── meson.build
│ ├── messages.rb
│ ├── mfile.mk
│ ├── modules1-func1.pp
│ ├── modules1-func2.pp
│ ├── modules1-ntp1.pp
│ ├── modules1-typealias.pp
│ ├── moonbit.mbt
│ ├── moonbit.mbti
│ ├── nested.lua
│ ├── nomad_job.hcl
│ ├── notes.typ
│ ├── nu-example.nu
│ ├── nuon-example.nuon
│ ├── offline.jcl
│ ├── openharmony.ets
│ ├── orgmode.org
│ ├── page_layout.aspx
│ ├── pages.wxml
│ ├── pages.wxss
│ ├── parser_1.civet
│ ├── parser_2.civet
│ ├── pascal.inc
│ ├── pek_example.pek
│ ├── ping_pong.lfe
│ ├── plain_text.txt
│ ├── plantuml.puml
│ ├── pointillism.pde
│ ├── poly_constructor.jai
│ ├── pop_by_country.xq
│ ├── prob060-andreoss.p6
│ ├── proguard-project-app.pro
│ ├── qsort_demo.m
│ ├── queue.p
│ ├── rand.apl
│ ├── ranges.surql
│ ├── razor.cshtml
│ ├── reStructuredText.rst
│ ├── reactive.svelte
│ ├── regex_limit.gradle
│ ├── ring.pony
│ ├── robotframework.robot
│ ├── robotframework.tsv
│ ├── roku.brs
│ ├── rules.sss
│ ├── sample.R
│ ├── sample.bicep
│ ├── sample.ejs
│ ├── schema.prisma
│ ├── scheme.sls
│ ├── script1-hadoop.pig
│ ├── sdp_parser.jspeg
│ ├── sdp_parser.peg
│ ├── sdp_parser.peggy
│ ├── sdp_parser.pegjs
│ ├── sdp_parser.tspeg
│ ├── send_msg.applescript
│ ├── server_side.aspx
│ ├── sharpsign.cl
│ ├── slug.astro
│ ├── solidity.sol
│ ├── specman_e.e
│ ├── specman_e2.e
│ ├── squirrel_table.nut
│ ├── stata.do
│ ├── statcsv.nim
│ ├── streamlines.pro
│ ├── string.gleam
│ ├── style.scss
│ ├── swig_example.i
│ ├── temp.c
│ ├── templ_example.templ
│ ├── test-1.0-py2.py3-none-win32.whl
│ ├── test.Dsr
│ ├── test.Rmd
│ ├── test.hs
│ ├── test.rego
│ ├── test.vbhtml
│ ├── test.vbs
│ ├── test1.inc
│ ├── test1.lhs
│ ├── test1.php
│ ├── test2.lhs
│ ├── test_w_cpp_comments.svelte
│ ├── tictactoe3d.ring
│ ├── tnsdl.sdl
│ ├── toml.pest
│ ├── toml_example.toml
│ ├── tour.swift
│ ├── traffic_light.fsl
│ ├── triple_lang_def.txt
│ ├── type.wast
│ ├── updateSprites.wgsl
│ ├── utilities.R
│ ├── variable_length.carbon
│ ├── vba_test.vba
│ ├── vbnet_test.vb
│ ├── vbox.fxml
│ ├── verilog.sv
│ ├── vinos.nlogo
│ ├── vs_solution.sln
│ ├── vtl.vm
│ ├── vyper.vy
│ ├── warship.ts
│ ├── webservice.wsdl
│ ├── wiki.properties
│ ├── window.blp
│ ├── with_pod.pl
│ ├── wokka.cbl
│ ├── wokka.cs
│ ├── wpedia.ini
│ ├── x.mustache
│ ├── xattr.conf
│ ├── zir_sema.zig
│ └── zos_assembly.s
├── make_git_repo.bash
└── outputs/
├── 00_C.yaml
├── 955.bpmn.yaml
├── 955.hbm.xml.yaml
├── 955.jrxml.yaml
├── 955.lb.xml.yaml
├── 955.tld.yaml
├── AnsProlog.lp.yaml
├── Arturo.art.yaml
├── Assembler-Intel.asm.yaml
├── Assembly-sysv.S.yaml
├── BUILD.yaml
├── BasicPlane.Figures-Rectangle.ixx.yaml
├── BoxWidget.ui.yaml
├── Buchberger.cocoa5.yaml
├── C#.cs.yaml
├── C++-MFC.cc.yaml
├── C++-uppercase.CPP.yaml
├── C-Ansi.c.yaml
├── C.g4.yaml
├── ChangeProperties.il.yaml
├── Chapel.chpl.yaml
├── Cobol.cbl.yaml
├── CodeQL.ql.yaml
├── ColdFusion.cfm.yaml
├── Combinators.idr.yaml
├── Containerfile.yaml
├── Counter.razor.yaml
├── DIEnumerator-10.0.ll.yaml
├── DocTest.thrift.yaml
├── Dockerfile.yaml
├── ERC20.cairo.yaml
├── ExprParser.g.yaml
├── FOCUS.focexec.yaml
├── Fortran77.f.yaml
├── Fortran90.f90.yaml
├── FreemarkerTemplate.ftl.yaml
├── GamePanel.tscn.yaml
├── Gencat-NLS.msg.yaml
├── Haskell.hs.yaml
├── Hello.lidr.yaml
├── HelpersView.axaml.yaml
├── IDL.idl.yaml
├── ItemView.vue.yaml
├── Java.java.yaml
├── JetCar.cls.yaml
├── LaTeX.tex.yaml
├── Lanczos.m.yaml
├── LogMain.re.yaml
├── Lookup.agda.yaml
├── MSDOS.bat.yaml
├── Makefile.yaml
├── Mako.mako.yaml
├── Mathematica_1.m.yaml
├── Mathematica_2.wlt.yaml
├── Mojo.mojom.yaml
├── Mumps.mps.yaml
├── Octave.m.yaml
├── Once.HC.yaml
├── Pascal.pas.yaml
├── Pascal.pp.yaml
├── PlusCalExample-no-autogen.tla.yaml
├── PlusCalExample.tla.yaml
├── Prelude.dhall.yaml
├── ProcessPO.odx.yaml
├── RedBlackTree.res.yaml
├── RemoteSiteHelperTest.cls.yaml
├── RenderTest.metal.yaml
├── Rounds.scad.yaml
├── SVG_logo.svg.yaml
├── Sample.mc.yaml
├── SimpleODE.mo.yaml
├── Slim.html.slim.yaml
├── Slint-helloworld.slint.yaml
├── Snakefile.yaml
├── Splice.hs-boot.yaml
├── Sys.hx.yaml
├── TLAExample.tla.yaml
├── TableGen-ARM.yaml
├── Test.daml.yaml
├── Tk.yaml
├── Trapezoid_Rule.ipynb.yaml
├── TypeScript.ts.yaml
├── TypeScript_2.ts.yaml
├── USS.uss.yaml
├── UXML.uxml.yaml
├── X++.xpo.yaml
├── XML.xml.yaml
├── XSL-FO.xsl.yaml
├── XSLT.xslt.yaml
├── XmlToJSONSendPipeline.btp.yaml
├── Xtend.xtend.yaml
├── ZosMsg.mc.yaml
├── ZosNet.rc.yaml
├── ZosNp.def.yaml
├── aa.yaml
├── acpclust.R.yaml
├── apertium-dan.dan.rlx.yaml
├── args.janet.yaml
├── arvo.hoon.yaml
├── asciidoctor.adoc.yaml
├── assembly.cs.yaml
├── basic.luau.yaml
├── basic.p4.yaml
├── bbf-device.yang.yaml
├── beluga.bel.yaml
├── birds.pro.yaml
├── bitbake.yaml
├── blur.glsl.yaml
├── body.gjs.yaml
├── bubs_tak_ard.prc.yaml
├── build.bzl.yaml
├── build.cake.yaml
├── cad.asy.yaml
├── cadence_test.cdc.yaml
├── captcha.cs.yaml
├── capture.ecr.yaml
├── certificates.sls.yaml
├── ch10-REPL-oriented-repl-interactions.cj.yaml
├── chat.st.yaml
├── child_template.jinja2.yaml
├── child_template.njk.yaml
├── clarityfiles.clar.yaml
├── class.imba.yaml
├── cli-args.nf.yaml
├── cloc-dev.code-workspace.yaml
├── cloc_counts.csv.yaml
├── clusterConf.ttcn.yaml
├── comments.rhai.yaml
├── comments_in_str.svelte.yaml
├── comp.ecpp.yaml
├── complex_union.derw.yaml
├── conditions.CBL.yaml
├── config.junos.yaml
├── cross-platform.just.yaml
├── csharp-designer.designer.cs.yaml
├── cucumber.feature.yaml
├── custom.triple.extension.js.yaml
├── darwin-configuration.nix.yaml
├── dd.yaml
├── demo.odin.yaml
├── dev.exs.yaml
├── dlist.lean.yaml
├── door.tres.yaml
├── dotNET_intermediate.il.yaml
├── double_doors.dsc.yaml
├── drools.drl.yaml
├── drupal.mxml.yaml
├── eddsa.circom.yaml
├── elixir.ex.yaml
├── en_AU.po.yaml
├── example_2d.gdshader.yaml
├── exclude_dir_1.yaml
├── fib.dfy.yaml
├── fib_class.pkl.yaml
├── fibonacci.ncl.yaml
├── find.plm.yaml
├── flatbuffers.fbs.yaml
├── fmt.ha.yaml
├── foo_bar.yaml
├── fractal.um.yaml
├── fsharp.fs.yaml
├── fsharp_script.fsx.yaml
├── functional.cj.yaml
├── futhark.fut.yaml
├── generate.fnl.yaml
├── git_helpers.fish.yaml
├── git_tests/
│ ├── 04179b6_ae0d26e.yaml
│ ├── contents_f647093e8.tar.yaml
│ ├── count_and_diff.yaml.HEAD
│ ├── count_and_diff.yaml.HEAD~1
│ ├── count_and_diff.yaml.diff.HEAD~1.HEAD
│ ├── d9b672643d.yaml
│ ├── diff_contents_f647093e8.tar.yaml
│ ├── diff_f15bf042b_f647093e8b.yaml
│ ├── f15bf04_d9b6726.yaml
│ └── f647093e8be3.yaml
├── github_user.aria.yaml
├── glade-search-popover.ui.yaml
├── glossary.json.yaml
├── glossary.json5.yaml
├── gnureadline.vala.yaml
├── graphql.gql.yaml
├── greeter.tsx.yaml
├── guard_talking.yarn.yaml
├── guestbook.tpl.yaml
├── harbour_xbase.prg.yaml
├── hello.bf.yaml
├── hello.f.yaml
├── hello.f90.yaml
├── hello.kt.yaml
├── hello.lua.yaml
├── hello.pas.yaml
├── hello.pl1.yaml
├── hello.sp.yaml
├── hello1.pas.yaml
├── hello_app.go-1.yaml
├── hello_app.go-2.yaml
├── helloworld.raml.yaml
├── hi.mojo.yaml
├── hi.py.yaml
├── htlc.teal.yaml
├── html_heex_example.heex.yaml
├── i18n_de.ts.yaml
├── iclean.icl.yaml
├── idris_block_comments.idr.yaml
├── igorpro.ipf.yaml
├── includes_demo.mustache.yaml
├── inner_ref.jsonnet.yaml
├── input.gts.yaml
├── insertJournalEntry.ipl.yaml
├── invoices.prql.yaml
├── io.c3.yaml
├── issue_875.bdy.yaml
├── issue_876.vue.yaml
├── issues/
│ ├── 114/
│ │ ├── T1.yaml
│ │ ├── T2.yaml
│ │ ├── T3.yaml
│ │ ├── T4.yaml
│ │ ├── T5.yaml
│ │ ├── T6.yaml
│ │ └── T7.yaml
│ ├── 131/
│ │ ├── T1.yaml
│ │ └── T2.yaml
│ ├── 132/
│ │ ├── T1.yaml
│ │ ├── T2.yaml
│ │ ├── T3.yaml
│ │ ├── T4.yaml
│ │ ├── T5.yaml
│ │ └── T6.yaml
│ ├── 147/
│ │ └── T1.yaml
│ ├── 166/
│ │ └── fake.thy.yaml
│ ├── 183/
│ │ ├── eval1957.SACunidir.fr.yaml
│ │ └── file.fth.yaml
│ ├── 245/
│ │ └── CRS.scala.yaml
│ ├── 280/
│ │ ├── 280.yaml
│ │ └── 280_by_file.yaml
│ ├── 286/
│ │ ├── 1.yaml
│ │ ├── 2.yaml
│ │ ├── 3.yaml
│ │ ├── 4.yaml
│ │ ├── 5.yaml
│ │ └── 6.yaml
│ ├── 296/
│ │ └── results.yaml
│ ├── 312/
│ │ └── results.yaml
│ ├── 327/
│ │ └── results.yaml
│ ├── 341/
│ │ └── results.yaml
│ ├── 350/
│ │ └── fs.go.yaml
│ ├── 365/
│ │ └── results.yaml
│ ├── 370/
│ │ └── results.yaml
│ ├── 375/
│ │ └── results.yaml
│ ├── 380/
│ │ └── wrapper.pl.yaml
│ ├── 381/
│ │ ├── issue381.c.yaml
│ │ └── issue381.java.yaml
│ ├── 396/
│ │ ├── excl.yaml
│ │ └── excl_diff.yaml
│ ├── 405/
│ │ └── globs.py.yaml
│ ├── 407/
│ │ ├── results1.yaml
│ │ ├── results2.yaml
│ │ └── results3.yaml
│ ├── 408/
│ │ └── badly_named_ruby.yaml
│ ├── 420/
│ │ └── results.yaml
│ ├── 433/
│ │ └── results.yaml
│ ├── 454/
│ │ └── createServer.js.yaml
│ ├── 455/
│ │ ├── list.yaml
│ │ └── list_align.yaml
│ ├── 456/
│ │ ├── XML_no_ext.yaml
│ │ └── XML_weird_ext.profile.yaml
│ ├── 463/
│ │ └── diff.yaml
│ ├── 472/
│ │ └── not_really.lua.yaml
│ ├── 476/
│ │ ├── all.yaml
│ │ ├── no_cpp.yaml
│ │ └── no_fortran.yaml
│ ├── 482/
│ │ └── results.yaml
│ ├── 494/
│ │ └── results.yaml
│ ├── 502/
│ │ └── results.yaml
│ ├── 513/
│ │ └── results.yaml
│ ├── 520/
│ │ ├── doc_as_code.yaml
│ │ └── doc_as_comment.yaml
│ ├── 521/
│ │ ├── skip_uniq.yaml
│ │ └── uniq.yaml
│ ├── 528/
│ │ ├── cutoff_code_10.yaml
│ │ ├── cutoff_code_50pct.yaml
│ │ └── cutoff_files_1.yaml
│ ├── 530/
│ │ ├── case_1.yaml
│ │ ├── case_2.yaml
│ │ ├── case_3.yaml
│ │ ├── case_4.yaml
│ │ └── tests.sh
│ ├── 537/
│ │ ├── results_force.yaml
│ │ └── results_read.yaml
│ ├── 538/
│ │ └── add.elm.yaml
│ ├── 539/
│ │ └── nested_comments.elm.yaml
│ ├── 540/
│ │ └── Hello.f.yaml
│ ├── 542/
│ │ └── results.yaml
│ ├── 577/
│ │ └── diff_list.yaml
│ ├── 579/
│ │ └── csharp-autogen.cs.yaml
│ ├── 580/
│ │ └── encodingtest.cs.yaml
│ ├── 596/
│ │ └── results.yaml
│ ├── 597/
│ │ └── results.yaml
│ ├── 599/
│ │ └── results.yaml
│ ├── 606/
│ │ └── results.yaml
│ ├── 611/
│ │ └── cmakelists.txt.yaml
│ ├── 613/
│ │ └── nav.scss.yaml
│ ├── 619/
│ │ └── RA.s.yaml
│ ├── 625/
│ │ └── results.yaml
│ ├── 628/
│ │ └── results.yaml
│ ├── 637/
│ │ ├── diff_incl_lang.yaml
│ │ └── straight_incl_lang.yaml
│ ├── 644/
│ │ └── results.yaml
│ ├── 657/
│ │ └── results.yaml
│ ├── 670/
│ │ └── results.yaml
│ ├── 692/
│ │ └── results.yaml
│ ├── 701/
│ │ └── results.yaml
│ ├── 708/
│ │ └── results.yaml
│ ├── 710/
│ │ └── results.yaml
│ ├── 712/
│ │ └── results.yaml
│ ├── 713/
│ │ └── results.yaml
│ ├── 720/
│ │ └── results.yaml
│ ├── 722/
│ │ └── results_1.yaml
│ ├── 735/
│ │ └── results.yaml
│ ├── 753/
│ │ ├── all.yaml
│ │ └── no_autogen.yaml
│ ├── 772/
│ │ └── results.yaml
│ ├── 781/
│ │ └── results.yaml
│ ├── 784/
│ │ └── results.yaml
│ ├── 785/
│ │ └── results.yaml
│ ├── 804/
│ │ └── infoSQL.java.yaml
│ ├── 805/
│ │ └── text_block.java.yaml
│ ├── 806/
│ │ └── results.yaml
│ ├── 811/
│ │ └── inline_comment.xml.yaml
│ ├── 816/
│ │ └── results.yaml
│ ├── 822/
│ │ ├── T1.yaml
│ │ ├── T2.yaml
│ │ ├── T3.yaml
│ │ ├── T4.yaml
│ │ ├── T5.yaml
│ │ ├── T6.yaml
│ │ ├── T7.yaml
│ │ └── T8.yaml
│ ├── 833/
│ │ └── results.yaml
│ ├── 851/
│ │ └── results.yaml
│ ├── 862/
│ │ ├── diff_results.yaml
│ │ └── results.yaml
│ ├── 886/
│ │ ├── results.yaml
│ │ └── results_by_file.yaml
│ ├── 898/
│ │ └── results.yaml
│ ├── 906/
│ │ └── results.yaml
│ └── 917/
│ └── results.yaml
├── julia.jl.yaml
├── just_stuff.haml.yaml
├── kvlang.kv.yaml
├── layout.dt.yaml
├── linker.ld.yaml
├── locale_facets.h.yaml
├── logos.x.yaml
├── logos.xm.yaml
├── logtalk.lgt.yaml
├── machineDefFreshIds.lem.yaml
├── magikfile.magik.yaml
├── main.f03.yaml
├── master.blade.php.yaml
├── matlab_line_colors.m.yaml
├── md5.rkt.yaml
├── meson.build.yaml
├── messages.rb.yaml
├── mfile.mk.yaml
├── modules1-func1.pp.yaml
├── modules1-func2.pp.yaml
├── modules1-ntp1.pp.yaml
├── modules1-typealias.pp.yaml
├── moonbit.yaml
├── nested.lua.yaml
├── nomad_job.hcl.yaml
├── notes.typ.yaml
├── nu-example.nu.yaml
├── nuon-example.nuon.yaml
├── offline.jcl.yaml
├── openharmony.ets.yaml
├── orgmode.org.yaml
├── page_layout.aspx.yaml
├── pages.wxml.yaml
├── pages.wxss.yaml
├── parser_1.civet.yaml
├── parser_2.civet.yaml
├── pawn.yaml
├── pek_example.pek.yaml
├── ping_pong.lfe.yaml
├── plain_text.txt.yaml
├── plantuml.puml.yaml
├── pointillism.pde.yaml
├── poly_constructor.jai.yaml
├── pop_by_country.xq.yaml
├── prob060-andreoss.p6.yaml
├── proguard-project-app.pro.yaml
├── qsort_demo.m.yaml
├── rand.apl.yaml
├── ranges.surql.yaml
├── razor.cshtml.yaml
├── reStructuredText.rst.yaml
├── reactive.svelte.yaml
├── regex_limit.gradle.yaml
├── ring.pony.1.yaml
├── ring.pony.2.yaml
├── robotframework.robot.yaml
├── robotframework.tsv.yaml
├── roku.brs.yaml
├── rules.sss.yaml
├── sample.R.yaml
├── sample.bicep.yaml
├── sample.ejs.yaml
├── schema.prisma.yaml
├── scheme.sls.yaml
├── script1-hadoop.pig.yaml
├── sdp_parser.jspeg.yaml
├── sdp_parser.peg.yaml
├── sdp_parser.peggy.yaml
├── sdp_parser.pegjs.yaml
├── sdp_parser.tspeg.yaml
├── send_msg.applescript.yaml
├── server_side.aspx.yaml
├── sharpsign.cl.yaml
├── slug.astro.yaml
├── solidity.sol.yaml
├── specman_e.e.yaml
├── specman_e2.e.yaml
├── squirrel_table.nut.yaml
├── stata.do.yaml
├── statcsv.nim.yaml
├── streamlines.pro.yaml
├── string.gleam.yaml
├── style.scss.yaml
├── swig_example.i.yaml
├── temp.c.yaml
├── templ_example.templ.yaml
├── test-1.0-py2.py3-none-win32.whl.yaml
├── test.Dsr.yaml
├── test.Rmd.yaml
├── test.hs.yaml
├── test.rego.yaml
├── test.vbhtml.yaml
├── test.vbs.yaml
├── test1.inc.yaml
├── test1.lhs.yaml
├── test1.php.yaml
├── test2.lhs.yaml
├── test_w_cpp_comments.svelte.yaml
├── tictactoe3d.ring.yaml
├── tnsdl.sdl.yaml
├── toml.pest.yaml
├── toml_example.toml.yaml
├── tour.swift.yaml
├── traffic_light.fsl.yaml
├── type.wast.yaml
├── updateSprites.wgsl.yaml
├── utilities.R.yaml
├── variable_length.carbon.yaml
├── vba_test.vba.yaml
├── vbnet_test.vb.yaml
├── vbox.fxml.yaml
├── verilog.sv.yaml
├── vinos.nlogo.yaml
├── vs_solution.sln.yaml
├── vtl.vm.yaml
├── vyper.vy.yaml
├── warship.ts.yaml
├── webservice.wsdl.yaml
├── wiki.properties.yaml
├── window.blp.yaml
├── with_pod.pl.yaml
├── wokka.cbl.yaml
├── wokka.cs.yaml
├── wpedia.ini.yaml
├── x.mustache.yaml
├── zir_sema.zig.yaml
└── zos_assembly.s.yaml
================================================
FILE CONTENTS
================================================
================================================
FILE: .devcontainer/Dockerfile
================================================
# Original Dockerfile by Sébastien HOUZÉ, https://github.com/shouze
# Adapted for use as devcontainer
FROM perl:slim AS base
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
git \
unzip \
locales \
locales \
exuberant-ctags \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Generate locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Install all dependencies
RUN cpanm \
Algorithm::Diff \
Digest::MD5 \
Parallel::ForkManager \
Regexp::Common \
Perl::LanguageServer \
Perl::Tidy \
&& rm -rf $HOME/.cpanm
================================================
FILE: .devcontainer/devcontainer.json
================================================
{
"build": { "dockerfile": "Dockerfile" },
"extensions": [
"mhutchie.git-graph",
"eamodio.gitlens",
"richterger.perl",
"cfgweb.vscode-perl",
"gruntfuggly.todo-tree"
]
}
================================================
FILE: .dockerignore
================================================
.github
LICENSE
README.md
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: [AlDanial]
================================================
FILE: .github/ISSUE_TEMPLATE/report-a-bug.md
================================================
---
name: report a bug
about: report a bug
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A concise description of the problem you found with cloc.
**cloc; OS; OS version**
- cloc version:
- If running the cloc source, Perl version:
- OS (eg Linux, Windows, macOS, etc):
- OS version:
**To Reproduce**
Steps one can follow reproduce the behavior you're seeing.
**Expected result**
A concise description of what you expected to happen.
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/request-an-enhancement.md
================================================
---
name: request an enhancement
about: request support for additional languages or new capabilities
title: ''
labels: ''
assignees: ''
---
**If you want an unsupported language added, provide:**
- language name:
- file extension(s):
- method(s) of commenting text:
- location of sample code:
**For other enhancements:**
Give a concise description of what you want cloc to be able to do.
================================================
FILE: .github/workflows/build.yml
================================================
# This workflow will build a container image,
# to run all tests (syntax checking + integration tests) on each PR and git push.
on: [push, pull_request]
name: Run all tests
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 4
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Run tests
id: run-tests
env:
IMAGE_TAG: ${{ github.sha }}
run: |
# Build a docker container to run tests
docker build . --target test
================================================
FILE: .github/workflows/release-ready.yml
================================================
name: Create release
on:
pull_request:
types: [closed]
jobs:
create_release:
if: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'release-v') }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: "master"
- name: Extract version from branch name
id: get_version
run: |
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
if [[ "$BRANCH" =~ release-v([0-9]+\.[0-9]+) ]]; then
VERSION="${BASH_REMATCH[1]}"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "DISPLAY_VERSION=v$VERSION" >> $GITHUB_OUTPUT
else
echo "Branch name does not match expected format (release-vX.XX)!" && exit 1
fi
- name: Package repository as tar.gz
run: |
VER="${{ steps.get_version.outputs.VERSION }}"
git archive --format=tar.gz -o cloc-$VER.tar.gz HEAD
- name: Get artifact url
id: get_artifact_url
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ARTIFACT_COMMENT=$(gh pr view ${{ github.event.pull_request.number }} --json comments -q '
.comments
| sort_by(.createdAt)
| reverse
| map(select(.body | contains("**Built executable artifact:**")))
| .[0].body
')
if [ -z "$ARTIFACT_COMMENT" ]; then
echo "No matching comment found."
exit 1
fi
MATCHING_URLS=$(echo "$ARTIFACT_COMMENT" | grep -oP 'https:\/\/[^\s\)]+')
if [ -z "$MATCHING_URLS" ]; then
echo "No URL found in the comment."
exit 1
fi
ARTIFACT_URL=$(echo "$MATCHING_URLS" | head -n 1)
RUN_ID=$(echo "$ARTIFACT_URL" | grep -oP '/actions/runs/\K[0-9]+')
echo "RUN_ID=$RUN_ID" >> $GITHUB_OUTPUT
echo "Artifact URL: $ARTIFACT_URL"
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: cloc-${{ steps.get_version.outputs.VERSION }}-executable
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ steps.get_artifact_url.outputs.RUN_ID }}
- name: Prepare renamed release assets
run: |
VER="${{ steps.get_version.outputs.VERSION }}"
cp cloc cloc-$VER.pl
cp Unix/NEWS release_notes-$VER.txt
- name: Create GitHub release with assets
uses: softprops/action-gh-release@v2
with:
tag_name: "${{ steps.get_version.outputs.DISPLAY_VERSION }}"
name: "${{ steps.get_version.outputs.DISPLAY_VERSION }}"
body: "${{ github.event.pull_request.body }}"
token: ${{ secrets.GITHUB_TOKEN }}
files: |
cloc-${{ steps.get_version.outputs.VERSION }}.tar.gz
README.md
cloc-${{ steps.get_version.outputs.VERSION }}.pl
cloc-${{ steps.get_version.outputs.VERSION }}.exe
release_notes-${{ steps.get_version.outputs.VERSION }}.txt
================================================
FILE: .github/workflows/release-staging.yml
================================================
name: Build Windows executable
on:
pull_request:
types: [labeled]
jobs:
staging_build:
if: ${{ github.event.label.name == 'release-ready' }}
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
# Branch name must be in the format "release-vX.XX"
- name: Extract version from branch name
id: get_version
shell: pwsh
run: |
$branch = "${{ github.head_ref }}"
if (-not $branch) { $branch = "${{ github.ref }}" }
if ($branch -match 'release-v(?<ver>[0-9]+\.[0-9]+)') {
$ver = $Matches["ver"]
echo "VERSION_NUM=$ver" >> $env:GITHUB_OUTPUT
echo "DISPLAY_VERSION=v$ver" >> $env:GITHUB_OUTPUT
Write-Host "Extracted version: $ver"
}
else {
Write-Error "Branch name does not match expected format (release-vX.XX)."
}
- name: Update version in cloc files
shell: pwsh
run: |
$ver = "${{ steps.get_version.outputs.VERSION_NUM }}"
Write-Host "Updating version in cloc and Unix/cloc to '$ver'"
$replaceVer = 'my $VERSION = "' + $ver + '";'
(Get-Content cloc) -replace 'my \$VERSION = ".*";', $replaceVer | Set-Content cloc
(Get-Content Unix/cloc) -replace 'my \$VERSION = ".*";', $replaceVer | Set-Content Unix/cloc
- name: Update README.md with version and date
shell: pwsh
run: |
$ver = "${{ steps.get_version.outputs.VERSION_NUM }}"
$disp = "${{ steps.get_version.outputs.DISPLAY_VERSION }}"
$currentDate = (Get-Date).ToString("MMM. d, yyyy")
Write-Host "Updating README.md with version $disp and date $currentDate"
(Get-Content README.md) `
-replace 'Latest release:\s+v\d+\.\d+\s+\(.*\)', "Latest release: $disp ($currentDate)" `
-replace 'badge/version-\d+\.\d+', "badge/version-$ver" `
-replace 'cloc-\d+\.\d+\.pl', "cloc-$ver.pl" `
-replace 'cloc-\d+\.\d+\.exe(?!:)', "cloc-$ver.exe" `
-replace 'pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o cloc-\d+\.\d+\.exe', "pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o cloc-$ver.exe" `
-replace '<tt>cloc-\d+\.\d+\.exe</tt>', "<tt>cloc-$ver.exe</tt>" | Set-Content README.md
- name: Install or upgrade Strawberry Perl
shell: pwsh
run: |
if (Get-Command perl -ErrorAction SilentlyContinue) {
# see https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/19#issuecomment-2401043349
choco uninstall strawberryperl -y
}
choco install strawberryperl --no-progress -y
perl -V
cpan -v
- name: Install CPAN dependencies
shell: pwsh
run: |
cpan -i App::cpanminus
cpanm Digest::MD5
cpanm Regexp::Common
cpanm Algorithm::Diff
cpanm PAR::Packer
cpanm Win32::LongPath || cpanm -n Win32::LongPath
- name: Build executable
shell: pwsh
run: |
$ver = "${{ steps.get_version.outputs.VERSION_NUM }}"
pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o "cloc-$ver.exe" cloc
- name: Upload executable to VirusTotal and get analysis URL
id: vt_upload
shell: pwsh
run: |
$ver = "${{ steps.get_version.outputs.VERSION_NUM }}"
$apiKey = "${{ secrets.VIRUSTOTAL_API_KEY }}"
$exeFile = "cloc-$ver.exe"
$absoluteFilePath = (Get-Location).Path + "\" + $exeFile
Write-Host "Uploading $absoluteFilePath to VirusTotal..."
$headers=@{}
$headers.Add("accept", "application/json")
$headers.Add("content-type", "multipart/form-data")
$headers.Add("x-apikey", $apiKey)
$response = Invoke-RestMethod -Uri "https://www.virustotal.com/api/v3/files" `
-Method POST `
-Headers $headers `
-Form @{ file = Get-Item -Path $absoluteFilePath }
$vtAnalysisId = $response.data.id
$response2 = Invoke-WebRequest -Uri "https://www.virustotal.com/api/v3/analyses/$vtAnalysisId" -Method GET -Headers $headers
$vtId = ($response2.Content | ConvertFrom-Json).data.links.item.Split("/")[-1]
$vtUrl = "https://www.virustotal.com/gui/file/$vtId"
echo "VT_URL=$vtUrl" >> $env:GITHUB_OUTPUT
Write-Host "VirusTotal analysis available at $vtUrl"
- name: Upload artifact
uses: actions/upload-artifact@v4
id: upload-artifact
with:
name: cloc-${{ steps.get_version.outputs.VERSION_NUM }}-executable
path: cloc-${{ steps.get_version.outputs.VERSION_NUM }}.exe
- name: Post comment with artifact and VirusTotal URL
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
**Built executable artifact:**
[Download the executable artifact from this workflow run](${{ steps.upload-artifact.outputs.artifact-url }})
**VirusTotal Analysis:** ${{ steps.vt_upload.outputs.VT_URL }}
- name: Clean up local exe
shell: pwsh
run: |
$ver = "${{ steps.get_version.outputs.VERSION_NUM }}"
Remove-Item "cloc-$ver.exe"
- name: Update README recent versions entry
shell: pwsh
run: |
$ver = "${{ steps.get_version.outputs.VERSION_NUM }}"
$vtUrl = "${{ steps.vt_upload.outputs.VT_URL }}"
$readme = Get-Content README.md -Raw
$pattern = 'The entries for recent versions are:\s*\r?\n\s*\r?\n'
$replacement = "The entries for recent versions are:`n`ncloc-$ver.exe:`n$vtUrl`n`n"
$newReadme = [regex]::Replace($readme, $pattern, $replacement)
Set-Content -Path README.md -Value $newReadme
(Get-Content README.md -Raw) -replace '\r?\n\s*\r?\n$', "" | Set-Content README.md
- name: Update Unix/NEWS with release notes
shell: pwsh
run: |
$ver = "${{ steps.get_version.outputs.VERSION_NUM }}"
$currentDate = (Get-Date).ToString("MMM. d, yyyy")
$event = Get-Content $env:GITHUB_EVENT_PATH -Raw | ConvertFrom-Json
$prBody = $event.pull_request.body -replace '"', '`"'
$processedNotes = $prBody -replace '- ', ' o ' -replace '[\*\`_]', ''
$newsContent = Get-Content Unix/NEWS -Raw -Encoding UTF8
$header = @(
" Release Notes for cloc version $ver",
" https://github.com/AlDanial/cloc",
" $currentDate"
)
$newNews = $header + "" + $processedNotes + "" + ("=" * 76) + $newsContent
Set-Content -Path Unix/NEWS -Value $newNews -Encoding UTF8
(Get-Content Unix/NEWS -Raw) -replace '\r?\n\s*\r?\n$', "" | Set-Content Unix/NEWS -Encoding UTF8
- name: Commit changes
shell: pwsh
run: |
$ver = "${{ steps.get_version.outputs.VERSION_NUM }}"
git config user.name "github-actions"
git config user.email "actions@github.com"
git add cloc README.md Unix/NEWS Unix/cloc
git commit -m "chore: prepare release version $ver"
git push
================================================
FILE: .gitignore
================================================
cloc-?.??.*
release_notes-?.??.txt
# Visual Studio Code and extensions
.vstags
.vscode/perl-lang
.gitmodules
Unix/cloc_submodule_test
================================================
FILE: .vscode/launch.json
================================================
{
// Further information: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "perl",
"request": "launch",
"name": "Perl-Debug",
"program": "${workspaceFolder}/${relativeFile}",
"stopOnEntry": true,
"reloadModules": true
}
]
}
================================================
FILE: Dockerfile
================================================
# Dockerfile by Sébastien HOUZÉ, https://github.com/shouze
FROM perl:slim AS builder
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
dos2unix \
gcc
#Install all dependencies
RUN cpanm \
Algorithm::Diff \
Digest::MD5 \
Parallel::ForkManager \
Regexp::Common
#Copy source code
COPY cloc /usr/src/
RUN find /usr/src/ -type f -exec dos2unix {} \;
FROM perl:slim AS base
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
git \
unzip \
&& rm -rf /var/lib/apt/lists/*
#Copy dependencies and source prepared in base image
COPY --from=builder /usr/local/lib/perl5 /usr/local/lib/perl5
COPY --from=builder /usr/src/ /usr/src/
####################
FROM base AS test
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates
#Copy test code
COPY .git /usr/src/.git
COPY tests /usr/src/tests
COPY Unix /usr/src/Unix
WORKDIR /usr/src/Unix
#Checkout of cloc_submodule_test for t/02_git.t tests
RUN git clone https://github.com/AlDanial/cloc_submodule_test.git
#Run tests
RUN make test
####################
FROM base AS final
WORKDIR /tmp
ENTRYPOINT ["/usr/src/cloc"]
CMD ["--help"]
================================================
FILE: Dockerfile.build
================================================
FROM alpine:3.11
RUN apk add --no-cache cloc
ENTRYPOINT ["cloc"]
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
================================================
FILE: README.md
================================================
# cloc
*Count Lines of Code*
* * *
cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
Latest release: v2.08 (Jan. 24, 2026)
[](https://github.com/AlDanial/cloc)
[](https://github.com/AlDanial/cloc/graphs/contributors)
[](https://doi.org/10.5281/zenodo.42029482)
[](https://github.com/AlDanial/cloc/network/members)
[]()
cloc moved to GitHub in September 2015 after being hosted
at http://cloc.sourceforge.net/ since August 2006.
# Quick Start
Step 1: Install cloc (see [Install from Github Releases](#install-from-github-releases)
and [Install via package manager](#install-via-package-manager)) or run cloc's
[docker image](#run-via-docker). The Windows executable has no requirements.
The source version of cloc requires a Perl interpreter, and the
Docker version of cloc requires a Docker installation.
Step 2: Open a terminal (`cmd.exe` on Windows).
Step 3: Invoke cloc to count your source files, directories, archives,
or git commits.
The executable name differs depending on whether you use the
development source version (`cloc`), source for a
released version (`cloc-2.08.pl`) or a Windows executable
(`cloc-2.08.exe`).
On this page, `cloc` is the generic term
used to refer to any of these.
[Include Security](https://www.youtube.com/user/IncludeSecurity) has a
[YouTube video](https://www.youtube.com/watch?v=eRLTkDMsCqs)
showing the steps in action.
**a file**
```
prompt> cloc hello.c
1 text file.
1 unique file.
0 files ignored.
https://github.com/AlDanial/cloc v 1.65 T=0.04 s (28.3 files/s, 340.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 1 0 7 5
-------------------------------------------------------------------------------
```
**a directory**
```
prompt> cloc gcc-5.2.0/gcc/c
16 text files.
15 unique files.
3 files ignored.
https://github.com/AlDanial/cloc v 1.65 T=0.23 s (57.1 files/s, 188914.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 10 4680 6621 30812
C/C++ Header 3 99 286 496
-------------------------------------------------------------------------------
SUM: 13 4779 6907 31308
-------------------------------------------------------------------------------
```
**an archive**
We'll pull cloc's source zip file from GitHub, then count the contents:
```
prompt> wget https://github.com/AlDanial/cloc/archive/master.zip
prompt> cloc master.zip
https://github.com/AlDanial/cloc v 1.65 T=0.07 s (26.8 files/s, 141370.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Perl 2 725 1103 8713
-------------------------------------------------------------------------------
SUM: 2 725 1103 8713
-------------------------------------------------------------------------------
```
**a git repository, using a specific commit**
This example uses code from
<a href=https://pypi.python.org/pypi/pudb>PuDB</a>, a fantastic Python debugger.
```
prompt> git clone https://github.com/inducer/pudb.git
prompt> cd pudb
prompt> cloc 6be804e07a5db
48 text files.
41 unique files.
8 files ignored.
github.com/AlDanial/cloc v 1.99 T=0.04 s (1054.9 files/s, 189646.8 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Python 28 1519 728 4659
reStructuredText 6 102 20 203
YAML 2 9 2 75
Bourne Shell 3 6 0 17
Text 1 0 0 11
make 1 4 6 10
-------------------------------------------------------------------------------
SUM: 41 1640 756 4975
-------------------------------------------------------------------------------
```
**each subdirectory of a particular directory**
Say you have a directory with three different git-managed projects,
Project0, Project1, and Project2. You can use your shell's looping
capability to count the code in each. This example uses bash (scroll down for cmd.exe example):
```
prompt> for d in ./*/ ; do (cd "$d" && echo "$d" && cloc --vcs git); done
./Project0/
7 text files.
7 unique files.
1 file ignored.
github.com/AlDanial/cloc v 1.71 T=0.02 s (390.2 files/s, 25687.6 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
D 4 61 32 251
Markdown 1 9 0 38
make 1 0 0 4
-------------------------------------------------------------------------------
SUM: 6 70 32 293
-------------------------------------------------------------------------------
./Project1/
7 text files.
7 unique files.
0 files ignored.
github.com/AlDanial/cloc v 1.71 T=0.02 s (293.0 files/s, 52107.1 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Go 7 165 282 798
-------------------------------------------------------------------------------
SUM: 7 165 282 798
-------------------------------------------------------------------------------
./Project2/
49 text files.
47 unique files.
13 files ignored.
github.com/AlDanial/cloc v 1.71 T=0.10 s (399.5 files/s, 70409.4 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Python 33 1226 1026 3017
C 4 327 337 888
Markdown 1 11 0 28
YAML 1 0 2 12
-------------------------------------------------------------------------------
SUM: 39 1564 1365 3945
-------------------------------------------------------------------------------
```
**each subdirectory of a particular directory (Windows/cmd.exe)**
```
for /D %I in (.\*) do cd %I && cloc --vcs git && cd ..
```
# Overview
cloc counts blank lines, comment lines, and physical lines of source
code in [many programming languages](#recognized-languages). Given two versions of
a code base, cloc can compute differences in blank, comment, and source
lines. It is written entirely in Perl with no dependencies outside the
standard distribution of Perl v5.6 and higher (code from some external
modules is [embedded within
cloc](https://github.com/AlDanial/cloc#regexp_common)) and so is
quite portable. cloc is known to run on many flavors of Linux, FreeBSD,
NetBSD, OpenBSD, macOS, AIX, HP-UX, Solaris, IRIX, z/OS, and Windows.
(To run the Perl source version of cloc on Windows one needs
[ActiveState Perl](http://www.activestate.com/activeperl) 5.6.1 or
higher, [Strawberry Perl](http://strawberryperl.com/),
Windows Subsystem for Linux,
[Cygwin](http://www.cygwin.com/),
[MobaXTerm](http://mobaxterm.mobatek.net/) with the Perl plug-in
installed,
or
a mingw environment and terminal such as provided by
[Git for Windows](https://gitforwindows.org/).
Alternatively one can use the Windows binary of cloc
generated with [PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.019/lib/pp.pm)
to run on Windows computers that have neither Perl nor Cygwin.)
In addition to counting code in individual text files, directories,
and git repositories, cloc can also count code in archive files such
as ``.tar`` (including compressed versions), ``.zip``, Python
wheel ``.whl``, Jupyter notebook ``.ipynb``, source RPMs ``.rpm``
or ``.src`` (requires ``rpm2cpio``),
and Debian ``.deb`` files (requires ``dpkg-deb``).
cloc contains code from David Wheeler's
[SLOCCount](http://www.dwheeler.com/sloccount/),
Damian Conway and Abigail's Perl module
[Regexp::Common](http://search.cpan.org/%7Eabigail/Regexp-Common-2.120/lib/Regexp/Common.pm),
Sean M. Burke's Perl module
[Win32::Autoglob](http://search.cpan.org/%7Esburke/Win32-Autoglob-1.01/Autoglob.pm),
and Tye McQueen's Perl module
[Algorithm::Diff](http://search.cpan.org/%7Etyemq/Algorithm-Diff-1.1902/lib/Algorithm/Diff.pm).
Language scale factors were derived from Mayes Consulting, LLC web site
http://softwareestimator.com/IndustryData2.htm.
New releases nominally appear every six months.
## Install from Github Releases
Grab the latest release of cloc from the [Releases section of this repository](https://github.com/AlDanial/cloc/releases).
### Source version on Linux/macOS
Save the latest source file, for example `cloc-2.08.pl`,
as `cloc` (if you prefer the shorter command name) somewhere on your `PATH`.
After downloading, make the file executable:
```shell
cd ~/Downloads
mv cloc-2.08.pl cloc
chmod a+rx cloc
./cloc --version # make sure it runs
mv cloc ~/bin # for example, if ~/bin is in $PATH
```
### Source version on Windows
You'll need a Perl interpreter such as [Strawberry Perl](http://strawberryperl.com/)
installed to run the source version of cloc.
After downloading the cloc source file, open a command prompt or PowerShell window,
navigate to the download directory (`C:\TEMP` in the example below), then test cloc with:
```dos
cd C:\TEMP>
C:TEMP\> perl cloc-2.08.pl --version
```
### Binary version on Windows
Download the latest released Windows executable, for example `cloc-2.08.exe`
and save it as `cloc.exe` (if desired) in a directory on your `PATH`.
There is no binary version for Linux or macOS.
## Install via package manager
Depending your operating system, one of these installation methods may
work for you (all but the last two entries for Windows require
a Perl interpreter):
npm install -g cloc # https://www.npmjs.com/package/cloc
sudo apt install cloc # Debian, Ubuntu
sudo yum install cloc # Red Hat, Fedora
sudo dnf install cloc # Fedora 22 or later
sudo pacman -S cloc # Arch
yay -S cloc-git # Arch AUR (latest git version)
sudo emerge -av dev-util/cloc # Gentoo https://packages.gentoo.org/packages/dev-util/cloc
sudo apk add cloc # Alpine Linux
doas pkg_add cloc # OpenBSD
sudo pkg install cloc # FreeBSD
sudo port install cloc # macOS with MacPorts
brew install cloc # macOS with Homebrew
winget install AlDanial.Cloc # Windows with winget (might not work, ref https://github.com/AlDanial/cloc/issues/849)
choco install cloc # Windows with Chocolatey
scoop install cloc # Windows with Scoop
**Note**: I don't control any of these packages.
If you encounter a bug in cloc using one of the above
packages, try with cloc pulled from the latest stable release here
on GitHub (link follows below) before submitting a problem report.
## Run via docker
These docker commands count lines of code in and below
the current directory:
```shell
docker run --rm -v $PWD:/tmp aldanial/cloc .
```
### Run via docker on git-bash
```shell
docker run --rm -v "/$(pwd -W)":/tmp aldanial/cloc .
```
## Development version
Download the cloc source code at https://github.com/AlDanial/cloc/raw/master/cloc and
save it as the file `cloc` (or `cloc.pl`, or whatever executable name you wish).
The next step depends on the operating system you're using.
# License
cloc is licensed under the
[GNU General Public License, v 2](http://www.gnu.org/licenses/gpl-2.0.html),
excluding portions which
are copied from other sources. Code
copied from the Regexp::Common, Win32::Autoglob, and Algorithm::Diff
Perl modules is subject to the
[Artistic License](https://opensource.org/license/artistic-2-0).
# Why Use cloc?
cloc has many features that make it easy to use, thorough, extensible, and portable:
1. Exists as a single, self-contained file that requires minimal installation effort---just download the file and run it.
2. Can read language comment definitions from a file and thus potentially work with computer languages that do not yet exist.
3. Allows results from multiple runs to be summed together by language and by project.
4. Can produce results in a variety of formats: plain text, Markdown, SQL, JSON, XML, YAML, comma separated values.
5. Can count code within compressed archives (tar balls, Zip files, Java .ear files).
6. Has numerous troubleshooting options.
7. Handles file and directory names with spaces and other unusual characters.
8. Has no dependencies outside the standard Perl distribution.
9. Runs on Linux, FreeBSD, NetBSD, OpenBSD, macOS, AIX, HP-UX, Solaris, IRIX, and z/OS systems that have Perl 5.6 or higher. The source version runs on Windows with either ActiveState Perl, Strawberry Perl, Cygwin, or MobaXTerm+Perl plugin. Alternatively on Windows one can run the Windows binary which has no dependencies.
# Other Counters
If cloc does not suit your needs here are other freely available counters to consider:
* [loc](https://github.com/cgag/loc/)
* [gcloc](https://github.com/JoaoDanielRufino/gcloc)
* [gocloc](https://github.com/hhatto/gocloc/)
* [Ohcount](https://github.com/blackducksoftware/ohcount/)
* [scc](https://github.com/boyter/scc/)
* [sclc](https://code.google.com/archive/p/sclc/)
* [SLOCCount](http://www.dwheeler.com/sloccount/)
* [Sonar](http://www.sonarsource.org/)
* [tokei](https://github.com/Aaronepower/tokei/)
* [Unified Code Count](http://csse.usc.edu/ucc_new/wordpress/)
Other references:
* QSM's [directory](http://www.qsm.com/CodeCounters.html) of code counting tools.
* The [Wikipedia entry](http://en.wikipedia.org/wiki/Source_lines_of_code) for source code line counts.
# Regexp::Common, Digest::MD5, Win32::Autoglob, Algorithm::Diff
Although cloc does not need Perl modules outside those found in the
standard distribution, cloc does rely on a few external modules. Code
from three of these external modules--Regexp::Common, Win32::Autoglob,
and Algorithm::Diff--is embedded within cloc. A fourth module,
Digest::MD5, is used only if it is available. If cloc finds
Regexp::Common or Algorithm::Diff installed locally it will use those
installation. If it doesn't, cloc will install the parts of
Regexp::Common and/or Algorithm:Diff it needs to temporary directories
that are created at the start of a cloc run then removed when the run is
complete. The necessary code from Regexp::Common v2.120 and
Algorithm::Diff v1.1902 are embedded within the cloc source code (see
subroutines `Install_Regexp_Common()` and `Install_Algorithm_Diff()` ).
Only three lines are needed from Win32::Autoglob and these are included
directly in cloc.
Additionally, cloc will use Digest::MD5 to validate uniqueness among
equally-sized input files if Digest::MD5 is installed locally.
A parallel processing option, `--processes=*N*`, was introduced with
cloc version 1.76 to enable faster runs on multi-core machines. However,
to use it, one must have the module Parallel::ForkManager installed.
This module does not work reliably on Windows so parallel processing
will only work on Unix-like operating systems.
The Windows binary is built on a computer that has both Regexp::Common
and Digest::MD5 installed locally.
# Building a Windows Executable
#### Create your own executable
The most robust option for creating a Windows executable of
cloc is to use [ActiveState's Perl Development Kit](http://www.activestate.com/perl-dev-kit).
It includes a utility, `perlapp`, which can build stand-alone
Windows, Mac, and Linux binaries of Perl source code.
[perl2exe](http://www.indigostar.com/perl2exe/)
will also do the trick. If you do have `perl2exe`, modify lines
84-87 in the cloc source code for a minor code
modification that is necessary to make a cloc Windows executable.
Otherwise, to build a Windows executable with `pp` from
`PAR::Packer`, first install a Windows-based Perl distribution
(for example Strawberry Perl or ActivePerl) following their
instructions. Next, open a command prompt, aka a DOS window and install
the PAR::Packer module. Finally, invoke the newly installed `pp`
command with the cloc source code to create an `.exe` file:
```
C:> cpan -i Digest::MD5
C:> cpan -i Regexp::Common
C:> cpan -i Algorithm::Diff
C:> cpan -i PAR::Packer
C:> cpan -i Win32::LongPath
C:> pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o cloc-2.08.exe cloc-2.08.pl
```
A variation on the instructions above is if you installed the portable
version of Strawberry Perl, you will need to run `portableshell.bat` first
to properly set up your environment.
The Windows executable in the Releases section, `cloc-2.08.exe`,
was built on a 64 bit Windows 11 computer using
[Strawberry Perl](http://strawberryperl.com/)
5.32.1 and
[PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.064/lib/pp.pm)
to build the `.exe`.
#### Is the Windows executable safe to run? Does it have malware?
Ideally, no one would need the Windows executable because they
have a Perl interpreter installed on their machines and can
run the cloc source file.
On centrally-managed corporate Windows machines, however, this
this may be difficult or impossible.
The Windows executable distributed with cloc is provided as
a best-effort of a virus and malware-free `.exe`.
You are encouraged to run your own virus scanners against the
executable and also check sites such
https://www.virustotal.com/ .
The entries for recent versions are:
cloc-2.08.exe:
https://www.virustotal.com/gui/file/4529557d957ade0dd45746eae10e9c51ee01061bb617eeeab256672faf6e42c6?nocache=1
cloc-2.06.exe:
https://www.virustotal.com/gui/file/bbe48de9102d0f2520d292d65897001c1d068340eb7cd74dd1ee30c1a9091c4a?nocache=1
cloc-2.04.exe:
https://www.virustotal.com/gui/file/89cda0038bf4e13c6c13ebc1e60bec4dfad362e69ac8a5b8e2d5ebe3020359e1
cloc-2.02-winget.exe: (includes [PR 850](https://github.com/AlDanial/cloc/pull/850) to allow
[running from a symlink on Windows](https://github.com/AlDanial/cloc/issues/849))
https://www.virustotal.com/gui/file/be033061e091fea48a5bc9e8964cee0416ddd5b34bd5226a1c9aa4b30bdba66a?nocache=1
cloc-2.02.exe:
https://www.virustotal.com/gui/file/369ed76125f7399cd582d169adf39a2e08ae5066031fea0cc8b2836ea50e7ce2?nocache=1
cloc-2.00.exe:
https://www.virustotal.com/gui/file/7a234ef0cb495de1b5776acf88c5554e2bab1fb02725a5fb85756a6db3121c1f
#### Why is the Windows executable so large?
Windows executables of cloc versions 1.60 and earlier, created with
perl2exe as noted above, are about 1.6 MB, while versions 1.62 and 1.54, created
with `PAR::Packer`, are 11 MB.
Version 1.66, built with a newer version of `PAR::Packer`, is about 5.5 MB.
Why are the `PAR::Packer`, executables so
much larger than those built with perl2exe? My theory is that perl2exe
uses smarter tree pruning logic
than `PAR::Packer`, but that's pure speculation.
# Basic Use
cloc is a command line program that takes file, directory, and/or
archive names as inputs. Here's an example of running cloc against the
Perl v5.22.0 source distribution:
```
prompt> cloc perl-5.22.0.tar.gz
5605 text files.
5386 unique files.
2176 files ignored.
https://github.com/AlDanial/cloc v 1.65 T=25.49 s (134.7 files/s, 51980.3 lines/s)
-----------------------------------------------------------------------------------
Language files blank comment code
-----------------------------------------------------------------------------------
Perl 2892 136396 184362 536445
C 130 24676 33684 155648
C/C++ Header 148 9766 16569 147858
Bourne Shell 112 4044 6796 42668
Pascal 8 458 1603 8592
XML 33 142 0 2410
YAML 49 20 15 2078
C++ 10 313 277 2033
make 4 426 488 1986
Prolog 12 438 2 1146
JSON 14 1 0 1037
yacc 1 85 76 998
Windows Message File 1 102 11 489
DOS Batch 14 92 41 389
Windows Resource File 3 10 0 85
D 1 5 7 8
Lisp 2 0 3 4
-----------------------------------------------------------------------------------
SUM: 3434 176974 243934 903874
-----------------------------------------------------------------------------------
```
To run cloc on Windows computers, open up a command (aka DOS) window
and invoke cloc.exe from the command line there.
Alternatively, try ClocViewer, the GUI wrapper around cloc found at
https://github.com/Roemer/ClocViewer.
See also https://github.com/jmensch1/codeflower for a
graphical rendering of cloc results.
# GUI Frontends
Several GUI frontends to cloc are available:
* [cloctui](https://github.com/edward-jazzhands/cloctui)
* [ClocViewer](https://github.com/Roemer/ClocViewer)
* [codeflower](https://github.com/jmensch1/codeflower)
# Options
<details>
<summary>Full options list (<code>cloc --help</code>) (click the triangle to see all option)</summary>
```
prompt> cloc --help
Usage: cloc [options] <file(s)/dir(s)/git hash(es)> | <set 1> <set 2> | <report files>
Count, or compute differences of, physical lines of source code in the
given files (may be archives such as compressed tarballs or zip files,
or git commit hashes or branch names) and/or recursively below the
given directories.
Input Options
--extract-with=<cmd> This option is only needed if cloc is unable
to figure out how to extract the contents of
the input file(s) by itself.
Use <cmd> to extract binary archive files (e.g.:
.tar.gz, .zip, .Z). Use the literal '>FILE<' as
a stand-in for the actual file(s) to be
extracted. For example, to count lines of code
in the input files
gcc-4.2.tar.gz perl-5.8.8.tar.gz
on Unix use
--extract-with='gzip -dc >FILE< | tar xf -'
or, if you have GNU tar,
--extract-with='tar zxf >FILE<'
and on Windows use, for example:
--extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o >FILE< ."
(if WinZip is installed there).
--list-file=<file> Take the list of file and/or directory names to
process from <file>, which has one file/directory
name per line. Only exact matches are counted;
relative path names will be resolved starting from
the directory where cloc is invoked. Set <file>
to - to read file names from a STDIN pipe.
See also --exclude-list-file.
--diff-list-file=<file> Take the pairs of file names to be diff'ed from
<file>, whose format matches the output of
--diff-alignment. (Run with that option to
see a sample.) The language identifier at the
end of each line is ignored. This enables --diff
mode and bypasses file pair alignment logic.
--vcs=<VCS> Invoke a system call to <VCS> to obtain a list of
files to work on. If <VCS> is 'git', then will
invoke 'git ls-files' to get a file list and
'git submodule status' to get a list of submodules
whose contents will be ignored. See also --git
which accepts git commit hashes and branch names.
If <VCS> is 'svn' then will invoke 'svn list -R'.
The primary benefit is that cloc will then skip
files explicitly excluded by the versioning tool
in question, ie, those in .gitignore or have the
svn:ignore property.
Alternatively <VCS> may be any system command
that generates a list of files.
Note: cloc must be in a directory which can read
the files as they are returned by <VCS>. cloc will
not download files from remote repositories.
'svn list -R' may refer to a remote repository
to obtain file names (and therefore may require
authentication to the remote repository), but
the files themselves must be local.
Setting <VCS> to 'auto' selects between 'git'
and 'svn' (or neither) depending on the presence
of a .git or .svn subdirectory below the directory
where cloc is invoked. --files-from is a synonym
for --vcs.
--unicode Check binary files to see if they contain Unicode
expanded ASCII text. This causes performance to
drop noticeably.
Processing Options
--autoconf Count .in files (as processed by GNU autoconf) of
recognized languages. See also --no-autogen.
--by-file Report results for every source file encountered.
--by-file-by-lang Report results for every source file encountered
in addition to reporting by language.
--config <file> Read command line switches from <file> instead of
the default location of /home/al/.config/cloc/options.txt.
The file should contain one switch, along with
arguments (if any), per line. Blank lines and lines
beginning with '#' are skipped. Options given on
the command line take priority over entries read from
the file.
--count-and-diff <set1> <set2>
First perform direct code counts of source file(s)
of <set1> and <set2> separately, then perform a diff
of these. Inputs may be pairs of files, directories,
or archives. If --out or --report-file is given,
three output files will be created, one for each
of the two counts and one for the diff. See also
--diff, --diff-alignment, --diff-timeout,
--ignore-case, --ignore-whitespace.
--diff <set1> <set2> Compute differences in code and comments between
source file(s) of <set1> and <set2>. The inputs
may be any mix of files, directories, archives,
or git commit hashes. Use --diff-alignment to
generate a list showing which file pairs where
compared. When comparing git branches, only files
which have changed in either commit are compared.
See also --git, --count-and-diff, --diff-alignment,
--diff-list-file, --diff-timeout, --ignore-case,
--ignore-whitespace.
--diff-timeout <N> Ignore files which take more than <N> seconds
to process. Default is 10 seconds. Setting <N>
to 0 allows unlimited time. (Large files with many
repeated lines can cause Algorithm::Diff::sdiff()
to take hours.) See also --timeout.
--docstring-as-code cloc considers docstrings to be comments, but this is
not always correct as docstrings represent regular
strings when they appear on the right hand side of an
assignment or as function arguments. This switch
forces docstrings to be counted as code.
--follow-links [Unix only] Follow symbolic links to directories
(sym links to files are always followed).
See also --stat.
--force-lang=<lang>[,<ext>]
Process all files that have a <ext> extension
with the counter for language <lang>. For
example, to count all .f files with the
Fortran 90 counter (which expects files to
end with .f90) instead of the default Fortran 77
counter, use
--force-lang="Fortran 90,f"
If <ext> is omitted, every file will be counted
with the <lang> counter. This option can be
specified multiple times (but that is only
useful when <ext> is given each time).
See also --script-lang, --lang-no-ext.
--force-lang-def=<file> Load language processing filters from <file>,
then use these filters instead of the built-in
filters. Note: languages which map to the same
file extension (for example:
MATLAB/Mathematica/Objective-C/MUMPS/Mercury;
Pascal/PHP; Lisp/OpenCL; Lisp/Julia; Perl/Prolog)
will be ignored as these require additional
processing that is not expressed in language
definition files. Use --read-lang-def to define
new language filters without replacing built-in
filters (see also --write-lang-def,
--write-lang-def-incl-dup).
--git Forces the inputs to be interpreted as git targets
(commit hashes, branch names, et cetera) if these
are not first identified as file or directory
names. This option overrides the --vcs=git logic
if this is given; in other words, --git gets its
list of files to work on directly from git using
the hash or branch name rather than from
'git ls-files'. This option can be used with
--diff to perform line count diffs between git
commits, or between a git commit and a file,
directory, or archive. Use -v/--verbose to see
the git system commands cloc issues.
--git-diff-rel Same as --git --diff, or just --diff if the inputs
are recognized as git targets. Only files which
have changed in either commit are compared.
--git-diff-all Git diff strategy #2: compare all files in the
repository between the two commits.
--ignore-whitespace Ignore horizontal white space when comparing files
with --diff. See also --ignore-case.
--ignore-case Ignore changes in case within file contents;
consider upper- and lowercase letters equivalent
when comparing files with --diff. See also
--ignore-whitespace.
--ignore-case-ext Ignore case of file name extensions. This will
cause problems counting some languages
(specifically, .c and .C are associated with C and
C++; this switch would count .C files as C rather
than C++ on *nix operating systems). File name
case insensitivity is always true on Windows.
--lang-no-ext=<lang> Count files without extensions using the <lang>
counter. This option overrides internal logic
for files without extensions (where such files
are checked against known scripting languages
by examining the first line for #!). See also
--force-lang, --script-lang.
--max-file-size=<MB> Skip files larger than <MB> megabytes when
traversing directories. By default, <MB>=100.
cloc's memory requirement is roughly twenty times
larger than the largest file so running with
files larger than 100 MB on a computer with less
than 2 GB of memory will cause problems.
Note: this check does not apply to files
explicitly passed as command line arguments.
--no-autogen[=list] Ignore files generated by code-production systems
such as GNU autoconf. To see a list of these files
(then exit), run with --no-autogen list
See also --autoconf.
--original-dir [Only effective in combination with
--strip-comments] Write the stripped files
to the same directory as the original files.
--read-binary-files Process binary files in addition to text files.
This is usually a bad idea and should only be
attempted with text files that have embedded
binary data.
--read-lang-def=<file> Load new language processing filters from <file>
and merge them with those already known to cloc.
If <file> defines a language cloc already knows
about, cloc's definition will take precedence.
Use --force-lang-def to over-ride cloc's
definitions (see also --write-lang-def,
--write-lang-def-incl-dup).
--script-lang=<lang>,<s> Process all files that invoke <s> as a #!
scripting language with the counter for language
<lang>. For example, files that begin with
#!/usr/local/bin/perl5.8.8
will be counted with the Perl counter by using
--script-lang=Perl,perl5.8.8
The language name is case insensitive but the
name of the script language executable, <s>,
must have the right case. This option can be
specified multiple times. See also --force-lang,
--lang-no-ext.
--sdir=<dir> Use <dir> as the scratch directory instead of
letting File::Temp chose the location. Files
written to this location are not removed at
the end of the run (as they are with File::Temp).
--skip-uniqueness Skip the file uniqueness check. This will give
a performance boost at the expense of counting
files with identical contents multiple times
(if such duplicates exist).
--stat Some file systems (AFS, CD-ROM, FAT, HPFS, SMB)
do not have directory 'nlink' counts that match
the number of its subdirectories. Consequently
cloc may undercount or completely skip the
contents of such file systems. This switch forces
File::Find to stat directories to obtain the
correct count. File search speed will decrease.
See also --follow-links.
--stdin-name=<file> Give a file name to use to determine the language
for standard input. (Use - as the input name to
receive source code via STDIN.)
--strip-comments=<ext> For each file processed, write to the current
directory a version of the file which has blank
and commented lines removed (in-line comments
persist). The name of each stripped file is the
original file name with .<ext> appended to it.
It is written to the current directory unless
--original-dir is on.
--strip-str-comments Replace comment markers embedded in strings with
'xx'. This attempts to work around a limitation
in Regexp::Common::Comment where comment markers
embedded in strings are seen as actual comment
markers and not strings, often resulting in a
'Complex regular subexpression recursion limit'
warning and incorrect counts. There are two
disadvantages to using this switch: 1/code count
performance drops, and 2/code generated with
--strip-comments will contain different strings
where ever embedded comments are found.
--sum-reports Input arguments are report files previously
created with the --report-file option in plain
format (eg. not JSON, YAML, XML, or SQL).
Makes a cumulative set of results containing the
sum of data from the individual report files.
--timeout <N> Ignore files which take more than <N> seconds
to process at any of the language's filter stages.
The default maximum number of seconds spent on a
filter stage is the number of lines in the file
divided by one thousand. Setting <N> to 0 allows
unlimited time. See also --diff-timeout.
--processes=NUM [Available only on systems with a recent version
of the Parallel::ForkManager module. Not
available on Windows.] Sets the maximum number of
cores that cloc uses. The default value of 0
disables multiprocessing.
--unix Override the operating system autodetection
logic and run in UNIX mode. See also
--windows, --show-os.
--use-sloccount If SLOCCount is installed, use its compiled
executables c_count, java_count, pascal_count,
php_count, and xml_count instead of cloc's
counters. SLOCCount's compiled counters are
substantially faster than cloc's and may give
a performance improvement when counting projects
with large files. However, these cloc-specific
features will not be available: --diff,
--count-and-diff, --strip-comments, --unicode.
--windows Override the operating system autodetection
logic and run in Microsoft Windows mode.
See also --unix, --show-os.
Filter Options
--include-content=<regex> Only count files containing text that matches the
given regular expression.
--exclude-content=<regex> Exclude files containing text that matches the given
regular expression.
--exclude-dir=<D1>[,D2,] Exclude the given comma separated directories
D1, D2, D3, et cetera, from being scanned. For
example --exclude-dir=.cache,test will skip
all files and subdirectories that have /.cache/
or /test/ as their parent directory.
Directories named .bzr, .cvs, .hg, .git, .svn,
and .snapshot are always excluded.
This option only works with individual directory
names so including file path separators is not
allowed. Use --fullpath and --not-match-d=<regex>
to supply a regex matching multiple subdirectories.
--exclude-ext=<ext1>[,<ext2>[...]]
Do not count files having the given file name
extensions.
--exclude-lang=<L1>[,L2[...]]
Exclude the given comma separated languages
L1, L2, L3, et cetera, from being counted.
--exclude-list-file=<file> Ignore files and/or directories whose names
appear in <file>. <file> should have one file
name per line. Only exact matches are ignored;
relative path names will be resolved starting from
the directory where cloc is invoked.
See also --list-file.
--fullpath Modifies the behavior of --match-f, --not-match-f,
and --not-match-d to include the file's path
in the regex, not just the file's basename.
(This does not expand each file to include its
absolute path, instead it uses as much of
the path as is passed in to cloc.)
Note: --match-d always looks at the full
path and therefore is unaffected by --fullpath.
--include-ext=<ext1>[,ext2[...]]
Count only languages having the given comma
separated file extensions. Use --show-ext to
see the recognized extensions.
--include-lang=<L1>[,L2[...]]
Count only the given comma separated languages
L1, L2, L3, et cetera. Use --show-lang to see
the list of recognized languages.
--match-d=<regex> Only count files in directories matching the Perl
regex. For example
--match-d='/(src|include)/'
only counts files in directories containing
/src/ or /include/. Unlike --not-match-d,
--match-f, and --not-match-f, --match-d always
compares the fully qualified path against the
regex.
--not-match-d=<regex> Count all files except those in directories
matching the Perl regex. Only the trailing
directory name is compared, for example, when
counting in /usr/local/lib, only 'lib' is
compared to the regex.
Add --fullpath to compare parent directories to
the regex.
Do not include file path separators at the
beginning or end of the regex.
--match-f=<regex> Only count files whose basenames match the Perl
regex. For example
--match-f='^[Ww]idget'
only counts files that start with Widget or widget.
Add --fullpath to include parent directories
in the regex instead of just the basename.
--not-match-f=<regex> Count all files except those whose basenames
match the Perl regex. Add --fullpath to include
parent directories in the regex instead of just
the basename.
--skip-archive=<regex> Ignore files that end with the given Perl regular
expression. For example, if given
--skip-archive='(zip|tar(.(gz|Z|bz2|xz|7z))?)'
the code will skip files that end with .zip,
.tar, .tar.gz, .tar.Z, .tar.bz2, .tar.xz, and
.tar.7z.
--skip-win-hidden On Windows, ignore hidden files.
Debug Options
--categorized=<file> Save file sizes in bytes, identified languages
and names of categorized files to <file>.
--counted=<file> Save names of processed source files to <file>.
--diff-alignment=<file> Write to <file> a list of files and file pairs
showing which files were added, removed, and/or
compared during a run with --diff. This switch
forces the --diff mode on.
--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.
--help Print this usage information and exit.
--found=<file> Save names of every file found to <file>.
--ignored=<file> Save names of ignored files and the reason they
were ignored to <file>.
--print-filter-stages Print processed source code before and after
each filter is applied.
--show-ext[=<ext>] Print information about all known (or just the
given) file extensions and exit.
--show-lang[=<lang>] Print information about all known (or just the
given) languages and exit.
--show-os Print the value of the operating system mode
and exit. See also --unix, --windows.
-v[=<n>] Verbose switch (optional numeric value).
-verbose[=<n>] Long form of -v.
--version Print the version of this program and exit.
--write-lang-def=<file> Writes to <file> the language processing filters
then exits. Useful as a first step to creating
custom language definitions. Note: languages which
map to the same file extension will be excluded.
(See also --force-lang-def, --read-lang-def).
--write-lang-def-incl-dup=<file>
Same as --write-lang-def, but includes duplicated
extensions. This generates a problematic language
definition file because cloc will refuse to use
it until duplicates are removed.
Output Options
--3 Print third-generation language output.
(This option can cause report summation to fail
if some reports were produced with this option
while others were produced without it.)
--by-percent X Instead of comment and blank line counts, show
these values as percentages based on the value
of X in the denominator:
X = 'c' -> # lines of code
X = 'cm' -> # lines of code + comments
X = 'cb' -> # lines of code + blanks
X = 'cmb' -> # lines of code + comments + blanks
For example, if using method 'c' and your code
has twice as many lines of comments as lines
of code, the value in the comment column will
be 200%. The code column remains a line count.
--csv Write the results as comma separated values.
--csv-delimiter=<C> Use the character <C> as the delimiter for comma
separated files instead of ,. This switch forces --csv to be on.
--file-encoding=<E> Write output files using the <E> encoding instead of
the default ASCII (<E> = 'UTF-7'). Examples: 'UTF-16',
'euc-kr', 'iso-8859-16'. Known encodings can be
printed with
perl -MEncode -e 'print join("\n", Encode->encodings(":all")), "\n"'
--hide-rate Do not show line and file processing rates in the
output header. This makes output deterministic.
--json Write the results as JavaScript Object Notation
(JSON) formatted output.
--md Write the results as Markdown-formatted text.
--out=<file> Synonym for --report-file=<file>.
--percent Show counts as percentages of sums for each column.
Same as '--by-percent t'.
--progress-rate=<n> Show progress update after every <n> files are
processed (default <n>=100). Set <n> to 0 to
suppress progress output (useful when redirecting
output to STDOUT).
--quiet Suppress all information messages except for
the final report.
--report-file=<file> Write the results to <file> instead of STDOUT.
--sql=<file> Write results as SQL create and insert statements
which can be read by a database program such as
SQLite. If <file> is -, output is sent to STDOUT.
--sql-append Append SQL insert statements to the file specified
by --sql and do not generate table creation
statements. Only valid with the --sql option.
--sql-project=<name> Use <name> as the project identifier for the
current run. Only valid with the --sql option.
--sql-style=<style> Write SQL statements in the given style instead
of the default SQLite format. Styles include
'Oracle' and 'Named_Columns'.
--sum-one For plain text reports, show the SUM: output line
even if only one input file is processed.
--thousands-delimiter=<C> Divides numbers with many digits (i.e. numbers
over 999) into groups using the character <C> as
delimiter (e.g. for <C> = '.': 12345 -> 12.345).
Only works with the '--fmt' option.
Sample values: '.', ',', '_', ' '
Synonym: --ksep
--xml Write the results in XML.
--xsl=<file> Reference <file> as an XSL stylesheet within
the XML output. If <file> is 1 (numeric one),
writes a default stylesheet, cloc.xsl (or
cloc-diff.xsl if --diff is also given).
This switch forces --xml on.
--yaml Write the results in YAML.
```
</details>
# Recognized Languages
<details>
<summary>Full language list (<code>cloc --show-lang</code>) (click the triangle to see all languages)</summary>
```
prompt> cloc --show-lang
Language Extension(s)
-------------------- ----------------------------------------
ABAP (abap)
ActionScript (as)
Activiti Business Process (bpmn)
Ada (ada, adb, ads, pad)
ADSO/IDSM (adso)
Agda (agda, lagda)
AMPLE (ample, dofile, startup)
AnsProlog (lp)
Ant (build.xml, build.xml)
ANTLR Grammar (g, g4)
Apex Class (cls)
Apex Trigger (trigger)
APL (apl, apla, aplc, aplf, apli, apln, aplo, dyalog, dyapp, mipage)
AppleScript (applescript)
Arduino Sketch (ino)
Aria (aria)
ArkTs (ets)
Arturo (art)
AsciiDoc (adoc, asciidoc)
ASP (asa, ashx, asp, axd)
ASP.NET (asax, ascx, asmx, aspx, master, sitemap, webinfo)
AspectJ (aj)
Assembly (a51, asm, nasm, S, s)
Astro (astro)
Asymptote (asy)
AutoHotkey (ahk, ahkl)
awk (auk, awk, gawk, mawk, nawk)
AXAML (axaml)
Bazel (BUILD)
Beluga (bel)
Bicep (bicep, bicepparam)
BitBake (bb, bbappend, bbclass)
BizTalk Orchestration (odx)
BizTalk Pipeline (btp)
Blade (blade, blade.php)
Blueprint (blp)
Bourne Again Shell (bash)
Bourne Shell (sh)
BrightScript (brs)
builder (xml.builder)
C (c, cats, ec, idc, pgc)
C Shell (csh, tcsh)
C# (cs)
C# Designer (designer.cs)
C++ (C, c++, c++m, cc, ccm, CPP, cpp, cppm, cxx, cxxm, h++, inl, ipp,
ixx, pcc, tcc, tpp)
C/C++ Header (H, h, hh, hpp, hxx)
Cadence (cdc)
Cairo (cairo)
Cake Build Script (cake)
Cangjie (cj)
Carbon (carbon)
CCS (ccs)
Chapel (chpl)
Circom (circom)
Civet (civet, cvt, cvtx)
Clarity (clar)
Clean (dcl, icl)
Clojure (boot, cl2, clj, cljs.hl, cljscm, cljx, hic, riemann.config, cj)
ClojureC (cljc)
ClojureScript (cljs)
CMake (cmake, cmake.in, CMakeLists.txt)
COBOL (CBL, cbl, ccp, COB, cob, cobol, cpy)
CoCoA 5 (c5, cocoa5, cocoa5server, cpkg5)
CodeQL (ql, qll)
CoffeeScript (_coffee, cakefile, cjsx, coffee, iced)
ColdFusion (cfm, cfml)
ColdFusion CFScript (cfc)
Constraint Grammar (cg3, rlx)
Containerfile (Containerfile)
Coq (v)
Crystal (cr)
CSON (cson)
CSS (css)
CSV (csv)
Cucumber (feature)
CUDA (cu, cuh)
Cython (pxd, pxi, pyx)
D (d)
Dafny (dfy)
DAL (da)
Dart (dart)
Delphi Form (dfm)
DenizenScript (dsc)
Derw (derw)
dhall (dhall)
DIET (dt)
diff (diff, patch)
DITA (dita)
Dockerfile (Dockerfile, dockerfile)
DOORS Extension Language (dxl)
DOS Batch (BAT, bat, BTM, btm, CMD, cmd)
Drools (drl)
DTD (dtd)
dtrace (d)
ECPP (ecpp)
EEx (eex)
EJS (ejs)
Elixir (ex)
Elixir Script (exs)
Elm (elm)
Embedded Crystal (ecr)
ERB (ERB, erb)
Erlang (app.src, emakefile, erl, hrl, rebar.config, rebar.config.lock,
rebar.lock, xrl, yrl)
Expect (exp)
F# (fsi, fs, fs)
F# Script (fsx)
Fennel (fnl)
Finite State Language (fsl, jssm)
Fish Shell (fish)
Flatbuffers (fbs)
Focus (focexec)
Forth (4th, e4, f83, fb, forth, fpm, fr, frt, ft, fth, rx, fs, f, for)
Fortran 2003 (F03, f03)
Fortran 77 (F, F77, f77, FOR, FTN, ftn, pfo, f, for)
Fortran 90 (F90, f90)
Fortran 95 (F95, f95)
Freemarker Template (ftl)
Futhark (fut)
FXML (fxml)
GDScript (gd)
Gencat NLS (msg)
Glade (glade, ui)
Gleam (gleam)
Glimmer JavaScript (gjs)
Glimmer TypeScript (gts)
GLSL (comp, fp, frag, frg, fsh, fshader, geo, geom, glsl, glslv, gshader,
tesc, tese, vert, vrx, vsh, vshader)
Go (go, ʕ◔ϖ◔ʔ)
Godot Resource (tres)
Godot Scene (tscn)
Godot Shaders (gdshader)
Gradle (gradle, gradle.kts)
Grails (gsp)
GraphQL (gql, graphql, graphqls)
Groovy (gant, groovy, grt, gtpl, gvy, jenkinsfile)
Haml (haml, haml.deface)
Handlebars (handlebars, hbs)
Harbour (hb)
Hare (ha)
Haskell (hs, hsc, lhs)
Haskell Boot (hs-boot, lhs-boot)
Haxe (hx, hxsl)
HCL (hcl, nomad, tf, tfvars)
Hibernate (hbm.xml)
HLSL (cg, cginc, fxh, hlsl, hlsli, shader)
HolyC (HC)
Hoon (hoon)
HTML (htm, html, html.hl, xht)
HTML EEx (heex)
IDL (dlm, idl, pro)
Idris (idr)
Igor Pro (ipf)
Imba (imba)
INI (buildozer.spec, editorconfig, ini, lektorproject, prefs)
InstallShield (ism)
IPL (ipl)
Jai (jai)
Janet (janet)
Jasper Report XML/Template (jrxml)
Java (java)
JavaScript (_js, bones, cjs, es6, jake, jakefile, js, jsb, jscad, jsfl, jsm,
jss, mjs, njs, pac, sjs, ssjs, xsjs, xsjslib)
JavaServer Faces (jsf)
JCL (jcl)
Jinja Template (j2, jinja, jinja2)
JSON (arcconfig, avsc, composer.lock, geojson, gltf, har, htmlhintrc,
json, json-tmlanguage, jsonl, mcmeta, mcmod.info, tern-config,
tern-project, tfstate, tfstate.backup, topojson, watchmanconfig,
webapp, webmanifest, yyp)
JSON5 (json5)
Jsonnet (jsonnet)
JSP (jsp, jspf)
JSP Tag Library Definition (tld)
JSX (jsx)
Julia (jl)
Juniper Junos (junos)
Jupyter Notebook (ipynb)
Justfile (just)
Kermit (ksc)
Korn Shell (ksh)
Kotlin (kt, ktm, kts)
kvlang (kv)
Lean (hlean, lean)
Lem (lem)
LESS (less)
lex (l, lex)
LFE (lfe)
Linker Script (ld)
Liquibase (lb.xml)
liquid (liquid)
Lisp (asd, el, lisp, lsp, cl, jl)
Literate Idris (lidr)
LiveLink OScript (oscript)
LLVM IR (ll)
Logos (x, xm)
Logtalk (lgt, logtalk)
Lua (lua, nse, p8, pd_lua, rbxs, wlua)
Luau (luau)
m4 (ac, m4)
Magik (magik)
make (am, Gnumakefile, gnumakefile, Makefile, makefile, mk)
Mako (mako, mao)
Markdown (contents.lr, markdown, md, mdown, mdwn, mdx, mkd, mkdn, mkdown,
ronn, workbook)
Mathematica (cdf, ma, mathematica, mt, nbp, wl, wlt, m)
MATLAB (m)
Maven (pom, pom.xml)
Meson (meson.build)
Metal (metal)
Modelica (mo)
Modula3 (i3, ig, m3, mg)
Mojo (mojo, 🔥)
Mojom (mojom)
MoonBit (mbt, mbti, mbtx, mbty)
MSBuild script (btproj, csproj, msbuild, vcproj, wdproj, wixproj)
MUMPS (mps, m)
Mustache (mustache)
MXML (mxml)
NAnt script (build)
NASTRAN DMAP (dmap)
Nemerle (n)
NetLogo (nlogo, nls)
Nextflow (nf)
Nickel (ncl)
Nim (nim, nim.cfg, nimble, nimrod, nims)
Nix (nix)
Nunjucks (njk)
Nushell (nu)
Nushell Object Notation (nuon)
Objective-C (m)
Objective-C++ (mm)
OCaml (eliom, eliomi, ml, ml4, mli, mll, mly)
Odin (odin)
OpenCL (cl)
OpenSCAD (scad)
Oracle Forms (fmt)
Oracle PL/SQL (bdy, bod, fnc, prc, spc, trg)
Oracle Reports (rex)
Org Mode (org)
P4 (p4)
Pascal (dpr, lpr, pas, pascal)
Pascal/Pawn (p)
Pascal/Puppet (pp)
Patran Command Language (pcl, ses)
Pawn (pawn, pwn)
PEG (peg)
peg.js (pegjs)
peggy (peggy)
Pek (pek)
Perl (ack, al, cpanfile, makefile.pl, perl, ph, plh, plx, pm, psgi,
rexfile, pl, p6)
Pest (pest)
PHP (aw, ctp, phakefile, php, php3, php4, php5, php_cs, php_cs.dist, phps,
phpt, phtml)
PHP/Pascal/Fortran/Pawn/BitBake (inc)
Pig Latin (pig)
Pkl (pkl)
PL/I (pl1)
PL/M (lit, plm)
PlantUML (iuml, plantuml, pu, puml, wsd)
PO File (po)
Pony (pony)
PowerBuilder (pbt, sra, srf, srm, srs, sru, srw)
PowerShell (ps1, psd1, psm1)
Prisma Schema (prisma)
Processing (pde)
ProGuard (pro)
Prolog (P, prolog, yap, pl, p6, pro)
Properties (properties)
Protocol Buffers (proto)
PRQL (prql)
Pug (jade, pug)
PureScript (purs)
Python (buck, build.bazel, gclient, gyp, gypi, lmi, py, py3, pyde, pyi, pyp,
pyt, pyw, sconscript, sconstruct, snakefile, tac, workspace, wscript,
wsgi, xpy)
QML (qbs, qml)
Qt Linguist (ts)
Qt Project (pro)
R (expr-dist, R, r, rd, rprofile, rsx)
Racket (rkt, rktd, rktl, scrbl)
Raku (pm6, raku, rakumod)
Raku/Prolog (P6, p6)
RAML (raml)
RapydScript (pyj)
Razor (cshtml, razor)
ReasonML (re, rei)
Rego (rego)
ReScript (res, resi)
reStructuredText (rest, rest.txt, rst, rst.txt)
Rexx (pprx, rexx)
Ring (rform, rh, ring)
Rmd (Rmd)
RobotFramework (robot)
Ruby (appraisals, berksfile, brewfile, builder, buildfile, capfile,
dangerfile, deliverfile, eye, fastfile, gemfile, gemfile.lock,
gemspec, god, guardfile, irbrc, jarfile, jbuilder, mavenfile,
mspec, podfile, podspec, pryrc, puppetfile, rabl, rake, rb,
rbuild, rbw, rbx, ru, snapfile, thor, thorfile, vagrantfile, watchr)
Ruby HTML (rhtml)
Rust (rs, rs.in)
SaltStack (sls)
SAS (sas)
Sass (sass)
Scala (kojo, sbt, scala)
Scheme (sc, sch, scm, sld, sps, ss, sls)
SCSS (scss)
sed (sed)
SKILL++ (ils)
SKILL/.NET IL (il)
Slice (ice)
Slim (slim)
Slint (slint)
Smalltalk (st, cs)
Smarty (smarty, tpl)
Snakemake (rules, smk)
Softbridge Basic (SBL, sbl)
Solidity (sol)
SparForte (sp)
Specman e (e)
SQL (cql, mysql, psql, SQL, sql, tab, udf, viw)
SQL Data (data.sql)
SQL Stored Procedure (spc.sql, spoc.sql, sproc.sql, udf.sql)
Squirrel (nut)
Standard ML (fun, sig, sml)
Starlark (bazel, bzl)
Stata (ado, DO, do, doh, ihlp, mata, matah, sthlp)
Stylus (styl)
SugarSS (sss)
SurrealQL (surql)
Svelte (svelte)
SVG (SVG, svg)
Swift (swift)
SWIG (i)
TableGen (td)
Tcl/Tk (itk, tcl, tk)
TEAL (teal)
Teamcenter met (met)
Teamcenter mth (mth)
Templ (templ)
TeX (aux, bbx, bib, bst, cbx, dtx, ins, lbx, ltx, mkii, mkiv, mkvi,
sty, tex, cls)
Text (text, txt)
Thrift (thrift)
TITAN Project File Information (tpd)
Titanium Style Sheet (tss)
TLA+ (tla)
TNSDL (cii, cin, in1, in2, in3, in4, inf, interface, rou, sdl, sdt,
spd, ssc, sst)
TOML (toml)
tspeg (jspeg, tspeg)
TTCN (ttcn, ttcn2, ttcn3, ttcnpp)
Twig (twig)
TypeScript (cts, mts, tsx, ts)
Typst (typ)
Umka (um)
Unity-Prefab (mat, prefab)
Unknown/BitBake (conf)
USS (uss)
UXML (uxml)
Vala (vala)
Vala Header (vapi)
VBA (VBA, vba)
VBScript (VBS, vbs)
Velocity Template Language (vm)
Verilog-SystemVerilog (sv, svh, v)
VHDL (VHD, vhd, VHDL, vhdl, vhf, vhi, vho, vhs, vht, vhw)
vim script (vim)
Visual Basic (BAS, bas, ctl, Dsr, dsr, frm, FRX, frx, vbp, vbw, cls)
Visual Basic .NET (VB, vb, VBHTML, vbhtml, vbproj)
Visual Fox Pro (SCA, sca)
Visual Studio Solution (sln)
Visualforce Component (component)
Visualforce Page (page)
VSCode Workspace (code-workspace)
Vuejs Component (vue)
Vyper (vy)
Web Services Description (wsdl)
WebAssembly (wast, wat)
WGSL (wgsl)
Windows Message File (mc)
Windows Module Definition (def)
Windows Resource File (rc, rc2)
WiX include (wxi)
WiX source (wxs)
WiX string localization (wxl)
WXML (wxml)
WXSS (wxss)
X++ (xpo)
XAML (xaml)
xBase (prg, prw)
xBase Header (ch)
XHTML (xhtml)
XMI (XMI, xmi)
XML (adml, admx, ant, app.config, axml, builds, ccproj, ccxml,
classpath, clixml, cproject, cscfg, csdef, csl, ct, depproj,
ditamap, ditaval, dll.config, dotsettings, filters, fsproj,
gmx, grxml, iml, ivy, jelly, jsproj, kml, launch, mdpolicy,
mjml, natvis, ndproj, nproj, nuget.config, nuspec, odd, osm,
packages.config, pkgproj, plist, proj, project, props, ps1xml,
psc1, pt, rdf, resx, rss, scxml, settings.stylecop, sfproj,
shproj, srdf, storyboard, sttheme, sublime-snippet, targets,
tmcommand, tml, tmlanguage, tmpreferences, tmsnippet, tmtheme,
urdf, ux, vcxproj, vsixmanifest, vssettings, vstemplate, vxml,
web.config, web.debug.config, web.release.config, wsf, x3d,
xacro, xib, xlf, xliff, XML, xml, xml.dist, xproj, xspec, xul,
zcml)
XML-Qt-GTK (ui)
XQuery (xq, xql, xqm, xquery, xqy)
XSD (XSD, xsd)
XSLT (XSL, xsl, XSLT, xslt)
Xtend (xtend)
yacc (y, yacc)
YAML (clang-format, clang-tidy, gemrc, glide.lock, mir, reek, rviz,
sublime-syntax, syntax, yaml, yaml-tmlanguage, yml, yml.mysql)
Yang (yang)
Yarn (yarn)
Zig (zig)
zsh (zsh)
```
</details>
The above list can be customized by reading language definitions from a
file with the `--read-lang-def` or `--force-lang-def` options.
These file extensions map to multiple languages:
* `cj` files could be Clojure or Cangjie
* `cl` files could be Lisp or OpenCL
* `cls` files could be Visual Basic, TeX or Apex Class
* `conf` files could be BitBake or plain text
* `cs` files could be C# or Smalltalk
* `d` files could be D or dtrace
* `f` files could be Fortran 77 or Forth
* `fnc` files could be Oracle PL or SQL
* `for` files could be Fortran 77 or Forth
* `fs` files could be F# or Forth
* `inc` files could be PHP, Pascal or BitBake
* `itk` files could be Tcl or Tk
* `jl` files could be Lisp or Julia
* `lit` files could be PL or M
* `m` files could be MATLAB, Mathematica, Objective-C, MUMPS or Mercury
* `p6` files could be Perl or Prolog
* `pl` files could be Perl or Prolog
* `PL` files could be Perl or Prolog
* `pp` files could be Pascal or Puppet
* `pro` files could be IDL, Qt Project, Prolog or ProGuard
* `ts` files could be TypeScript or Qt Linguist
* `ui` files could be Qt or Glade
* `v` files could be Verilog-SystemVerilog or Coq
cloc has subroutines that attempt to identify the correct language based
on the file's contents for these special cases. Language identification
accuracy is a function of how much code the file contains; .m files with
just one or two lines for example, seldom have enough information to
correctly distinguish between MATLAB, Mercury, MUMPS, or Objective-C.
Languages with file extension collisions are difficult to customize with
`--read-lang-def` or `--force-lang-def` as they have no mechanism to
identify languages with common extensions. In this situation one must
modify the cloc source code.
# How It Works
cloc's method of operation resembles SLOCCount's: First, create a list
of files to consider. Next, attempt to determine whether or not found
files contain recognized computer language source code. Finally, for
files identified as source files, invoke language-specific routines to
count the number of source lines.
A more detailed description:
1. If the input file is an archive (such as a .tar.gz or .zip file),
create a temporary directory and expand the archive there using a
system call to an appropriate underlying utility (tar, bzip2, unzip,
etc) then add this temporary directory as one of the inputs. (This
works more reliably on Unix than on Windows.)
2. Use File::Find to recursively descend the input directories and make
a list of candidate file names. Ignore binary and zero-sized files.
3. Make sure the files in the candidate list have unique contents
(first by comparing file sizes, then, for similarly sized files,
compare MD5 hashes of the file contents with Digest::MD5). For each
set of identical files, remove all but the first copy, as determined
by a lexical sort, of identical files from the set. The removed
files are not included in the report. (The `--skip-uniqueness` switch
disables the uniqueness tests and forces all copies of files to be
included in the report.) See also the `--ignored=` switch to see which
files were ignored and why.
4. Scan the candidate file list for file extensions which cloc
associates with programming languages (see the `--show-lang` and
`--show-ext` options). Files which match are classified as
containing source
code for that language. Each file without an extension is opened
and its first line read to see if it is a Unix shell script
(anything that begins with #!). If it is shell script, the file is
classified by that scripting language (if the language is
recognized). If the file does not have a recognized extension or is
not a recognized scripting language, the file is ignored.
5. All remaining files in the candidate list should now be source files
for known programming languages. For each of these files:
1. Read the entire file into memory.
2. Count the number of lines (= L<sub>original</sub>).
3. Remove blank lines, then count again (= L<sub>non_blank</sub>).
4. Loop over the comment filters defined for this language. (For
example, C++ has two filters: (1) remove lines that start with
optional whitespace followed by // and (2) remove text between
/* and */) Apply each filter to the code to remove comments.
Count the left over lines (= L<sub>code</sub>).
5. Save the counts for this language:
* blank lines = L<sub>original</sub> - L<sub>non_blank</sub>
* comment lines = L<sub>non_blank</sub> - L<sub>code</sub>
* code lines = L<sub>code</sub>
The options modify the algorithm slightly. The `--read-lang-def` option
for example allows the user to read definitions of comment filters,
known file extensions, and known scripting languages from a file. The
code for this option is processed between Steps 2 and 3.
# Advanced Use
## Remove Comments from Source Code
How can you tell if cloc correctly identifies comments? One way to
convince yourself cloc is doing the right thing is to use its
`--strip-comments` option to remove comments and blank lines from files, then
compare the stripped-down files to originals.
Let's try this out with the SQLite amalgamation, a C file containing all
code needed to build the SQLite library along with a header file:
```
prompt> tar zxf sqlite-amalgamation-3.5.6.tar.gz
prompt> cd sqlite-3.5.6/
prompt> cloc --strip-comments=nc sqlite.c
1 text file.
1 unique file.
Wrote sqlite3.c.nc
0 files ignored.
http://cloc.sourceforge.net v 1.03 T=1.0 s (1.0 files/s, 82895.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code scale 3rd gen. equiv
-------------------------------------------------------------------------------
C 1 5167 26827 50901 x 0.77 = 39193.77
-------------------------------------------------------------------------------
```
The extension argument given to --strip-comments is arbitrary; here nc was used as an abbreviation for "no comments".
cloc removed over 31,000 lines from the file:
```
prompt> wc -l sqlite3.c sqlite3.c.nc
82895 sqlite3.c
50901 sqlite3.c.nc
133796 total
prompt> echo "82895 - 50901" | bc
31994
```
We can now compare the original file, sqlite3.c and the one stripped of
comments, sqlite3.c.nc with tools like diff or vimdiff and see what
exactly cloc considered comments and blank lines. A rigorous proof that
the stripped-down file contains the same C code as the original is to
compile these files and compare checksums of the resulting object files.
First, the original source file:
```
prompt> gcc -c sqlite3.c
prompt> md5sum sqlite3.o
cce5f1a2ea27c7e44b2e1047e2588b49 sqlite3.o
```
Next, the version without comments:
```
prompt> mv sqlite3.c.nc sqlite3.c
prompt> gcc -c sqlite3.c
prompt> md5sum sqlite3.o
cce5f1a2ea27c7e44b2e1047e2588b49 sqlite3.o
```
cloc removed over 31,000 lines of comments and blanks but did not modify the source code in any significant way since the resulting object file matches the original.
## Work with Compressed Archives
Versions of cloc before v1.07 required an
`--extract-with=CMD` option to tell cloc how
to expand an archive file. Beginning with v1.07 this is extraction is
attempted automatically. At the moment the automatic extraction method works
reasonably well on Unix-type OS's for the following file types:
`.tar.gz`,
`.tar.bz2`,
`.tar.xz`,
`.tgz`,
`.zip`,
`.ear`,
`.deb`.
Some of these extensions work on Windows if one has WinZip installed
in the default location (`C:\Program Files\WinZip\WinZip32.exe`).
Additionally, with newer versions of WinZip, the
[http://www.winzip.com/downcl.htm](command line add-on)
is needed for correct operation; in this case one would invoke cloc with
something like
```
--extract-with="\"c:\Program Files\WinZip\wzunzip\" -e -o >FILE< ."
</code>
```
Ref. http://sourceforge.net/projects/cloc/forums/forum/600963/topic/4021070?message=8938196
In situations where the automatic extraction fails, one can try the
`--extract-with=CMD`
option to count lines of code within tar files, Zip files, or
other compressed archives for which one has an extraction tool.
cloc takes the user-provided extraction command and expands the archive
to a temporary directory (created with File::Temp),
counts the lines of code in the temporary directory,
then removes that directory. While not especially helpful when dealing
with a single compressed archive (after all, if you're going to type
the extraction command anyway why not just manually expand the archive?)
this option is handy for working with several archives at once.
For example, say you have the following source tarballs on a Unix machine
perl-5.8.5.tar.gz
Python-2.4.2.tar.gz
and you want to count all the code within them. The command would be
```
cloc --extract-with='gzip -dc >FILE< | tar xf -' perl-5.8.5.tar.gz Python-2.4.2.tar.gz
```
If that Unix machine has GNU tar (which can uncompress and extract in
one step) the command can be shortened to
```
cloc --extract-with='tar zxf >FILE<' perl-5.8.5.tar.gz Python-2.4.2.tar.gz
```
On a Windows computer with WinZip installed in
`c:\Program Files\WinZip` the command would look like
```
cloc.exe --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o >FILE< ." perl-5.8.5.tar.gz Python-2.4.2.tar.gz
```
Java `.ear` files are Zip files that contain additional Zip
files. cloc can handle nested compressed archives without
difficulty--provided all such files are compressed and archived in the
same way. Examples of counting a
Java `.ear` file in Unix and Windows:
```
Unix> cloc --extract-with="unzip -d . >FILE< " Project.ear
DOS> cloc.exe --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o >FILE< ." Project.ear
```
## Differences
The `--diff` switch allows one to measure the relative change in
source code and comments between two versions of a file, directory,
or archive. Differences reveal much more than absolute code
counts of two file versions. For example, say a source file
has 100 lines and its developer delivers a newer version with
102 lines. Did the developer add two comment lines,
or delete seventeen source
lines and add fourteen source lines and five comment lines, or did
the developer
do a complete rewrite, discarding all 100 original lines and
adding 102 lines of all new source? The diff option tells how
many lines of source were added, removed, modified or stayed
the same, and how many lines of comments were added, removed,
modified or stayed the same.
Differences in blank lines are handled much more coarsely
because these are stripped by cloc early on. Unless a
file pair is identical, cloc will report only differences
in absolute counts of blank lines. In other words, one
can expect to see only entries for 'added' if the second
file has more blanks than the first, and 'removed' if the
situation is reversed. The entry for 'same' will be non-zero
only when the two files are identical.
In addition to file pairs, one can give cloc pairs of
directories, or pairs of file archives, or a file archive
and a directory. cloc will try to align
file pairs within the directories or archives and compare diffs
for each pair. For example, to see what changed between
GCC 4.4.0 and 4.5.0 one could do
```
cloc --diff gcc-4.4.0.tar.bz2 gcc-4.5.0.tar.bz2
```
Be prepared to wait a while for the results though; the `--diff`
option runs much more slowly than an absolute code count.
To see how cloc aligns files between the two archives, use the
`--diff-alignment` option
```
cloc --diff-alignment=align.txt gcc-4.4.0.tar.bz2 gcc-4.5.0.tar.bz2
```
to produce the file `align.txt` which shows the file pairs as well
as files added and deleted. The symbols `==` and `!=` before each
file pair indicate if the files are identical (`==`)
or if they have different content (`!=`).
Here's sample output showing the difference between the Python 2.6.6 and 2.7
releases:
```
prompt> cloc --diff Python-2.7.9.tgz Python-2.7.10.tar.xz
4315 text files.
4313 text files.s
2173 files ignored.
4 errors:
Diff error, exceeded timeout: /tmp/8ToGAnB9Y1/Python-2.7.9/Mac/Modules/qt/_Qtmodule.c
Diff error, exceeded timeout: /tmp/M6ldvsGaoq/Python-2.7.10/Mac/Modules/qt/_Qtmodule.c
Diff error (quoted comments?): /tmp/8ToGAnB9Y1/Python-2.7.9/Mac/Modules/qd/qdsupport.py
Diff error (quoted comments?): /tmp/M6ldvsGaoq/Python-2.7.10/Mac/Modules/qd/qdsupport.py
https://github.com/AlDanial/cloc v 1.65 T=298.59 s (0.0 files/s, 0.0 lines/s)
-----------------------------------------------------------------------------
Language files blank comment code
-----------------------------------------------------------------------------
Visual Basic
same 2 0 1 12
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
make
same 11 0 340 2952
modified 1 0 0 1
added 0 0 0 0
removed 0 0 0 0
diff
same 1 0 87 105
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
CSS
same 0 0 19 327
modified 1 0 0 1
added 0 0 0 0
removed 0 0 0 0
Objective-C
same 7 0 61 635
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
NAnt script
same 2 0 0 30
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
XML
same 3 0 2 72
modified 1 0 0 1
added 0 0 0 1
removed 0 1 0 0
Windows Resource File
same 3 0 56 206
modified 1 0 0 1
added 0 0 0 0
removed 0 0 0 0
Expect
same 6 0 161 565
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
HTML
same 14 0 11 2344
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
vim script
same 1 0 7 106
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
C++
same 2 0 18 128
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
Windows Module Definition
same 7 0 187 2080
modified 2 0 0 0
added 0 0 0 1
removed 0 1 0 2
Prolog
same 1 0 0 24
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
Javascript
same 3 0 49 229
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
Assembly
same 51 0 6794 12298
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
Bourne Shell
same 41 0 7698 45024
modified 1 0 0 3
added 0 13 2 64
removed 0 0 0 0
DOS Batch
same 29 0 107 494
modified 1 0 0 9
added 0 1 0 3
removed 0 0 0 0
MSBuild script
same 77 0 3 38910
modified 0 0 0 0
added 0 0 0 0
removed 0 0 0 0
Python
same 1947 0 109012 430335
modified 192 0 94 950
added 2 323 283 2532
removed 2 55 58 646
m4
same 18 0 191 15352
modified 1 0 0 2
added 1 31 0 205
removed 0 0 0 0
C
same 505 0 37439 347837
modified 45 0 13 218
added 0 90 33 795
removed 0 9 2 148
C/C++ Header
same 255 0 10361 66635
modified 5 0 5 7
added 0 1 3 300
removed 0 0 0 0
---------------------------------------------------------------------
SUM:
same 2986 0 172604 966700
modified 251 0 112 1193
added 3 459 321 3901
removed 2 66 60 796
---------------------------------------------------------------------
```
A pair of errors occurred.
The first pair was caused by timing out when computing diffs of the file
`Python-X/Mac/Modules/qt/_Qtmodule.c` in each Python version.
This file has > 26,000 lines of C code and takes more than
10 seconds--the default maximum duration for diff'ing a
single file--on my slow computer. (Note: this refers to
performing differences with
the `sdiff()` function in the Perl `Algorithm::Diff` module,
not the command line `diff` utility.) This error can be
overcome by raising the time to, say, 20 seconds
with `--diff-timeout 20`.
The second error is more problematic. The files
`Python-X/Mac/Modules/qd/qdsupport.py`
include Python docstring (text between pairs of triple quotes)
containing C comments. cloc treats docstrings as comments and handles them
by first converting them to C comments, then using the C comment removing
regular expression. Nested C comments yield erroneous results however.
## Create Custom Language Definitions
cloc can write its language comment definitions to a file or can read
comment definitions from a file, overriding the built-in definitions.
This can be useful when you want to use cloc to count lines of a
language not yet included, to change association of file extensions
to languages, or to modify the way existing languages are counted.
The easiest way to create a custom language definition file is to
make cloc write its definitions to a file, then modify that file:
```
Unix> cloc --write-lang-def=my_definitions.txt
```
creates the file `my_definitions.txt` which can be modified
then read back in with either the `--read-lang-def` or
`--force-lang-def` option. The difference between the options is
former merges language definitions from the given file in with
cloc's internal definitions with cloc's taking precedence
if there are overlaps. The `--force-lang-def` option, on the
other hand, replaces cloc's definitions completely.
This option has a disadvantage in preventing cloc from counting
<a class="u" href="#extcollision" name="extcollision">
languages whose extensions map to multiple languages
</a> as these languages require additional logic that is not easily
expressed in a definitions file.
```
Unix> cloc --read-lang-def=my_definitions.txt file1 file2 dir1 ...
```
Each language entry has four parts:
* The language name starting in column 1.
* One or more comment *filters* starting in column 5.
* One or more filename extensions starting in column 5.
* A 3rd generation scale factor starting in column 5.
This entry must be provided
but its value is not important
unless you want to compare your language to a hypothetical
third generation programming language.
A filter defines a method to remove comment text from the source file.
For example the entry for C++ looks like this
```
C++
filter call_regexp_common C++
filter remove_inline //.*$
extension C
extension c++
extension cc
extension cpp
extension cxx
extension pcc
3rd_gen_scale 1.51
end_of_line_continuation \\$
```
C++ has two filters: first, remove lines matching
Regexp::Common's C++ comment regex.
The second filter using remove_inline is currently
unused. Its intent is to identify lines with both
code and comments and it may be implemented in the future.
A more complete discussion of the different filter options may appear
here in the future. The output of cloc's
`--write-lang-def` option should provide enough examples
for motivated individuals to modify or extend cloc's language definitions.
## Combine Reports
If you manage multiple software projects you might be interested in
seeing line counts by project, not just by language.
Say you manage three software projects called MariaDB, PostgreSQL, and SQLite.
The teams responsible for each of these projects run cloc on their
source code and provide you with the output.
For example, the MariaDB team does
```
cloc --out mariadb-10.1.txt mariadb-server-10.1.zip
```
and provides you with the file `mariadb-10.1.txt`.
The contents of the three files you get are
```
Unix> cat mariadb-10.1.txt
https://github.com/AlDanial/cloc v 1.65 T=45.36 s (110.5 files/s, 66411.4 lines/s)
-----------------------------------------------------------------------------------
Language files blank comment code
-----------------------------------------------------------------------------------
C++ 1613 225338 290077 983026
C 853 62442 73017 715018
C/C++ Header 1327 48300 114577 209394
Bourne Shell 256 10224 10810 61943
Perl 147 10342 8305 35562
Pascal 107 4907 5237 32541
HTML 56 195 6 16489
Javascript 5 3309 3019 15540
m4 30 1599 359 14215
CMake 190 1919 4097 12206
XML 35 648 56 5210
Ruby 59 619 184 4998
Puppet 10 0 1 3848
make 134 724 360 3631
SQL 23 306 377 3405
Python 34 371 122 2545
Bourne Again Shell 27 299 380 1604
Windows Module Definition 37 27 13 1211
lex 4 394 166 991
yacc 2 152 64 810
DOS Batch 19 89 82 700
Prolog 1 9 40 448
RobotFramework 1 0 0 441
CSS 2 33 155 393
JSON 5 0 0 359
dtrace 9 59 179 306
Windows Resource File 10 61 89 250
Assembly 2 70 284 237
WiX source 1 18 10 155
Visual Basic 6 0 0 88
YAML 2 4 4 65
PHP 1 11 2 24
SKILL 1 8 15 16
sed 2 0 0 16
Windows Message File 1 2 8 6
diff 1 1 4 4
D 1 4 11 4
-----------------------------------------------------------------------------------
SUM: 5014 372484 512110 2127699
-----------------------------------------------------------------------------------
Unix> cat sqlite-3081101.txt
https://github.com/AlDanial/cloc v 1.65 T=1.22 s (3.3 files/s, 143783.6 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 2 11059 53924 101454
C/C++ Header 2 211 6630 1546
-------------------------------------------------------------------------------
SUM: 4 11270 60554 103000
-------------------------------------------------------------------------------
Unix> cat postgresql-9.4.4.txt
https://github.com/AlDanial/cloc v 1.65 T=22.46 s (172.0 files/s, 96721.6 lines/s)
-----------------------------------------------------------------------------------
Language files blank comment code
-----------------------------------------------------------------------------------
HTML 1254 3725 0 785991
C 1139 139289 244045 736519
C/C++ Header 667 12277 32488 57014
SQL 410 13400 8745 51926
yacc 8 3163 2669 28491
Bourne Shell 41 2647 2440 17170
Perl 81 1702 1308 9456
lex 9 792 1631 4285
make 205 1525 1554 4114
m4 12 218 25 1642
Windows Module Definition 13 4 17 1152
XSLT 5 76 55 294
DOS Batch 7 29 30 92
CSS 1 20 7 69
Assembly 3 17 38 69
D 1 14 14 66
Windows Resource File 3 4 0 62
Lisp 1 1 1 16
sed 1 1 7 15
Python 1 5 0 13
Bourne Again Shell 1 8 6 10
Windows Message File 1 0 0 5
-----------------------------------------------------------------------------------
SUM: 3864 178917 295080 1698471
-----------------------------------------------------------------------------------
```
While these three files are interesting, you also want to see
the combined counts from all projects.
That can be done with cloc's `--sum_reports`
option:
```
Unix> cloc --sum-reports --out=databases mariadb-10.1.txt sqlite-3081101.txt postgresql-9.4.4.txt
Wrote databases.lang
Wrote databases.file
```
The report combination produces two output files, one for sums by
programming language (`databases.lang`) and one by project
(`databases.file`).
Their contents are
```
Unix> cat databases.lang
https://github.com/AlDanial/cloc v 1.65
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
C 1994 212790 370986 1552991
C++ 1613 225338 290077 983026
HTML 1310 3920 6 802480
C/C++ Header 1996 60788 153695 267954
Bourne Shell 297 12871 13250 79113
SQL 433 13706 9122 55331
Perl 228 12044 9613 45018
Pascal 107 4907 5237 32541
yacc 10 3315 2733 29301
m4 42 1817 384 15857
Javascript 5 3309 3019 15540
CMake 190 1919 4097 12206
make 339 2249 1914 7745
lex 13 1186 1797 5276
XML 35 648 56 5210
Ruby 59 619 184 4998
Puppet 10 0 1 3848
Python 35 376 122 2558
Windows Module Definition 50 31 30 2363
Bourne Again Shell 28 307 386 1614
DOS Batch 26 118 112 792
CSS 3 53 162 462
Prolog 1 9 40 448
RobotFramework 1 0 0 441
JSON 5 0 0 359
Windows Resource File 13 65 89 312
Assembly 5 87 322 306
dtrace 9 59 179 306
XSLT 5 76 55 294
WiX source 1 18 10 155
Visual Basic 6 0 0 88
D 2 18 25 70
YAML 2 4 4 65
sed 3 1 7 31
PHP 1 11 2 24
SKILL 1 8 15 16
Lisp 1 1 1 16
Windows Message File 2 2 8 11
diff 1 1 4 4
--------------------------------------------------------------------------------
SUM: 8882 562671 867744 3929170
--------------------------------------------------------------------------------
Unix> cat databases.file
----------------------------------------------------------------------------------
File files blank comment code
----------------------------------------------------------------------------------
mariadb-10.1.txt 5014 372484 512110 2127699
postgresql-9.4.4.txt 3864 178917 295080 1698471
sqlite-3081101.txt 4 11270 60554 103000
----------------------------------------------------------------------------------
SUM: 8882 562671 867744 3929170
----------------------------------------------------------------------------------
```
Report files themselves can be summed together. Say you also manage
development of Perl and Python and you want to keep track
of those line counts separately from your database projects. First
create reports for Perl and Python separately:
```
cloc --out perl-5.22.0.txt perl-5.22.0.tar.gz
cloc --out python-2.7.10.txt Python-2.7.10.tar.xz
```
then sum these together with
```
Unix> cloc --sum-reports --out script_lang perl-5.22.0.txt python-2.7.10.txt
Wrote script_lang.lang
Wrote script_lang.file
Unix> cat script_lang.lang
https://github.com/AlDanial/cloc v 1.65
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Perl 2892 136396 184362 536445
C 680 75566 71211 531203
Python 2141 89642 109524 434015
C/C++ Header 408 16433 26938 214800
Bourne Shell 154 11088 14496 87759
MSBuild script 77 0 3 38910
m4 20 1604 191 15559
Assembly 51 3775 6794 12298
Pascal 8 458 1603 8592
make 16 897 828 4939
XML 37 198 2 2484
HTML 14 393 11 2344
C++ 12 338 295 2161
Windows Module Definition 9 171 187 2081
YAML 49 20 15 2078
Prolog 12 438 2 1146
JSON 14 1 0 1037
yacc 1 85 76 998
DOS Batch 44 199 148 895
Objective-C 7 98 61 635
Expect 6 104 161 565
Windows Message File 1 102 11 489
CSS 1 98 19 328
Windows Resource File 7 55 56 292
Javascript 3 31 49 229
vim script 1 36 7 106
diff 1 17 87 105
NAnt script 2 1 0 30
IDL 1 0 0 24
Visual Basic 2 1 1 12
D 1 5 7 8
Lisp 2 0 3 4
-------------------------------------------------------------------------------
SUM: 6674 338250 417148 1902571
-------------------------------------------------------------------------------
Unix> cat script_lang.file
-------------------------------------------------------------------------------
File files blank comment code
-------------------------------------------------------------------------------
python-2.7.10.txt 3240 161276 173214 998697
perl-5.22.0.txt 3434 176974 243934 903874
-------------------------------------------------------------------------------
SUM: 6674 338250 417148 1902571
-------------------------------------------------------------------------------
```
Finally, combine the combination files:
```
Unix> cloc --sum-reports --report_file=everything databases.lang script_lang.lang
Wrote everything.lang
Wrote everything.file
Unix> cat everything.lang
https://github.com/AlDanial/cloc v 1.65
---------------------------------------------------------------------------------
Language files blank comment code
---------------------------------------------------------------------------------
C 2674 288356 442197 2084194
C++ 1625 225676 290372 985187
HTML 1324 4313 17 804824
Perl 3120 148440 193975 581463
C/C++ Header 2404 77221 180633 482754
Python 2176 90018 109646 436573
Bourne Shell 451 23959 27746 166872
SQL 433 13706 9122 55331
Pascal 115 5365 6840 41133
MSBuild script 77 0 3 38910
m4 62 3421 575 31416
yacc 11 3400 2809 30299
Javascript 8 3340 3068 15769
make 355 3146 2742 12684
Assembly 56 3862 7116 12604
CMake 190 1919 4097 12206
XML 72 846 58 7694
lex 13 1186 1797 5276
Ruby 59 619 184 4998
Windows Module Definition 59 202 217 4444
Puppet 10 0 1 3848
YAML 51 24 19 2143
DOS Batch 70 317 260 1687
Bourne Again Shell 28 307 386 1614
Prolog 13 447 42 1594
JSON 19 1 0 1396
CSS 4 151 181 790
Objective-C 7 98 61 635
Windows Resource File 20 120 145 604
Expect 6 104 161 565
Windows Message File 3 104 19 500
RobotFramework 1 0 0 441
dtrace 9 59 179 306
XSLT 5 76 55 294
WiX source 1 18 10 155
diff 2 18 91 109
vim script 1 36 7 106
Visual Basic 8 1 1 100
D 3 23 32 78
sed 3 1 7 31
NAnt script 2 1 0 30
IDL 1 0 0 24
PHP 1 11 2 24
Lisp 3 1 4 20
SKILL 1 8 15 16
---------------------------------------------------------------------------------
SUM: 15556 900921 1284892 5831741
---------------------------------------------------------------------------------
Unix> cat everything.file
-------------------------------------------------------------------------------
File files blank comment code
-------------------------------------------------------------------------------
databases.lang 8882 562671 867744 3929170
script_lang.lang 6674 338250 417148 1902571
-------------------------------------------------------------------------------
SUM: 15556 900921 1284892 5831741
-------------------------------------------------------------------------------
```
One limitation of the `--sum-reports` feature is that the individual counts must
be saved in the plain text format. Counts saved as
XML, JSON, YAML, or SQL will produce errors if used in a summation.
## SQL
Cloc can write results in the form of SQL table create and insert
statements for use
with relational database programs such as SQLite, MySQL,
PostgreSQL, Oracle, or Microsoft SQL.
Once the code count information is in a database,
the information can be interrogated and displayed in interesting ways.
A database created from cloc SQL output has two tables,
**metadata** and **t**:
Table **metadata**:
|Field | Type |
|----------|---------------------|
|id | integer primary key |
|timestamp | text |
|project | text |
|elapsed_s | text |
Table **t**:
|Field | Type |
|------------------|--------------------------|
| project |text |
| language |text |
| file |text |
| nBlank |integer |
| nComment |integer |
| nCode |integer |
| nScaled |real |
| foreign key (id) | references metadata (id) |
The **metadata** table contains information about when the cloc run
was made. Run time is stored two ways: as Unix epoch
seconds in `id` and as an ISO 8601 formatted text string
in the local time zone
(for example `2024-03-01 14:19:41`) in `timestamp`.
The `--sql-append` switch allows one to combine
many runs in a single database; each run adds a
row to the metadata table.
The code count information resides in table **t**.
The `id` key makes it easy to associate a run's code count with
its metadata.
Let's repeat the code count examples of Perl, Python, SQLite, MySQL and
PostgreSQL tarballs shown in the
[Combine Reports](#combine_reports)
example above, this time
using the SQL output options and the
[SQLite](http://www.sqlite.org/)
database engine.
The `--sql` switch tells cloc to generate output in the form
of SQL table `create` and `insert` commands. The switch takes
an argument of a file name to write these SQL statements into, or,
if the argument is 1 (numeric one), streams output to STDOUT.
Since the SQLite command line program, `sqlite3`, can read
commands from STDIN, we can dispense with storing SQL statements to
a file and use `--sql 1` to pipe data directly into the
SQLite executable:
```
cloc --sql 1 --sql-project mariadb mariadb-server-10.1.zip | sqlite3 code.db
```
The `--sql-project mariadb` part is optional; there's no need
to specify a project name when working with just one code base. However,
since we'll be adding code counts from four other tarballs, we'll only
be able to identify data by input source if we supply a
project name for each run.
Now that we have a database we will need to pass in the `--sql-append`
switch to tell cloc not to wipe out this database but instead add more data:
```
cloc --sql 1 --sql-project postgresql --sql-append postgresql-9.4.4.tar.bz2 | sqlite3 code.db
cloc --sql 1 --sql-project sqlite --sql-append sqlite-amalgamation-3081101.zip | sqlite3 code.db
cloc --sql 1 --sql-project python --sql-append Python-2.7.10.tar.xz | sqlite3 code.db
cloc --sql 1 --sql-project perl --sql-append perl-5.22.0.tar.gz | sqlite3 code.db
```
Now the fun begins--we have a database, `code.db`, with lots of
information about the five projects and can query it
for all manner of interesting facts.
**Which is the longest file over all projects?**
```
prompt> sqlite3 code.db 'select project,file,nBlank+nComment+nCode as nL from t
where nL = (select max(nBlank+nComment+nCode) from t)'
sqlite|sqlite-amalgamation-3081101/sqlite3.c|161623
```
`sqlite3`'s default output format leaves a bit to be desired.
We can add an option to the program's rc file,
`~/.sqliterc`, to show column headers:
```
.header on
```
One might be tempted to also include
```
.mode column
```
in `~/.sqliterc` but this causes problems when the output has more than
one row since the widths of entries in the first row govern the maximum
width for all subsequent rows. Often this leads to truncated output--not
at all desirable. One option is to write a custom SQLite output
formatter such as `sqlite_formatter`, included with cloc.
To use it, simply pass `sqlite3`'s STDOUT into `sqlite_formatter`
via a pipe:
```
prompt> sqlite3 code.db 'select project,file,nBlank+nComment+nCode as nL from t
where nL = (select max(nBlank+nComment+nCode) from t)' | ./sqlite_formatter
<font color="darkgreen">
-- Loading resources from ~/.sqliterc
Project File nL
_______ _____________________________________ ______
sqlite sqlite-amalgamation-3081101/sqlite3.c 161623
</font>
```
If the "Project File" line doesn't appear, add `.header on` to your
`~/.sqliterc` file as explained above.
**What is the longest file over all projects?**
```
prompt> sqlite3 code.db 'select project,file,nBlank+nComment+nCode as nL from t
where nL = (select max(nBlank+nComment+nCode) from t)' | sqlite_formatter
Project File nL
_______ _____________________________________ ______
sqlite sqlite-amalgamation-3081101/sqlite3.c 161623
```
**What is the longest file in each project?**
```
prompt> sqlite3 code.db 'select project,file,max(nBlank+nComment+nCode) as nL from t
group by project order by nL;' | sqlite_formatter
Project File nL
__________ ________________________________________________________________ ______
python Python-2.7.10/Mac/Modules/qt/_Qtmodule.c 28091
postgresql postgresql-9.4.4/src/interfaces/ecpg/preproc/preproc.c 54623
mariadb server-10.1/storage/mroonga/vendor/groonga/lib/nfkc.c 80246
perl perl-5.22.0/cpan/Locale-Codes/lib/Locale/Codes/Language_Codes.pm 100747
sqlite sqlite-amalgamation-3081101/sqlite3.c 161623
```
**Which files in each project have the most code lines?**
```
prompt> sqlite3 code.db 'select project,file,max(nCode) as nL from t
group by project order by nL desc;' | sqlite_formatter
Project File nL
__________ ________________________________________________________________ ______
perl perl-5.22.0/cpan/Locale-Codes/lib/Locale/Codes/Language_Codes.pm 100735
sqlite sqlite-amalgamation-3081101/sqlite3.c 97469
mariadb server-10.1/storage/mroonga/vendor/groonga/lib/nfkc.c 80221
postgresql postgresql-9.4.4/src/interfaces/ecpg/preproc/preproc.c 45297
python Python-2.7.10/Mac/Modules/qt/_Qtmodule.c 26705
```
**Which C source files with more than 300 lines have a comment ratio below 1%?**
```
prompt> sqlite3 code.db 'select project, file, nCode, nComment,
(100.0*nComment)/(nComment+nCode) as comment_ratio from t
where language="C" and nCode > 300 and
comment_ratio < 1 order by comment_ratio;' | sqlite_formatter
Project File nCode nComment comment_ratio
__________ _______________________________________________________________________________________________ _____ ________ __________________
mariadb server-10.1/storage/mroonga/vendor/groonga/lib/nfkc.c 80221 14 0.0174487443135789
python Python-2.7.10/Python/graminit.c 2175 1 0.0459558823529412
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_turkish.c 2095 1 0.0477099236641221
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_french.c 1211 1 0.0825082508250825
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_french.c 1201 1 0.0831946755407654
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_hungarian.c 1182 1 0.084530853761623
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_hungarian.c 1178 1 0.0848176420695505
mariadb server-10.1/strings/ctype-eucjpms.c 67466 60 0.0888546633889169
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_english.c 1072 1 0.0931966449207828
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_english.c 1064 1 0.0938967136150235
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_spanish.c 1053 1 0.094876660341556
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_spanish.c 1049 1 0.0952380952380952
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_italian.c 1031 1 0.0968992248062016
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_italian.c 1023 1 0.09765625
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_portuguese.c 981 1 0.10183299389002
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_portuguese.c 975 1 0.102459016393443
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_romanian.c 967 1 0.103305785123967
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_2_romanian.c 961 1 0.103950103950104
mariadb server-10.1/strings/ctype-ujis.c 67177 79 0.117461639110265
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_finnish.c 720 1 0.13869625520111
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_porter.c 717 1 0.139275766016713
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_finnish.c 714 1 0.13986013986014
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_porter.c 711 1 0.140449438202247
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_KOI8_R_russian.c 660 1 0.151285930408472
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_russian.c 654 1 0.152671755725191
python Python-2.7.10/Mac/Modules/qt/_Qtmodule.c 26705 42 0.157026956294164
python Python-2.7.10/Mac/Modules/icn/_Icnmodule.c 1521 3 0.196850393700787
mariadb server-10.1/strings/ctype-extra.c 8282 18 0.216867469879518
postgresql postgresql-9.4.4/src/bin/psql/sql_help.c 3576 8 0.223214285714286
mariadb server-10.1/strings/ctype-sjis.c 34006 86 0.252258594391646
python Python-2.7.10/Python/Python-ast.c 6554 17 0.258712524729874
mariadb server-10.1/strings/ctype-cp932.c 34609 92 0.265122042592432
perl perl-5.22.0/keywords.c 2815 8 0.283386468296139
python Python-2.7.10/Mac/Modules/menu/_Menumodule.c 3263 10 0.305530094714329
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_dutch.c 596 2 0.334448160535117
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_dutch.c 586 2 0.340136054421769
mariadb server-10.1/strings/ctype-gbk.c 10684 38 0.354411490393583
python Python-2.7.10/Mac/Modules/qd/_Qdmodule.c 6694 24 0.357249181303959
python Python-2.7.10/Mac/Modules/win/_Winmodule.c 3056 11 0.358656667753505
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_german.c 476 2 0.418410041841004
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_german.c 470 2 0.423728813559322
mariadb server-10.1/strings/ctype-euc_kr.c 9956 44 0.44
postgresql postgresql-9.4.4/src/backend/utils/fmgrtab.c 4815 23 0.475403059115337
python Python-2.7.10/Mac/Modules/ctl/_Ctlmodule.c 5442 28 0.511882998171846
python Python-2.7.10/Mac/Modules/ae/_AEmodule.c 1347 7 0.51698670605613
python Python-2.7.10/Mac/Modules/app/_Appmodule.c 1712 9 0.52295177222545
mariadb server-10.1/strings/ctype-gb2312.c 6377 35 0.54585152838428
mariadb server-10.1/storage/tokudb/ft-index/third_party/xz-4.999.9beta/src/liblzma/lzma/fastpos_table.c 516 3 0.578034682080925
python Python-2.7.10/Mac/Modules/evt/_Evtmodule.c 504 3 0.591715976331361
python Python-2.7.10/Modules/expat/xmlrole.c 1256 8 0.632911392405063
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_danish.c 312 2 0.636942675159236
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_danish.c 310 2 0.641025641025641
python Python-2.7.10/Mac/Modules/res/_Resmodule.c 1621 12 0.734843845682792
python Python-2.7.10/Mac/Modules/drag/_Dragmodule.c 1046 8 0.759013282732448
python Python-2.7.10/Mac/Modules/list/_Listmodule.c 1021 8 0.777453838678329
python Python-2.7.10/Mac/Modules/te/_TEmodule.c 1198 10 0.827814569536424
python Python-2.7.10/Mac/Modules/cg/_CGmodule.c 1190 10 0.833333333333333
python Python-2.7.10/Modules/clmodule.c 2379 23 0.957535387177352
python Python-2.7.10/Mac/Modules/folder/_Foldermodule.c 306 3 0.970873786407767
```
**What are the ten longest files (based on code lines) that have no comments at all? Exclude header, .html, and YAML files.**
```
prompt> sqlite3 code.db 'select project, file, nCode from t
where nComment = 0 and
language not in ("C/C++ Header", "YAML", "HTML")
order by nCode desc limit 10;' | sqlite_formatter
Project File nCode
_______ ____________________________________________________________________ _____
perl perl-5.22.0/cpan/Unicode-Collate/Collate/Locale/ja.pl 1938
python Python-2.7.10/PCbuild/pythoncore.vcproj 1889
python Python-2.7.10/PC/VS8.0/pythoncore.vcproj 1889
mariadb server-10.1/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc 1862
perl perl-5.22.0/cpan/Unicode-Collate/Collate/Locale/zh_strk.pl 1589
perl perl-5.22.0/cpan/Unicode-Collate/Collate/Locale/zh_zhu.pl 1563
mariadb server-10.1/storage/mroonga/vendor/groonga/configure.ac 1526
perl perl-5.22.0/cpan/Unicode-Collate/Collate/Locale/zh_pin.pl 1505
mariadb server-10.1/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc 1465
python Python-2.7.10/PC/VS8.0/_bsddb.vcproj 1463
```
**What are the most popular languages (in terms of lines
of code) in each project?**
```
prompt> sqlite3 code.db 'select project, language, sum(nCode) as SumCode from t
group by project,language
order by project,SumCode desc;' | sqlite_formatter
Project Language SumCode
__________ _________________________ _______
mariadb C++ 983026
mariadb C 715018
mariadb C/C++ Header 209394
mariadb Bourne Shell 61943
mariadb Perl 35562
mariadb Pascal 32541
mariadb HTML 16489
mariadb Javascript 15540
mariadb m4 14215
mariadb CMake 12206
mariadb XML 5210
mariadb Ruby 4998
mariadb Puppet 3848
mariadb make 3631
mariadb SQL 3405
mariadb Python 2545
mariadb Bourne Again Shell 1604
mariadb Windows Module Definition 1211
mariadb lex 991
mariadb yacc 810
mariadb DOS Batch 700
mariadb Prolog 448
mariadb RobotFramework 441
mariadb CSS 393
mariadb JSON 359
mariadb dtrace 306
mariadb Windows Resource File 250
mariadb Assembly 237
mariadb WiX source 155
mariadb Visual Basic 88
mariadb YAML 65
mariadb PHP 24
mariadb SKILL 16
mariadb sed 16
mariadb Windows Message File 6
mariadb D 4
mariadb diff 4
perl Perl 536445
perl C 155648
perl C/C++ Header 147858
perl Bourne Shell 42668
perl Pascal 8592
perl XML 2410
perl YAML 2078
perl C++ 2033
perl make 1986
perl Prolog 1146
perl JSON 1037
perl yacc 998
perl Windows Message File 489
perl DOS Batch 389
perl Windows Resource File 85
perl D 8
perl Lisp 4
postgresql HTML 785991
postgresql C 736519
postgresql C/C++ Header 57014
postgresql SQL 51926
postgresql yacc 28491
postgresql Bourne Shell 17170
postgresql Perl 9456
postgresql lex 4285
postgresql make 4114
postgresql m4 1642
postgresql Windows Module Definition 1152
postgresql XSLT 294
postgresql DOS Batch 92
postgresql Assembly 69
postgresql CSS 69
postgresql D 66
postgresql Windows Resource File 62
postgresql Lisp 16
postgresql sed 15
postgresql Python 13
postgresql Bourne Again Shell 10
postgresql Windows Message File 5
python Python 434015
python C 375555
python C/C++ Header 66942
python Bourne Shell 45091
python MSBuild script 38910
python m4 15559
python Assembly 12298
python make 2953
python HTML 2344
python Windows Module Definition 2081
python Objective-C 635
python Expect 565
python DOS Batch 506
python CSS 328
python Javascript 229
python Windows Resource File 207
python C++ 128
python vim script 106
python diff 105
python XML 74
python NAnt script 30
python Prolog 24
python Visual Basic 12
sqlite C 101454
sqlite C/C++ Header 1546
```
## Custom Column Output
Cloc's default output is a text table with five columns:
language, file count, number of blank lines, number of comment
lines and number of code lines. The switches `--by-file`,
`--3`, and `--by-percent` generate additional information but
sometimes even those are insufficient.
The `--sql` option described in the previous section offers the
ability to create custom output. This section has a pair of examples
that show how to create custom columns.
The first example includes an extra column, **Total**, which is the
sum of the numbers of blank, comment, and code lines.
The second shows how to include the language name when running
with `--by-file`.
**Example 1: Add a "Totals" column.**
The first step is to run cloc and save the output to a relational database,
SQLite in this case:
```
cloc --sql 1 --sql-project x yaml-cpp-yaml-cpp-0.5.3.tar.gz | sqlite3 counts.db
```
(the tar file comes from the
[YAML-C++](https://github.com/jbeder/yaml-cpp) project).
Second, we craft an SQL query that returns the regular cloc output
plus an extra column for totals, then save the SQL statement to
a file, `query_with_totals.sql`:
```
-- file query_with_totals.sql
select Language, count(File) as files ,
sum(nBlank) as blank ,
sum(nComment) as comment ,
sum(nCode) as code ,
sum(nBlank)+sum(nComment)+sum(nCode) as Total
from t group by Language order by code desc;
```
Third, we run this query through SQLite using the `counts.db` database.
We'll include the `-header` switch so that SQLite prints the
column names:
```
> cat query_with_totals.sql | sqlite3 -header counts.db
Language|files|blank|comment|code|Total
C++|141|12786|17359|60378|90523
C/C++ Header|110|8566|17420|51502|77488
Bourne Shell|10|6351|6779|38264|51394
m4|11|2037|260|17980|20277
Python|30|1613|2486|4602|8701
MSBuild script|11|0|0|1711|1711
CMake|7|155|285|606|1046
make|5|127|173|464|764
Markdown|2|30|0|39|69
```
The extra column for **Total** is there but the format is unappealing.
Running the output through `sqlite_formatter` yields the desired result:
```
> cat query_with_totals.sql | sqlite3 -header counts.db | sqlite_formatter
Language files blank comment code Total
______________ _____ _____ _______ _____ _____
C++ 141 12786 17359 60378 90523
C/C++ Header 110 8566 17420 51502 77488
Bourne Shell 10 6351 6779 38264 51394
m4 11 2037 260 17980 20277
Python 30 1613 2486 4602 8701
MSBuild script 11 0 0 1711 1711
CMake 7 155 285 606 1046
make 5 127 173 464 764
Markdown 2 30 0 39 69
```
The next section,
[Wrapping cloc in other scripts](#wrapping-cloc-in-other-scripts-),
shows one way these commands can be combined
into a new utility program.
**Example 2: Include a column for "Language" when running with `--by-file`.**
Output from `--by-file` omits each file's language to save screen real estate;
file paths for large projects can be long and including an extra 20 or so
characters for a Language column can be excessive.
As an example, here are the first few lines of output using the same
code base as in Example 1:
```
> cloc --by-file yaml-cpp-yaml-cpp-0.5.3.tar.gz
github.com/AlDanial/cloc v 1.81 T=1.14 s (287.9 files/s, 221854.9 lines/s)
--------------------------------------------------------------------------------------------------------------------------------------------
File blank comment code
--------------------------------------------------------------------------------------------------------------------------------------------
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/configure 2580 2264 13691
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/configure 2541 2235 13446
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/fused-src/gtest/gtest.h 1972 4681 13408
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/fused-src/gmock/gmock.h 1585 3397 9216
yaml-cpp-yaml-cpp-0.5.3/test/integration/gen_emitter_test.cpp 999 0 8760
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/aclocal.m4 987 100 8712
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/m4/libtool.m4 760 65 7176
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/build-aux/ltmain.sh 959 1533 7169
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/fused-src/gmock-gtest-all.cc 1514 3539 6390
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/fused-src/gtest/gtest-all.cc 1312 2896 5384
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/test/gtest_unittest.cc 1226 1091 5098
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-param-util-generated.h 349 235 4559
```
The absence of language identification for each file
is a bit disappointing, but
this can be remedied with a custom column solution.
The first step, creating a database, matches that from Example 1 so
we'll go straight to the second step of creating the desired
SQL query. We'll store this one in the file `by_file_with_language.sql`:
```
-- file by_file_with_language.sql
select File, Language, nBlank as blank ,
nComment as comment,
nCode as code
from t order by code desc;
```
Our desired extra column appears when we pass this custom SQL query
through our database:
```
> cat by_file_with_language.sql | sqlite3 -header counts.db | sqlite_formatter
File Language blank comment code
__________________________________________________________________________________________________ ______________ _____ _______ _____
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/configure Bourne Shell 2580 2264 13691
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/configure Bourne Shell 2541 2235 13446
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/fused-src/gtest/gtest.h C/C++ Header 1972 4681 13408
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/fused-src/gmock/gmock.h C/C++ Header 1585 3397 9216
yaml-cpp-yaml-cpp-0.5.3/test/integration/gen_emitter_test.cpp C++ 999 0 8760
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/aclocal.m4 m4 987 100 8712
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/m4/libtool.m4 m4 760 65 7176
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/build-aux/ltmain.sh Bourne Shell 959 1533 7169
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/fused-src/gmock-gtest-all.cc C++ 1514 3539 6390
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/fused-src/gtest/gtest-all.cc C++ 1312 2896 5384
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/test/gtest_unittest.cc C++ 1226 1091 5098
yaml-cpp-yaml-cpp-0.5.3/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-param-util-generated.h C/C++ Header 349 235 4559
```
## Wrapping cloc in other scripts
More complex code counting solutions are possible by wrapping
cloc in scripts or programs. The "total lines" column from
example 1 of [Custom Column Output](#custom-column-output-)
could be simplified to a single command with this shell script (on Linux):
```
#!/bin/sh
#
# These commands must be in the user's $PATH:
# cloc
# sqlite3
# sqlite_formatter
#
if test $# -eq 0 ; then
echo "Usage: $0 [cloc arguments]"
echo " Run cloc to count lines of code with an additional"
echo " output column for total lines (code+comment+blank)."
exit
fi
DBFILE=`tempfile`
cloc --sql 1 --sql-project x $@ | sqlite3 ${DBFILE}
SQL="select Language, count(File) as files ,
sum(nBlank) as blank ,
sum(nComment) as comment ,
sum(nCode) as code ,
sum(nBlank)+sum(nComment)+sum(nCode) as Total
from t group by Language order by code desc;
"
echo ${SQL} | sqlite3 -header ${DBFILE} | sqlite_formatter
rm ${DBFILE}
```
Saving the lines above to ``total_columns.sh`` and making it
executable (``chmod +x total_columns.sh``) would let us do
```
./total_columns.sh yaml-cpp-yaml-cpp-0.5.3.tar.gz
```
to directly get
```
Language files blank comment code Total
______________ _____ _____ _______ _____ _____
C++ 141 12786 17359 60378 90523
C/C++ Header 110 8566 17420 51502 77488
Bourne Shell 10 6351 6779 38264 51394
m4 11 2037 260 17980 20277
Python 30 1613 2486 4602 8701
MSBuild script 11 0 0 1711 1711
CMake 7 155 285 606 1046
make 5 127 173 464 764
Markdown 2 30 0 39 69
```
Other examples:
* Count code from a specific branch of a web-hosted
git repository and send the results as a .csv email attachment:
https://github.com/dannyloweatx/checkmarx
## git and UTF8 pathnames
cloc's ``--git`` option may fail if you work with directory or
file names with UTF-8 characters (for example, see
<a href=https://github.com/AlDanial/cloc/issues/457>issue 457</a>).
The solution,
https://stackoverflow.com/questions/22827239/how-to-make-git-properly-display-utf-8-encoded-pathnames-in-the-console-window,
is to apply this git configuration command:
```
git config --global core.quotepath off
```
Your console's font will need to be capable of displaying
Unicode characters.
## Third Generation Language Scale Factors
cloc versions before 1.50 by default computed, for the provided inputs, a
rough estimate of how many lines of code would be needed to write the
same code in a hypothetical third-generation computer language.
To produce this output one must now use the `--3` switch.
Scale factors were derived from the 2006 version of language gearing ratios
listed at Mayes Consulting web site,
[http://softwareestimator.com/IndustryData2.htm](http://softwareestimator.com/IndustryData2.htm), using this equation:
cloc scale factor for language X = 3rd generation default gearing ratio / language X gearing ratio
For example, cloc 3rd generation scale factor for DOS Batch = 80 / 128 = 0.625.
The biggest flaw with this approach is that gearing ratios are defined
for logical lines of source code not physical lines (which cloc counts).
The values in cloc's 'scale' and '3rd gen. equiv.' columns should be
taken with a large grain of salt.
## options.txt configuration file
If you find yourself using the same command line switches every
time you invoke cloc, you can save some typing by adding those
switches to the ``options.txt`` runtime configuration file.
cloc will look for this file in the following default locations:
```
# Linux, NetBSD, FreeBSD, macOS:
/home/USERNAME/.config/cloc/options.txt
# Windows
C:\Users\USERNAME\AppData\Roaming\cloc
```
If you run cloc with ``--help``, cloc will tell you
where it expects to find this config file file. The information
appears by the explanation of the ``--config`` switch after
the text ``the default location of``.
On Unix-like operating systems, this can be simplified to
```
> cloc --help | grep "default location"
the default location of /home/al/.config/cloc/options.txt.
```
and in a Windows ``cmd`` terminal with
```
> cloc --help | findstr default | findstr location
the default location of C:\Users\al\AppData\Roaming\cloc
```
Place each switch and arguments, if any, on a line by itself.
Lines prefixed with ``#`` symbol are ignored as comments and
blank lines are skipped. Leading hyphens on the switches are
optional. Here's a sample file:
```
# options.txt
--vcs git
v # verbose level 1
exclude-ext svg,html
```
The path to the ``options.txt`` file can also be specified
with the ``--config FILE`` switch.
Finally, if cloc finds an ``options.txt`` file in the same
directory as files given by any of these switches (in the
listed priority), it will use that configuration file
from that location:
1. ``--list-file``
1. ``--exclude-list-file``
1. ``--read-lang-def``
1. ``--force-lang-def``
1. ``--diff-list-file``
Run with ``--verbose`` to have cloc tell you which, if
any, ``options.txt`` file it uses.
## Python Programmatic Interface
[Stefano Campanella](https://github.com/StefanoStone)
created a Python programmatic interface to cloc.
It is available at https://github.com/pycloc/pycloc
## Java Programmatic Interface
[Ozren Dabić](https://github.com/seart-group/jcloc/commits?author=dabico)
created a Java programmatic interface to cloc.
It is available at https://github.com/seart-group/jcloc
# Complex regular subexpression recursion limit
cloc relies on the Regexp::Common module's regular expressions to remove
comments from source code. If comments are malformed, for example the
``/*`` start comment marker appears in a C program without a corresponding ``*/``
marker, the regular expression engine could enter a recursive
loop, eventually triggering the warning
``Complex regular subexpression recursion limit``.
The most common cause for this warning is the existence of comment markers
in string literals. While language compilers and interpreters are smart
enough to recognize that ``"/*"`` (for example) is a string and not a comment,
cloc is fooled. File path globs, as in this line of JavaScript
```
var paths = globArray("**/*.js", {cwd: srcPath});
```
are frequent culprits.
In an attempt to overcome this problem, a different
algorithm which removes comment markers in strings can be enabled
with the ``--strip-str-comments`` switch. Doing so, however,
has drawbacks: cloc
will run more slowly and the output of ``--strip-comments``
will contain strings that no longer match the input source.
# Limitations
Identifying comments within source code is trickier than one might expect.
Many languages would need a complete parser to be counted correctly.
cloc does not attempt to parse any of
the languages it aims to count and therefore is an imperfect tool.
The following are known problems:
<ol>
<li> Lines containing both source code and comments are counted as lines of code.
</li>
<li> Comment markers within strings or
<a href="http://www.faqs.org/docs/abs/HTML/here-docs.html">here-documents</a>
are treated as actual comment markers and not string literals.
For example the following lines of C code
```
printf(" /* ");
for (i = 0; i < 100; i++) {
a += i;
}
printf(" */ ");
```
look to cloc like this:
```
printf(" xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx ");
```
where `xxxxxxx` represents cloc's view of commented text.
Therefore cloc counts the five lines as two lines of C code and three
lines of comments (lines with both code and comment are counted as code).
If you suspect your code has such strings, use the switch
``--strip-str-comments`` to switch to the algorithm which removes
embedded comment markers. Its use will render the five lines above as
```
printf(" ");
for (i = 0; i < 100; i++) {
a += i;
}
printf(" ");
```
and therefore return a count of five lines of code.
See the
[previous section](#complex-regular-subexpression-recursion-limit-)
on drawbacks to using ``--strip-str-comments``.
</li>
<li> Embedded languages are not recognized. For example, an HTML file containing
JavaScript will be counted entirely as HTML.
</li>
<li> Python docstrings can serve several purposes. They may
contain documentation,
comment out blocks of code, or they can be regular strings (when
they appear on the right hand side of an assignment or as a function argument).
cloc is unable to infer the meaning of docstrings by context; by default
cloc treats all docstrings as comments. The switch
`--docstring-as-code`
treats all docstrings as code.
</li>
<li> Language definition files read with `--read-lang-def` or
`--force-lang-def` must be plain ASCII text files.
</li>
<li> cloc treats compiler pragma's, for example `#if` / `#endif`, as code
even if these are used to block lines of source from being compiled;
the blocked lines still contribute to the code count.
</li>
<li> On Windows, cloc will fail with <tt>Can't cd to ... No such file or
directory at <embedded>/File/Find.pm</tt> if the code being scanned has
file paths longer than 255 characters. A work-around is to run cloc
from the Windows Subsystem for Linux (WSL).
</li>
<li> cloc's comment match code uses regular expressions
which cannot properly account for nested comments using
the same comment markers (such as `/* /* */ */`).
</li>
<li> XML comments embedded within `CDATA` blocks are counted as
comments rather than code.
</li>
</ol>
# Support for Additional Languages
If cloc does not recognize a language you are interested in counting,
you can either
1. [implement it yourself](#implement-it-yourself),
2. [request it to be implemented](#request-to-implement).
## Implement an Additional Language
In short, you will need to:
- edit the `cloc` file:
- look for `%{$rh_Language_by_Extension} = ( # {{{1` and add, respecting the alphabetical order,
```
'<ext>' => '<Language Name>' ,
```
where `<ext>` is the extension used by your language, and `<Language Name>` is its name. Repeat for each extension used by your language.
- look for `%{$rhaa_Filters_by_Language} = ( # {{{1`, and add, respecting the alphabetical order,
```
'<Language Name>' => [
<list>
],
```
where `<Language Name>` is the name of the language you are implementing, and `<list>` is a list of filter options (whose documentation remains to be written -- take inspiration from existing languages).
- look for `%{$rh_Scale_Factor} = ( # {{{1`, and add, respecting the alphabetical order,
```
'<Language Name>' => <factor>,
```
where `<Language Name>` is the name of the language you are implementing, and `<factor>` is a [third generation language scale factor](#third-generation-language-scale-factors-).
- edit the `Readme.md` file, adding under ["Recognized Languages"](#recognized-languages-)
```
<Language Name> (<list of extensions>)
```
for `<Language Name>` the name of the language you are implementing, and `<list of extensions>` the list of extensions you declared in `rh_Language_by_Extension`.
- (optional, but recommended) Add a test case:
- Create a `tests/inputs/<Language name>.<extension>` file, containing some code written in `<Language name>`,
- Generate a `tests/outputs/<Language name>.<extension>.yaml` file, using
```
cloc --yaml tests/inputs/<Language name>.<extension> --out tests/outputs/<Language name>.<extension>.yaml
```
- Add your case in `Unix/t/00_C.t`: under `my @Tests = (`, add
```
{
'name' => '<Language name>',
'ref' => '../tests/outputs/<Language name>.<extension>.yaml',
'args' => '../tests/inputs/<Language name>.<extension>',
},
```
- Make sure you examine the output of `tests/outputs/<Language name>.<extension>.yaml` and that it is correct, then run `make test` from the `Unix` folder to make sure your test was successful.
You can use [this pull request](https://github.com/AlDanial/cloc/pull/962) or [this one](https://github.com/AlDanial/cloc/pull/947) as guidelines.
## Request an Additional Language
Create a [GitHub issue](https://github.com/AlDanial/cloc/issues)
requesting support for your language. Include this information:
<ol>
<li> File extensions associated with the language. If the language does
not rely on file extensions and instead works with fixed file names or
with `#!` style program invocations, explain what those are.</li>
<li> A description of how comments are defined.</li>
<li> Links to sample code.</li>
</ol>
# Reporting Problems
If you encounter a problem with cloc, first check to see if
you're running with the latest version of the tool:
```
cloc --v
gitextract_92_lc_1g/
├── .devcontainer/
│ ├── Dockerfile
│ └── devcontainer.json
├── .dockerignore
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── report-a-bug.md
│ │ └── request-an-enhancement.md
│ └── workflows/
│ ├── build.yml
│ ├── release-ready.yml
│ └── release-staging.yml
├── .gitignore
├── .vscode/
│ └── launch.json
├── Dockerfile
├── Dockerfile.build
├── LICENSE
├── README.md
├── Unix/
│ ├── AUTHORS
│ ├── COPYING
│ ├── INSTALL
│ ├── Makefile
│ ├── NEWS
│ ├── README
│ ├── cloc
│ ├── cloc.1.pod
│ ├── pod2man.mk
│ ├── t/
│ │ ├── 00_C.t
│ │ ├── 01_opts.t
│ │ └── 02_git.t
│ └── why_this_directory_exists.txt
├── cloc
├── sqlite_formatter
└── tests/
├── README
├── inputs/
│ ├── 955.bpmn
│ ├── 955.hbm.xml
│ ├── 955.jrxml
│ ├── 955.lb.xml
│ ├── 955.tld
│ ├── AnsProlog.lp
│ ├── Application_Data_Test.feature.cs
│ ├── Arturo.art
│ ├── Assembler-Intel.asm
│ ├── Assembly-sysv.S
│ ├── BUILD
│ ├── BasicPlane.Figures-Rectangle.ixx
│ ├── BoxWidget.ui
│ ├── Buchberger.cocoa5
│ ├── C#.cs
│ ├── C++-MFC.cc
│ ├── C++-uppercase.CPP
│ ├── C-Ansi.c
│ ├── C.g4
│ ├── ChangeProperties.il
│ ├── Chapel.chpl
│ ├── Cobol.cbl
│ ├── CodeQL.ql
│ ├── ColdFusion.cfm
│ ├── Combinators.idr
│ ├── Containerfile
│ ├── Counter.razor
│ ├── DIEnumerator-10.0.ll
│ ├── DocTest.thrift
│ ├── Dockerfile
│ ├── ERC20.cairo
│ ├── ExprParser.g
│ ├── FOCUS.focexec
│ ├── Fortran77.f
│ ├── Fortran90.f90
│ ├── FreemarkerTemplate.ftl
│ ├── GamePanel.tscn
│ ├── Gencat-NLS.msg
│ ├── Haskell.hs
│ ├── Hello.lidr
│ ├── HelpersView.axaml
│ ├── IDL.idl
│ ├── ItemView.vue
│ ├── Java.java
│ ├── JetCar.cls
│ ├── LaTeX.tex
│ ├── Lanczos.m
│ ├── LogMain.re
│ ├── Lookup.agda
│ ├── MSDOS.bat
│ ├── Makefile
│ ├── Mako.mako
│ ├── Mathematica_1.m
│ ├── Mathematica_2.wlt
│ ├── Mojo.mojom
│ ├── Mumps.mps
│ ├── Octave.m
│ ├── Once.HC
│ ├── Pascal.p
│ ├── Pascal.pas
│ ├── Pascal.pp
│ ├── PlusCalExample.tla
│ ├── Prelude.dhall
│ ├── ProcessPO.odx
│ ├── RedBlackTree.res
│ ├── RemoteSiteHelperTest.cls
│ ├── RenderTest.metal
│ ├── Rounds.scad
│ ├── Sample.mc
│ ├── SimpleODE.mo
│ ├── Slim.html.slim
│ ├── Slint-helloworld.slint
│ ├── Snakefile
│ ├── Splice.hs-boot
│ ├── Sys.hx
│ ├── TLAExample.tla
│ ├── TableGen-ARM.td
│ ├── Test.daml
│ ├── Tk
│ ├── Trapezoid_Rule.ipynb
│ ├── TypeScript.ts
│ ├── TypeScript_2.ts
│ ├── USS.uss
│ ├── UXML.uxml
│ ├── X++.xpo
│ ├── XML.xml
│ ├── XSL-FO.xsl
│ ├── XSLT.xslt
│ ├── XmlToJSONSendPipeline.btp
│ ├── Xtend.xtend
│ ├── ZosMsg.mc
│ ├── ZosNet.rc
│ ├── ZosNp.def
│ ├── aa/
│ │ └── bb/
│ │ └── cc/
│ │ └── plasma.c
│ ├── acpclust.R
│ ├── apertium-dan.dan.rlx
│ ├── args.janet
│ ├── arvo.hoon
│ ├── asciidoctor.adoc
│ ├── assembly.cs
│ ├── basic.luau
│ ├── basic.p4
│ ├── bbf-device.yang
│ ├── beluga.bel
│ ├── birds.pro
│ ├── blur.glsl
│ ├── body.gjs
│ ├── bubs_tak_ard.prc
│ ├── build.bzl
│ ├── build.cake
│ ├── cad.asy
│ ├── cadence_test.cdc
│ ├── captcha.cs
│ ├── capture.ecr
│ ├── certificates.sls
│ ├── ch10-REPL-oriented-repl-interactions.cj
│ ├── chat.st
│ ├── child_template.jinja2
│ ├── child_template.njk
│ ├── clarityfiles.clar
│ ├── class.imba
│ ├── cli-args.nf
│ ├── cloc-dev.code-workspace
│ ├── cloc_counts.csv
│ ├── clusterConf.ttcn
│ ├── comments.rhai
│ ├── comments_in_str.svelte
│ ├── comp.ecpp
│ ├── complex_union.derw
│ ├── conditions.CBL
│ ├── config.junos
│ ├── cpp-example.inc
│ ├── cross-platform.just
│ ├── csharp-designer.designer.cs
│ ├── cucumber.feature
│ ├── custom.triple.extension.js
│ ├── darwin-configuration.nix
│ ├── dd/
│ │ └── bb/
│ │ ├── cc/
│ │ │ └── MoreTeapotsRenderer.cpp
│ │ ├── config.c
│ │ └── ee/
│ │ └── TeapotRenderer.cpp
│ ├── demo.odin
│ ├── dev.exs
│ ├── diff/
│ │ ├── A/
│ │ │ ├── d1/
│ │ │ │ └── hello.f90
│ │ │ ├── d2/
│ │ │ │ ├── hello.java
│ │ │ │ └── hi.py
│ │ │ └── hello.C
│ │ └── B/
│ │ ├── d1/
│ │ │ └── hello.f90
│ │ ├── d2/
│ │ │ └── hi.py
│ │ ├── extra_file.pl
│ │ └── hello.C
│ ├── dlist.lean
│ ├── door.tres
│ ├── dotNET_intermediate.il
│ ├── double_doors.dsc
│ ├── drools.drl
│ ├── drupal.mxml
│ ├── eddsa.circom
│ ├── elixir.ex
│ ├── en_AU.po
│ ├── example_2d.gdshader
│ ├── fib.dfy
│ ├── fib_class.pkl
│ ├── fibonacci.ncl
│ ├── find.plm
│ ├── flatbuffers.fbs
│ ├── fmt.ha
│ ├── foo_bar/
│ │ ├── bar/
│ │ │ └── foo/
│ │ │ └── momo/
│ │ │ └── tbfm.sh
│ │ └── foo/
│ │ └── bar/
│ │ └── lala/
│ │ └── tfbl.sh
│ ├── fortran.inc
│ ├── fractal.um
│ ├── fsharp.fs
│ ├── fsharp_script.fsx
│ ├── functional.cj
│ ├── futhark.fut
│ ├── generate.fnl
│ ├── git_helpers.fish
│ ├── github_user.aria
│ ├── glade-search-popover.ui
│ ├── glossary.json
│ ├── glossary.json5
│ ├── gnureadline.vala
│ ├── graphql.gql
│ ├── greeter.tsx
│ ├── groovy_triple.gvy
│ ├── guard_talking.yarn
│ ├── guestbook.tpl
│ ├── hanoi.inc
│ ├── harbour_xbase.prg
│ ├── hello.C
│ ├── hello.bf
│ ├── hello.f
│ ├── hello.f90
│ ├── hello.java
│ ├── hello.kt
│ ├── hello.lua
│ ├── hello.pas
│ ├── hello.pl1
│ ├── hello.sp
│ ├── hello1.pas
│ ├── hello_1.0.bb
│ ├── hello_app.go
│ ├── hello_app.ʕ◔ϖ◔ʔ
│ ├── hello_app_autogen.go
│ ├── hello_app_autogen.ʕ◔ϖ◔ʔ
│ ├── helloworld.raml
│ ├── hi.mojo
│ ├── hi.py
│ ├── htlc.teal
│ ├── html_heex_example.heex
│ ├── i18n_de.ts
│ ├── iclean.icl
│ ├── idris_block_comments.idr
│ ├── igorpro.ipf
│ ├── includes_demo.mustache
│ ├── inner_ref.jsonnet
│ ├── input.gts
│ ├── insertJournalEntry.ipl
│ ├── invoices.prql
│ ├── io.c3
│ ├── issue_875.bdy
│ ├── issue_876.vue
│ ├── issues/
│ │ ├── 114/
│ │ │ ├── bar/
│ │ │ │ ├── bee/
│ │ │ │ │ └── inner_most.js
│ │ │ │ └── under_Bar.js
│ │ │ └── foo/
│ │ │ └── under_foo.js
│ │ ├── 131/
│ │ │ ├── README
│ │ │ └── hi.py
│ │ ├── 132/
│ │ │ ├── .gitignore
│ │ │ ├── C-Ansi.c
│ │ │ ├── README
│ │ │ └── ignore_dir/
│ │ │ └── Fortran77.f
│ │ ├── 166/
│ │ │ ├── X
│ │ │ └── fake.thy
│ │ ├── 183/
│ │ │ ├── eval1957.SACunidir.fr
│ │ │ └── file.fth
│ │ ├── 245/
│ │ │ └── complex_regular_subexpression.scala
│ │ ├── 280/
│ │ │ ├── L/
│ │ │ │ └── hello_1.c
│ │ │ └── R/
│ │ │ └── hello_2.c
│ │ ├── 286/
│ │ │ └── project/
│ │ │ ├── ignore_subdir/
│ │ │ │ └── test.py
│ │ │ └── read_subdir/
│ │ │ └── hi.c
│ │ ├── 296/
│ │ │ ├── Lanczos.m
│ │ │ ├── Mathematica_1.m
│ │ │ ├── Octave.m
│ │ │ ├── hello.lua
│ │ │ ├── nested.lua
│ │ │ └── qsort_demo.m
│ │ ├── 312/
│ │ │ └── sam #ple.py
│ │ ├── 318/
│ │ │ ├── Rcs.yaml
│ │ │ └── Réponse.cs
│ │ ├── 327/
│ │ │ ├── example.smarty2
│ │ │ └── lang.config
│ │ ├── 341/
│ │ │ ├── cItems.cls
│ │ │ └── thesis.cls
│ │ ├── 350/
│ │ │ └── fs.go
│ │ ├── 365/
│ │ │ └── RSpecTests.java
│ │ ├── 370/
│ │ │ └── arduino_issue_370.ino
│ │ ├── 375/
│ │ │ └── docstring.py
│ │ ├── 378/
│ │ │ └── git_script.sh
│ │ ├── 380/
│ │ │ └── wrapper.pl
│ │ ├── 381/
│ │ │ ├── issue381.c
│ │ │ └── issue381.java
│ │ ├── 386/
│ │ │ └── make_386_repo.sh
│ │ ├── 405/
│ │ │ └── globs.py
│ │ ├── 407/
│ │ │ ├── count_dir/
│ │ │ │ ├── C-Ansi.c
│ │ │ │ └── Test/
│ │ │ │ └── Java.java
│ │ │ ├── level2/
│ │ │ │ ├── Java.java
│ │ │ │ └── level/
│ │ │ │ └── Test/
│ │ │ │ ├── C-Ansi.c
│ │ │ │ └── level2/
│ │ │ │ └── hi.py
│ │ │ └── linked_dir/
│ │ │ └── hello.f
│ │ ├── 408/
│ │ │ └── badly_named_ruby.pl
│ │ ├── 420/
│ │ │ └── mixed_case_ext.Pl
│ │ ├── 433/
│ │ │ └── excl.txt
│ │ ├── 454/
│ │ │ └── createServer.js
│ │ ├── 455/
│ │ │ ├── list.txt
│ │ │ └── list_align.txt
│ │ ├── 456/
│ │ │ ├── XML_no_ext
│ │ │ └── XML_weird_ext.profile
│ │ ├── 463/
│ │ │ ├── left.C
│ │ │ └── right.C
│ │ ├── 472/
│ │ │ ├── lua_def.txt
│ │ │ └── not_really.lua
│ │ ├── 476/
│ │ │ ├── A/
│ │ │ │ ├── bye.C
│ │ │ │ ├── bye.f90
│ │ │ │ ├── hello.C
│ │ │ │ └── hello.f90
│ │ │ └── B/
│ │ │ ├── bye.f90
│ │ │ ├── hello.C
│ │ │ ├── hello.f90
│ │ │ └── yo.C
│ │ ├── 482/
│ │ │ └── A/
│ │ │ ├── C-Ansi.c
│ │ │ ├── hi.py
│ │ │ └── temp.c
│ │ ├── 494/
│ │ │ ├── P_EDI_Book.sql
│ │ │ └── P_EDI_BookF8.sql
│ │ ├── 502/
│ │ │ ├── FileCounter20200715140433.txt
│ │ │ └── Điếm LOC/
│ │ │ └── P_EDI_Book.sql
│ │ ├── 513/
│ │ │ ├── L/
│ │ │ │ └── empty.c
│ │ │ └── diff_list.txt
│ │ ├── 520/
│ │ │ └── julia_docstr.jl
│ │ ├── 521/
│ │ │ ├── Test 188/
│ │ │ │ ├── Test1.sql
│ │ │ │ └── UP0PB.sql
│ │ │ └── Test188New/
│ │ │ └── Test 188/
│ │ │ ├── Test1.sql
│ │ │ └── UP0PB.sql
│ │ ├── 528/
│ │ │ ├── Fortran77.f
│ │ │ ├── Lanczos.m
│ │ │ ├── Mathematica_1.m
│ │ │ ├── Octave.m
│ │ │ ├── hello.C
│ │ │ ├── hello.f
│ │ │ ├── matlab_line_colors.m
│ │ │ └── qsort_demo.m
│ │ ├── 530/
│ │ │ └── C-Ansi.c
│ │ ├── 537/
│ │ │ ├── my_define.txt
│ │ │ └── sourceCounter.vsql
│ │ ├── 538/
│ │ │ └── add.elm
│ │ ├── 539/
│ │ │ └── nested_comments.elm
│ │ ├── 540/
│ │ │ └── Hello.f
│ │ ├── 542/
│ │ │ └── txt_lang_def.txtt
│ │ ├── 577/
│ │ │ ├── diff_list_file.txt
│ │ │ ├── options.txt
│ │ │ ├── tour.swift
│ │ │ └── tour2.swift
│ │ ├── 579/
│ │ │ └── csharp-autogen.cs
│ │ ├── 580/
│ │ │ └── encodingtest.cs
│ │ ├── 596/
│ │ │ ├── def.txt
│ │ │ └── hello.C
│ │ ├── 597/
│ │ │ └── hello.C
│ │ ├── 606/
│ │ │ └── in/
│ │ │ └── nomad_job.hcl
│ │ ├── 611/
│ │ │ └── cmakelists.txt
│ │ ├── 613/
│ │ │ └── nav.scss
│ │ ├── 619/
│ │ │ └── RA.s
│ │ ├── 625/
│ │ │ ├── new/
│ │ │ │ └── hello.C
│ │ │ └── old/
│ │ │ └── .gitignore
│ │ ├── 628/
│ │ │ └── sample.graphql
│ │ ├── 644/
│ │ │ └── UInt8.cs
│ │ ├── 657/
│ │ │ ├── C-Ansi.c
│ │ │ ├── extra/
│ │ │ │ └── Mathematica_1.m
│ │ │ └── hello.f
│ │ ├── 670/
│ │ │ ├── hello.C
│ │ │ └── hi.py
│ │ ├── 692/
│ │ │ ├── A.txt
│ │ │ └── B.txt
│ │ ├── 701/
│ │ │ └── demo.ml
│ │ ├── 710/
│ │ │ ├── A/
│ │ │ │ ├── cal.data
│ │ │ │ └── hello.C
│ │ │ ├── B/
│ │ │ │ └── hello.C
│ │ │ └── test_files.list
│ │ ├── 712/
│ │ │ ├── dir1/
│ │ │ │ ├── main.c
│ │ │ │ └── sub_dir1/
│ │ │ │ └── foo.txt
│ │ │ └── dir2/
│ │ │ ├── foo.txt
│ │ │ └── main.c
│ │ ├── 713/
│ │ │ └── hello.C
│ │ ├── 720/
│ │ │ └── inputs.txt
│ │ ├── 722/
│ │ │ ├── Fortran77.f
│ │ │ ├── hello.f90
│ │ │ └── hello.lua
│ │ ├── 735/
│ │ │ └── excludes.txt
│ │ ├── 753/
│ │ │ ├── Application_Data_Test.feature.cs
│ │ │ ├── assembly.cs
│ │ │ └── csharp-designer.designer.cs
│ │ ├── 781/
│ │ │ ├── fortran.inc
│ │ │ ├── pascal.inc
│ │ │ └── test1.inc
│ │ ├── 784/
│ │ │ ├── .cloc-ignore
│ │ │ └── src/
│ │ │ └── net/
│ │ │ └── companies/
│ │ │ ├── assembly.cs
│ │ │ └── captcha.cs
│ │ ├── 785/
│ │ │ ├── (dir)/
│ │ │ │ └── test.svelte
│ │ │ ├── .cloc-ignore
│ │ │ └── ok/
│ │ │ └── ok.sh
│ │ ├── 804/
│ │ │ └── infoSQL.java
│ │ ├── 805/
│ │ │ └── text_block.java
│ │ ├── 806/
│ │ │ └── huffman.java
│ │ ├── 811/
│ │ │ └── inline_comment.xml
│ │ ├── 816/
│ │ │ └── star_slash_star.go
│ │ ├── 822/
│ │ │ ├── a/
│ │ │ │ └── b/
│ │ │ │ └── c.csv
│ │ │ └── a.csv
│ │ ├── 833/
│ │ │ └── Developer/
│ │ │ ├── abc.txt
│ │ │ └── clocTest/
│ │ │ └── foo/
│ │ │ ├── bar/
│ │ │ │ └── bar.swift
│ │ │ └── foo.swift
│ │ ├── 851/
│ │ │ └── level_1/
│ │ │ ├── flatbuffers.fbs
│ │ │ ├── hello.lua
│ │ │ └── level_2/
│ │ │ └── hello_2.lua
│ │ ├── 862/
│ │ │ ├── Fortran77.f
│ │ │ ├── a.py
│ │ │ ├── b.py
│ │ │ └── hello.c
│ │ ├── 898/
│ │ │ ├── irregular'file.md
│ │ │ └── regular.md
│ │ └── 906/
│ │ ├── current_version.py
│ │ └── previous_version.py
│ ├── julia.jl
│ ├── just_stuff.haml
│ ├── kvlang.kv
│ ├── layer.conf
│ ├── layout.dt
│ ├── linker.ld
│ ├── locale_facets.h
│ ├── logos.x
│ ├── logos.xm
│ ├── logtalk.lgt
│ ├── machineDefFreshIds.lem
│ ├── magikfile.magik
│ ├── main.f03
│ ├── master.blade.php
│ ├── matlab_line_colors.m
│ ├── md5.rkt
│ ├── meson.build
│ ├── messages.rb
│ ├── mfile.mk
│ ├── modules1-func1.pp
│ ├── modules1-func2.pp
│ ├── modules1-ntp1.pp
│ ├── modules1-typealias.pp
│ ├── moonbit.mbt
│ ├── moonbit.mbti
│ ├── nested.lua
│ ├── nomad_job.hcl
│ ├── notes.typ
│ ├── nu-example.nu
│ ├── nuon-example.nuon
│ ├── offline.jcl
│ ├── openharmony.ets
│ ├── orgmode.org
│ ├── page_layout.aspx
│ ├── pages.wxml
│ ├── pages.wxss
│ ├── parser_1.civet
│ ├── parser_2.civet
│ ├── pascal.inc
│ ├── pek_example.pek
│ ├── ping_pong.lfe
│ ├── plain_text.txt
│ ├── plantuml.puml
│ ├── pointillism.pde
│ ├── poly_constructor.jai
│ ├── pop_by_country.xq
│ ├── prob060-andreoss.p6
│ ├── proguard-project-app.pro
│ ├── qsort_demo.m
│ ├── queue.p
│ ├── rand.apl
│ ├── ranges.surql
│ ├── razor.cshtml
│ ├── reStructuredText.rst
│ ├── reactive.svelte
│ ├── regex_limit.gradle
│ ├── ring.pony
│ ├── robotframework.robot
│ ├── robotframework.tsv
│ ├── roku.brs
│ ├── rules.sss
│ ├── sample.R
│ ├── sample.bicep
│ ├── sample.ejs
│ ├── schema.prisma
│ ├── scheme.sls
│ ├── script1-hadoop.pig
│ ├── sdp_parser.jspeg
│ ├── sdp_parser.peg
│ ├── sdp_parser.peggy
│ ├── sdp_parser.pegjs
│ ├── sdp_parser.tspeg
│ ├── send_msg.applescript
│ ├── server_side.aspx
│ ├── sharpsign.cl
│ ├── slug.astro
│ ├── solidity.sol
│ ├── specman_e.e
│ ├── specman_e2.e
│ ├── squirrel_table.nut
│ ├── stata.do
│ ├── statcsv.nim
│ ├── streamlines.pro
│ ├── string.gleam
│ ├── style.scss
│ ├── swig_example.i
│ ├── temp.c
│ ├── templ_example.templ
│ ├── test-1.0-py2.py3-none-win32.whl
│ ├── test.Dsr
│ ├── test.Rmd
│ ├── test.hs
│ ├── test.rego
│ ├── test.vbhtml
│ ├── test.vbs
│ ├── test1.inc
│ ├── test1.lhs
│ ├── test1.php
│ ├── test2.lhs
│ ├── test_w_cpp_comments.svelte
│ ├── tictactoe3d.ring
│ ├── tnsdl.sdl
│ ├── toml.pest
│ ├── toml_example.toml
│ ├── tour.swift
│ ├── traffic_light.fsl
│ ├── triple_lang_def.txt
│ ├── type.wast
│ ├── updateSprites.wgsl
│ ├── utilities.R
│ ├── variable_length.carbon
│ ├── vba_test.vba
│ ├── vbnet_test.vb
│ ├── vbox.fxml
│ ├── verilog.sv
│ ├── vinos.nlogo
│ ├── vs_solution.sln
│ ├── vtl.vm
│ ├── vyper.vy
│ ├── warship.ts
│ ├── webservice.wsdl
│ ├── wiki.properties
│ ├── window.blp
│ ├── with_pod.pl
│ ├── wokka.cbl
│ ├── wokka.cs
│ ├── wpedia.ini
│ ├── x.mustache
│ ├── xattr.conf
│ ├── zir_sema.zig
│ └── zos_assembly.s
├── make_git_repo.bash
└── outputs/
├── 00_C.yaml
├── 955.bpmn.yaml
├── 955.hbm.xml.yaml
├── 955.jrxml.yaml
├── 955.lb.xml.yaml
├── 955.tld.yaml
├── AnsProlog.lp.yaml
├── Arturo.art.yaml
├── Assembler-Intel.asm.yaml
├── Assembly-sysv.S.yaml
├── BUILD.yaml
├── BasicPlane.Figures-Rectangle.ixx.yaml
├── BoxWidget.ui.yaml
├── Buchberger.cocoa5.yaml
├── C#.cs.yaml
├── C++-MFC.cc.yaml
├── C++-uppercase.CPP.yaml
├── C-Ansi.c.yaml
├── C.g4.yaml
├── ChangeProperties.il.yaml
├── Chapel.chpl.yaml
├── Cobol.cbl.yaml
├── CodeQL.ql.yaml
├── ColdFusion.cfm.yaml
├── Combinators.idr.yaml
├── Containerfile.yaml
├── Counter.razor.yaml
├── DIEnumerator-10.0.ll.yaml
├── DocTest.thrift.yaml
├── Dockerfile.yaml
├── ERC20.cairo.yaml
├── ExprParser.g.yaml
├── FOCUS.focexec.yaml
├── Fortran77.f.yaml
├── Fortran90.f90.yaml
├── FreemarkerTemplate.ftl.yaml
├── GamePanel.tscn.yaml
├── Gencat-NLS.msg.yaml
├── Haskell.hs.yaml
├── Hello.lidr.yaml
├── HelpersView.axaml.yaml
├── IDL.idl.yaml
├── ItemView.vue.yaml
├── Java.java.yaml
├── JetCar.cls.yaml
├── LaTeX.tex.yaml
├── Lanczos.m.yaml
├── LogMain.re.yaml
├── Lookup.agda.yaml
├── MSDOS.bat.yaml
├── Makefile.yaml
├── Mako.mako.yaml
├── Mathematica_1.m.yaml
├── Mathematica_2.wlt.yaml
├── Mojo.mojom.yaml
├── Mumps.mps.yaml
├── Octave.m.yaml
├── Once.HC.yaml
├── Pascal.pas.yaml
├── Pascal.pp.yaml
├── PlusCalExample-no-autogen.tla.yaml
├── PlusCalExample.tla.yaml
├── Prelude.dhall.yaml
├── ProcessPO.odx.yaml
├── RedBlackTree.res.yaml
├── RemoteSiteHelperTest.cls.yaml
├── RenderTest.metal.yaml
├── Rounds.scad.yaml
├── SVG_logo.svg.yaml
├── Sample.mc.yaml
├── SimpleODE.mo.yaml
├── Slim.html.slim.yaml
├── Slint-helloworld.slint.yaml
├── Snakefile.yaml
├── Splice.hs-boot.yaml
├── Sys.hx.yaml
├── TLAExample.tla.yaml
├── TableGen-ARM.yaml
├── Test.daml.yaml
├── Tk.yaml
├── Trapezoid_Rule.ipynb.yaml
├── TypeScript.ts.yaml
├── TypeScript_2.ts.yaml
├── USS.uss.yaml
├── UXML.uxml.yaml
├── X++.xpo.yaml
├── XML.xml.yaml
├── XSL-FO.xsl.yaml
├── XSLT.xslt.yaml
├── XmlToJSONSendPipeline.btp.yaml
├── Xtend.xtend.yaml
├── ZosMsg.mc.yaml
├── ZosNet.rc.yaml
├── ZosNp.def.yaml
├── aa.yaml
├── acpclust.R.yaml
├── apertium-dan.dan.rlx.yaml
├── args.janet.yaml
├── arvo.hoon.yaml
├── asciidoctor.adoc.yaml
├── assembly.cs.yaml
├── basic.luau.yaml
├── basic.p4.yaml
├── bbf-device.yang.yaml
├── beluga.bel.yaml
├── birds.pro.yaml
├── bitbake.yaml
├── blur.glsl.yaml
├── body.gjs.yaml
├── bubs_tak_ard.prc.yaml
├── build.bzl.yaml
├── build.cake.yaml
├── cad.asy.yaml
├── cadence_test.cdc.yaml
├── captcha.cs.yaml
├── capture.ecr.yaml
├── certificates.sls.yaml
├── ch10-REPL-oriented-repl-interactions.cj.yaml
├── chat.st.yaml
├── child_template.jinja2.yaml
├── child_template.njk.yaml
├── clarityfiles.clar.yaml
├── class.imba.yaml
├── cli-args.nf.yaml
├── cloc-dev.code-workspace.yaml
├── cloc_counts.csv.yaml
├── clusterConf.ttcn.yaml
├── comments.rhai.yaml
├── comments_in_str.svelte.yaml
├── comp.ecpp.yaml
├── complex_union.derw.yaml
├── conditions.CBL.yaml
├── config.junos.yaml
├── cross-platform.just.yaml
├── csharp-designer.designer.cs.yaml
├── cucumber.feature.yaml
├── custom.triple.extension.js.yaml
├── darwin-configuration.nix.yaml
├── dd.yaml
├── demo.odin.yaml
├── dev.exs.yaml
├── dlist.lean.yaml
├── door.tres.yaml
├── dotNET_intermediate.il.yaml
├── double_doors.dsc.yaml
├── drools.drl.yaml
├── drupal.mxml.yaml
├── eddsa.circom.yaml
├── elixir.ex.yaml
├── en_AU.po.yaml
├── example_2d.gdshader.yaml
├── exclude_dir_1.yaml
├── fib.dfy.yaml
├── fib_class.pkl.yaml
├── fibonacci.ncl.yaml
├── find.plm.yaml
├── flatbuffers.fbs.yaml
├── fmt.ha.yaml
├── foo_bar.yaml
├── fractal.um.yaml
├── fsharp.fs.yaml
├── fsharp_script.fsx.yaml
├── functional.cj.yaml
├── futhark.fut.yaml
├── generate.fnl.yaml
├── git_helpers.fish.yaml
├── git_tests/
│ ├── 04179b6_ae0d26e.yaml
│ ├── contents_f647093e8.tar.yaml
│ ├── count_and_diff.yaml.HEAD
│ ├── count_and_diff.yaml.HEAD~1
│ ├── count_and_diff.yaml.diff.HEAD~1.HEAD
│ ├── d9b672643d.yaml
│ ├── diff_contents_f647093e8.tar.yaml
│ ├── diff_f15bf042b_f647093e8b.yaml
│ ├── f15bf04_d9b6726.yaml
│ └── f647093e8be3.yaml
├── github_user.aria.yaml
├── glade-search-popover.ui.yaml
├── glossary.json.yaml
├── glossary.json5.yaml
├── gnureadline.vala.yaml
├── graphql.gql.yaml
├── greeter.tsx.yaml
├── guard_talking.yarn.yaml
├── guestbook.tpl.yaml
├── harbour_xbase.prg.yaml
├── hello.bf.yaml
├── hello.f.yaml
├── hello.f90.yaml
├── hello.kt.yaml
├── hello.lua.yaml
├── hello.pas.yaml
├── hello.pl1.yaml
├── hello.sp.yaml
├── hello1.pas.yaml
├── hello_app.go-1.yaml
├── hello_app.go-2.yaml
├── helloworld.raml.yaml
├── hi.mojo.yaml
├── hi.py.yaml
├── htlc.teal.yaml
├── html_heex_example.heex.yaml
├── i18n_de.ts.yaml
├── iclean.icl.yaml
├── idris_block_comments.idr.yaml
├── igorpro.ipf.yaml
├── includes_demo.mustache.yaml
├── inner_ref.jsonnet.yaml
├── input.gts.yaml
├── insertJournalEntry.ipl.yaml
├── invoices.prql.yaml
├── io.c3.yaml
├── issue_875.bdy.yaml
├── issue_876.vue.yaml
├── issues/
│ ├── 114/
│ │ ├── T1.yaml
│ │ ├── T2.yaml
│ │ ├── T3.yaml
│ │ ├── T4.yaml
│ │ ├── T5.yaml
│ │ ├── T6.yaml
│ │ └── T7.yaml
│ ├── 131/
│ │ ├── T1.yaml
│ │ └── T2.yaml
│ ├── 132/
│ │ ├── T1.yaml
│ │ ├── T2.yaml
│ │ ├── T3.yaml
│ │ ├── T4.yaml
│ │ ├── T5.yaml
│ │ └── T6.yaml
│ ├── 147/
│ │ └── T1.yaml
│ ├── 166/
│ │ └── fake.thy.yaml
│ ├── 183/
│ │ ├── eval1957.SACunidir.fr.yaml
│ │ └── file.fth.yaml
│ ├── 245/
│ │ └── CRS.scala.yaml
│ ├── 280/
│ │ ├── 280.yaml
│ │ └── 280_by_file.yaml
│ ├── 286/
│ │ ├── 1.yaml
│ │ ├── 2.yaml
│ │ ├── 3.yaml
│ │ ├── 4.yaml
│ │ ├── 5.yaml
│ │ └── 6.yaml
│ ├── 296/
│ │ └── results.yaml
│ ├── 312/
│ │ └── results.yaml
│ ├── 327/
│ │ └── results.yaml
│ ├── 341/
│ │ └── results.yaml
│ ├── 350/
│ │ └── fs.go.yaml
│ ├── 365/
│ │ └── results.yaml
│ ├── 370/
│ │ └── results.yaml
│ ├── 375/
│ │ └── results.yaml
│ ├── 380/
│ │ └── wrapper.pl.yaml
│ ├── 381/
│ │ ├── issue381.c.yaml
│ │ └── issue381.java.yaml
│ ├── 396/
│ │ ├── excl.yaml
│ │ └── excl_diff.yaml
│ ├── 405/
│ │ └── globs.py.yaml
│ ├── 407/
│ │ ├── results1.yaml
│ │ ├── results2.yaml
│ │ └── results3.yaml
│ ├── 408/
│ │ └── badly_named_ruby.yaml
│ ├── 420/
│ │ └── results.yaml
│ ├── 433/
│ │ └── results.yaml
│ ├── 454/
│ │ └── createServer.js.yaml
│ ├── 455/
│ │ ├── list.yaml
│ │ └── list_align.yaml
│ ├── 456/
│ │ ├── XML_no_ext.yaml
│ │ └── XML_weird_ext.profile.yaml
│ ├── 463/
│ │ └── diff.yaml
│ ├── 472/
│ │ └── not_really.lua.yaml
│ ├── 476/
│ │ ├── all.yaml
│ │ ├── no_cpp.yaml
│ │ └── no_fortran.yaml
│ ├── 482/
│ │ └── results.yaml
│ ├── 494/
│ │ └── results.yaml
│ ├── 502/
│ │ └── results.yaml
│ ├── 513/
│ │ └── results.yaml
│ ├── 520/
│ │ ├── doc_as_code.yaml
│ │ └── doc_as_comment.yaml
│ ├── 521/
│ │ ├── skip_uniq.yaml
│ │ └── uniq.yaml
│ ├── 528/
│ │ ├── cutoff_code_10.yaml
│ │ ├── cutoff_code_50pct.yaml
│ │ └── cutoff_files_1.yaml
│ ├── 530/
│ │ ├── case_1.yaml
│ │ ├── case_2.yaml
│ │ ├── case_3.yaml
│ │ ├── case_4.yaml
│ │ └── tests.sh
│ ├── 537/
│ │ ├── results_force.yaml
│ │ └── results_read.yaml
│ ├── 538/
│ │ └── add.elm.yaml
│ ├── 539/
│ │ └── nested_comments.elm.yaml
│ ├── 540/
│ │ └── Hello.f.yaml
│ ├── 542/
│ │ └── results.yaml
│ ├── 577/
│ │ └── diff_list.yaml
│ ├── 579/
│ │ └── csharp-autogen.cs.yaml
│ ├── 580/
│ │ └── encodingtest.cs.yaml
│ ├── 596/
│ │ └── results.yaml
│ ├── 597/
│ │ └── results.yaml
│ ├── 599/
│ │ └── results.yaml
│ ├── 606/
│ │ └── results.yaml
│ ├── 611/
│ │ └── cmakelists.txt.yaml
│ ├── 613/
│ │ └── nav.scss.yaml
│ ├── 619/
│ │ └── RA.s.yaml
│ ├── 625/
│ │ └── results.yaml
│ ├── 628/
│ │ └── results.yaml
│ ├── 637/
│ │ ├── diff_incl_lang.yaml
│ │ └── straight_incl_lang.yaml
│ ├── 644/
│ │ └── results.yaml
│ ├── 657/
│ │ └── results.yaml
│ ├── 670/
│ │ └── results.yaml
│ ├── 692/
│ │ └── results.yaml
│ ├── 701/
│ │ └── results.yaml
│ ├── 708/
│ │ └── results.yaml
│ ├── 710/
│ │ └── results.yaml
│ ├── 712/
│ │ └── results.yaml
│ ├── 713/
│ │ └── results.yaml
│ ├── 720/
│ │ └── results.yaml
│ ├── 722/
│ │ └── results_1.yaml
│ ├── 735/
│ │ └── results.yaml
│ ├── 753/
│ │ ├── all.yaml
│ │ └── no_autogen.yaml
│ ├── 772/
│ │ └── results.yaml
│ ├── 781/
│ │ └── results.yaml
│ ├── 784/
│ │ └── results.yaml
│ ├── 785/
│ │ └── results.yaml
│ ├── 804/
│ │ └── infoSQL.java.yaml
│ ├── 805/
│ │ └── text_block.java.yaml
│ ├── 806/
│ │ └── results.yaml
│ ├── 811/
│ │ └── inline_comment.xml.yaml
│ ├── 816/
│ │ └── results.yaml
│ ├── 822/
│ │ ├── T1.yaml
│ │ ├── T2.yaml
│ │ ├── T3.yaml
│ │ ├── T4.yaml
│ │ ├── T5.yaml
│ │ ├── T6.yaml
│ │ ├── T7.yaml
│ │ └── T8.yaml
│ ├── 833/
│ │ └── results.yaml
│ ├── 851/
│ │ └── results.yaml
│ ├── 862/
│ │ ├── diff_results.yaml
│ │ └── results.yaml
│ ├── 886/
│ │ ├── results.yaml
│ │ └── results_by_file.yaml
│ ├── 898/
│ │ └── results.yaml
│ ├── 906/
│ │ └── results.yaml
│ └── 917/
│ └── results.yaml
├── julia.jl.yaml
├── just_stuff.haml.yaml
├── kvlang.kv.yaml
├── layout.dt.yaml
├── linker.ld.yaml
├── locale_facets.h.yaml
├── logos.x.yaml
├── logos.xm.yaml
├── logtalk.lgt.yaml
├── machineDefFreshIds.lem.yaml
├── magikfile.magik.yaml
├── main.f03.yaml
├── master.blade.php.yaml
├── matlab_line_colors.m.yaml
├── md5.rkt.yaml
├── meson.build.yaml
├── messages.rb.yaml
├── mfile.mk.yaml
├── modules1-func1.pp.yaml
├── modules1-func2.pp.yaml
├── modules1-ntp1.pp.yaml
├── modules1-typealias.pp.yaml
├── moonbit.yaml
├── nested.lua.yaml
├── nomad_job.hcl.yaml
├── notes.typ.yaml
├── nu-example.nu.yaml
├── nuon-example.nuon.yaml
├── offline.jcl.yaml
├── openharmony.ets.yaml
├── orgmode.org.yaml
├── page_layout.aspx.yaml
├── pages.wxml.yaml
├── pages.wxss.yaml
├── parser_1.civet.yaml
├── parser_2.civet.yaml
├── pawn.yaml
├── pek_example.pek.yaml
├── ping_pong.lfe.yaml
├── plain_text.txt.yaml
├── plantuml.puml.yaml
├── pointillism.pde.yaml
├── poly_constructor.jai.yaml
├── pop_by_country.xq.yaml
├── prob060-andreoss.p6.yaml
├── proguard-project-app.pro.yaml
├── qsort_demo.m.yaml
├── rand.apl.yaml
├── ranges.surql.yaml
├── razor.cshtml.yaml
├── reStructuredText.rst.yaml
├── reactive.svelte.yaml
├── regex_limit.gradle.yaml
├── ring.pony.1.yaml
├── ring.pony.2.yaml
├── robotframework.robot.yaml
├── robotframework.tsv.yaml
├── roku.brs.yaml
├── rules.sss.yaml
├── sample.R.yaml
├── sample.bicep.yaml
├── sample.ejs.yaml
├── schema.prisma.yaml
├── scheme.sls.yaml
├── script1-hadoop.pig.yaml
├── sdp_parser.jspeg.yaml
├── sdp_parser.peg.yaml
├── sdp_parser.peggy.yaml
├── sdp_parser.pegjs.yaml
├── sdp_parser.tspeg.yaml
├── send_msg.applescript.yaml
├── server_side.aspx.yaml
├── sharpsign.cl.yaml
├── slug.astro.yaml
├── solidity.sol.yaml
├── specman_e.e.yaml
├── specman_e2.e.yaml
├── squirrel_table.nut.yaml
├── stata.do.yaml
├── statcsv.nim.yaml
├── streamlines.pro.yaml
├── string.gleam.yaml
├── style.scss.yaml
├── swig_example.i.yaml
├── temp.c.yaml
├── templ_example.templ.yaml
├── test-1.0-py2.py3-none-win32.whl.yaml
├── test.Dsr.yaml
├── test.Rmd.yaml
├── test.hs.yaml
├── test.rego.yaml
├── test.vbhtml.yaml
├── test.vbs.yaml
├── test1.inc.yaml
├── test1.lhs.yaml
├── test1.php.yaml
├── test2.lhs.yaml
├── test_w_cpp_comments.svelte.yaml
├── tictactoe3d.ring.yaml
├── tnsdl.sdl.yaml
├── toml.pest.yaml
├── toml_example.toml.yaml
├── tour.swift.yaml
├── traffic_light.fsl.yaml
├── type.wast.yaml
├── updateSprites.wgsl.yaml
├── utilities.R.yaml
├── variable_length.carbon.yaml
├── vba_test.vba.yaml
├── vbnet_test.vb.yaml
├── vbox.fxml.yaml
├── verilog.sv.yaml
├── vinos.nlogo.yaml
├── vs_solution.sln.yaml
├── vtl.vm.yaml
├── vyper.vy.yaml
├── warship.ts.yaml
├── webservice.wsdl.yaml
├── wiki.properties.yaml
├── window.blp.yaml
├── with_pod.pl.yaml
├── wokka.cbl.yaml
├── wokka.cs.yaml
├── wpedia.ini.yaml
├── x.mustache.yaml
├── zir_sema.zig.yaml
└── zos_assembly.s.yaml
SYMBOL INDEX (179 symbols across 64 files)
FILE: tests/inputs/Application_Data_Test.feature.cs
class ApplicationData_Test (line 20) | [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3....
FILE: tests/inputs/C#.cs
class HelloWorld (line 6) | class HelloWorld
method Main (line 8) | public static int Main(String[] args)
FILE: tests/inputs/C++-MFC.cc
class CHello (line 7) | class CHello : public CFrameWnd
method CHello (line 10) | CHello()
class CHelloApp (line 16) | class CHelloApp : public CWinApp
function BOOL (line 22) | BOOL CHelloApp::InitInstance()
FILE: tests/inputs/C++-uppercase.CPP
function main (line 3) | int main() {}
FILE: tests/inputs/C-Ansi.c
function main (line 7) | int main(void)
FILE: tests/inputs/Java.java
class ControllerClass (line 7) | @Controller
class HelloWorld (line 26) | class HelloWorld {
method main (line 27) | static public void main( String args[] ) {
FILE: tests/inputs/TypeScript.ts
class Base64Format (line 17) | class Base64Format {
method encode (line 19) | static encode(inValue: number) {
method decodeChar (line 26) | static decodeChar(inChar: string) {
class Base64VLQFormat (line 35) | class Base64VLQFormat {
method encode (line 36) | static encode(inValue: number) {
method decode (line 64) | static decode(inString: string) {
FILE: tests/inputs/aa/bb/cc/plasma.c
function now_ms (line 37) | static double now_ms(void)
type Fixed (line 52) | typedef int32_t Fixed;
type Angle (line 75) | typedef int32_t Angle;
function init_angles (line 101) | static void init_angles(void)
function Fixed (line 110) | static __inline__ Fixed angle_sin( Angle a )
function Fixed (line 115) | static __inline__ Fixed angle_cos( Angle a )
function Fixed (line 120) | static __inline__ Fixed fixed_sin( Fixed f )
function Fixed (line 125) | static __inline__ Fixed fixed_cos( Fixed f )
function make565 (line 140) | static uint16_t make565(int red, int green, int blue)
function init_palette (line 147) | static void init_palette(void)
function palette_from_fixed (line 172) | static __inline__ uint16_t palette_from_fixed( Fixed x )
function init_tables (line 182) | static void init_tables(void)
function fill_plasma (line 188) | static void fill_plasma( AndroidBitmapInfo* info, void* pixels, double...
type FrameStats (line 269) | typedef struct {
type Stats (line 277) | typedef struct {
function stats_init (line 287) | static void
function stats_startFrame (line 296) | static void
function stats_endFrame (line 302) | static void
function JNICALL (line 363) | JNICALL Java_com_example_plasma_PlasmaView_renderPlasma(JNIEnv * env, jo...
FILE: tests/inputs/csharp-designer.designer.cs
class Strings (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Strings (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: tests/inputs/dd/bb/config.c
type _inittab (line 45) | struct _inittab
FILE: tests/inputs/diff/A/d2/hello.java
class Hi (line 3) | class Hi {
method main (line 4) | static public void main( String args[] ) {
FILE: tests/inputs/diff/A/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/diff/B/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/elixir.ex
class Test (line 3) | defmodule Test
method foo (line 12) | def foo do
method bar (line 19) | def bar, do: :bar
FILE: tests/inputs/greeter.tsx
class Greeter (line 5) | class Greeter {
method constructor (line 6) | constructor(public greeting: string) { }
method greet (line 7) | greet() {
FILE: tests/inputs/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/hello.java
class Hi (line 3) | class Hi {
method main (line 4) | static public void main( String args[] ) {
FILE: tests/inputs/hello_app.go
function init (line 26) | func init() {
function helloHandler (line 31) | func helloHandler(w http.ResponseWriter, r *http.Request) {
FILE: tests/inputs/hello_app_autogen.go
function init (line 27) | func init() {
function helloHandler (line 32) | func helloHandler(w http.ResponseWriter, r *http.Request) {
FILE: tests/inputs/issues/132/C-Ansi.c
function main (line 7) | int main(void)
FILE: tests/inputs/issues/280/L/hello_1.c
function main (line 6) | int main(void)
FILE: tests/inputs/issues/280/R/hello_2.c
function main (line 7) | int main(void)
FILE: tests/inputs/issues/286/project/read_subdir/hi.c
function main (line 3) | int main() { int x = 1;
FILE: tests/inputs/issues/318/Réponse.cs
class Test (line 4) | class Test {
method Main (line 5) | static void Main() {
FILE: tests/inputs/issues/350/fs.go
function List (line 3) | func List() []string {
method AtomicCreateWith (line 7) | func (fs aferoFs) AtomicCreateWith(fname string, data []byte) {
function deleteTmpFiles (line 16) | func deleteTmpFiles(fs afero.Fs) {
FILE: tests/inputs/issues/365/RSpecTests.java
class RSpecTests (line 17) | public final class RSpecTests {
method rspecTests (line 18) | @Test
FILE: tests/inputs/issues/375/docstring.py
function abc (line 5) | def abc(d,
class Abc (line 21) | class Abc():
method Xyz (line 28) | def Xyz(d):
FILE: tests/inputs/issues/381/issue381.java
class CIMD2Alphabet (line 6) | public class CIMD2Alphabet{
FILE: tests/inputs/issues/407/count_dir/C-Ansi.c
function main (line 7) | int main(void)
FILE: tests/inputs/issues/407/count_dir/Test/Java.java
class ControllerClass (line 7) | @Controller
class HelloWorld (line 26) | class HelloWorld {
method main (line 27) | static public void main( String args[] ) {
FILE: tests/inputs/issues/407/level2/Java.java
class ControllerClass (line 7) | @Controller
class HelloWorld (line 26) | class HelloWorld {
method main (line 27) | static public void main( String args[] ) {
FILE: tests/inputs/issues/407/level2/level/Test/C-Ansi.c
function main (line 7) | int main(void)
FILE: tests/inputs/issues/454/createServer.js
function createServer (line 1) | function createServer () {
FILE: tests/inputs/issues/476/A/bye.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/476/A/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/476/B/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/476/B/yo.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/482/A/C-Ansi.c
function main (line 7) | int main(void)
FILE: tests/inputs/issues/528/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/530/C-Ansi.c
function main (line 7) | int main(void)
FILE: tests/inputs/issues/579/csharp-autogen.cs
class _Default (line 13) | public partial class _Default
FILE: tests/inputs/issues/596/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/597/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/625/new/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/657/C-Ansi.c
function main (line 7) | int main(void)
FILE: tests/inputs/issues/670/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/710/A/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/710/B/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/712/dir1/main.c
function main (line 3) | int main(void){
FILE: tests/inputs/issues/712/dir2/main.c
function main (line 3) | int main(void){
FILE: tests/inputs/issues/713/hello.C
function main (line 3) | int main ()
FILE: tests/inputs/issues/753/Application_Data_Test.feature.cs
class ApplicationData_Test (line 20) | [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3....
FILE: tests/inputs/issues/753/csharp-designer.designer.cs
class Strings (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Strings (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: tests/inputs/issues/804/infoSQL.java
method infoSQL (line 1) | public void infoSQL(String sql, String params, long count, long time) {
FILE: tests/inputs/issues/805/text_block.java
method getBlockOfHtml (line 2) | public String getBlockOfHtml() {
FILE: tests/inputs/issues/806/huffman.java
class Huffman (line 1) | public class Huffman
FILE: tests/inputs/issues/862/hello.c
function main (line 4) | int main(void)
FILE: tests/inputs/issues/906/current_version.py
function main (line 45) | def main():
function mapTechExtensions (line 80) | def mapTechExtensions(engine,or_code,logger):
function list_file_extensions_all_branches (line 260) | def list_file_extensions_all_branches(project):
function wrapper_function (line 296) | def wrapper_function(branch_name, project):
function list_file_extensions_recursive (line 304) | def list_file_extensions_recursive(project,branch_name, path=""):
function connectDB (line 336) | def connectDB():
function domain_selector (line 347) | def domain_selector(domain):
function connectGit (line 355) | def connectGit(domain):
function newConnectGitFn (line 368) | def newConnectGitFn(domain):
function create_table (line 381) | def create_table(conn, table_name):
FILE: tests/inputs/issues/906/previous_version.py
function main (line 45) | def main():
function mapTechExtensions (line 80) | def mapTechExtensions(engine,or_code,logger):
function list_file_extensions_all_branches (line 260) | def list_file_extensions_all_branches(project):
function wrapper_function (line 296) | def wrapper_function(branch_name, project):
function list_file_extensions_recursive (line 304) | def list_file_extensions_recursive(project,branch_name, path=""):
function connectDB (line 336) | def connectDB():
function domain_selector (line 347) | def domain_selector(domain):
function connectGit (line 355) | def connectGit(domain):
function newConnectGitFn (line 368) | def newConnectGitFn(domain):
FILE: tests/inputs/locale_facets.h
function _OutIter (line 122) | _OutIter
type _InIter (line 449) | typedef _InIter iter_type;
type basic_string (line 954) | typedef basic_string<_CharT> string_type;
type _InIter (line 999) | typedef _InIter iter_type;
type basic_string (line 1000) | typedef basic_string<_CharT> string_type;
function iter_type (line 1043) | iter_type
function iter_type (line 1073) | iter_type
type _OutIter (line 1133) | typedef _OutIter iter_type;
type basic_string (line 1134) | typedef basic_string<_CharT> string_type;
function iter_type (line 1167) | iter_type
function iter_type (line 1189) | iter_type
type messages_base (line 1255) | struct messages_base
type basic_string (line 1288) | typedef basic_string<_CharT> string_type;
function catalog (line 1335) | catalog
function string_type (line 1371) | string_type
function close (line 1382) | void
function virtual (line 1429) | virtual void
type basic_string (line 1501) | typedef basic_string<_CharT> string_type;
FILE: tests/inputs/messages.rb
class GuruMessages (line 38) | class GuruMessages
method initialize (line 39) | def initialize
method add (line 43) | def add(fromplayer, player, message)
method tell (line 52) | def tell(player)
method alert (line 70) | def alert(fromplayer, player)
method trigger (line 77) | def trigger(player)
FILE: tests/inputs/test1.php
function get (line 13) | function get()
FILE: tests/inputs/warship.ts
class Cell (line 5) | class Cell {
method constructor (line 10) | constructor(public row: number, public column: number) {
method parseCellLocation (line 15) | static parseCellLocation(pos: string) {
method cellLocation (line 21) | cellLocation() {
class Ship (line 26) | class Ship {
method constructor (line 33) | constructor(public size: number) {
method updatePosition (line 37) | updatePosition(row: number, column: number, vertical: boolean) {
method updateLayout (line 44) | updateLayout() {
method flipShip (line 53) | flipShip() {
method getCellsCovered (line 67) | getCellsCovered() {
method isSunk (line 82) | isSunk() {
class Board (line 87) | class Board {
method constructor (line 96) | constructor(public element: HTMLElement, playerBoard: boolean = true) {
method dragAndDropEnabled (line 159) | set dragAndDropEnabled(val: boolean) {
method getRandomPosition (line 168) | static getRandomPosition() {
method onCellClick (line 176) | onCellClick(evt: JQueryEventObject) {
method bombCell (line 189) | bombCell(cellElem: HTMLElement) {
method randomize (line 218) | randomize() {
method boardIsValid (line 228) | boardIsValid() {
method chooseMove (line 251) | chooseMove() {
method updateCellData (line 259) | private updateCellData() {
method allShipsSunk (line 280) | private allShipsSunk() {
class Game (line 285) | class Game {
method constructor (line 303) | constructor() {
method computersTurn (line 366) | private computersTurn() {
method startGame (line 374) | private startGame() {
method updateStatus (line 386) | private updateStatus(msg: string) {
FILE: tests/inputs/wokka.cs
class Test (line 4) | class Test {
method Main (line 5) | static void Main() {
Condensed preview — 1027 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,388K chars).
[
{
"path": ".devcontainer/Dockerfile",
"chars": 762,
"preview": "# Original Dockerfile by Sébastien HOUZÉ, https://github.com/shouze\n# Adapted for use as devcontainer\nFROM perl:slim AS "
},
{
"path": ".devcontainer/devcontainer.json",
"chars": 221,
"preview": "{\n \"build\": { \"dockerfile\": \"Dockerfile\" },\n \"extensions\": [\n \"mhutchie.git-graph\",\n \"eamodio.gitlen"
},
{
"path": ".dockerignore",
"chars": 26,
"preview": ".github\nLICENSE\nREADME.md\n"
},
{
"path": ".github/FUNDING.yml",
"chars": 67,
"preview": "# These are supported funding model platforms\n\ngithub: [AlDanial] \n"
},
{
"path": ".github/ISSUE_TEMPLATE/report-a-bug.md",
"chars": 527,
"preview": "---\nname: report a bug\nabout: report a bug\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the bug**\nA concise descr"
},
{
"path": ".github/ISSUE_TEMPLATE/request-an-enhancement.md",
"chars": 395,
"preview": "---\nname: request an enhancement\nabout: request support for additional languages or new capabilities\ntitle: ''\nlabels: '"
},
{
"path": ".github/workflows/build.yml",
"chars": 512,
"preview": "# This workflow will build a container image,\n# to run all tests (syntax checking + integration tests) on each PR and gi"
},
{
"path": ".github/workflows/release-ready.yml",
"chars": 3126,
"preview": "name: Create release\n\non:\n pull_request:\n types: [closed]\n\njobs:\n create_release:\n if: ${{ github.event.pull_req"
},
{
"path": ".github/workflows/release-staging.yml",
"chars": 7600,
"preview": "name: Build Windows executable\n\non:\n pull_request:\n types: [labeled]\n\njobs:\n staging_build:\n if: ${{ github.even"
},
{
"path": ".gitignore",
"chars": 135,
"preview": "cloc-?.??.*\nrelease_notes-?.??.txt\n\n# Visual Studio Code and extensions\n.vstags\n.vscode/perl-lang\n.gitmodules\nUnix/cloc_"
},
{
"path": ".vscode/launch.json",
"chars": 375,
"preview": "{\n // Further information: https://go.microsoft.com/fwlink/?linkid=830387\n \"version\": \"0.2.0\",\n \"configurations"
},
{
"path": "Dockerfile",
"chars": 1329,
"preview": "# Dockerfile by Sébastien HOUZÉ, https://github.com/shouze\nFROM perl:slim AS builder\n\nRUN export DEBIAN_FRONTEND=noninte"
},
{
"path": "Dockerfile.build",
"chars": 65,
"preview": "FROM alpine:3.11\n\nRUN apk add --no-cache cloc\nENTRYPOINT [\"cloc\"]"
},
{
"path": "LICENSE",
"chars": 18047,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Fr"
},
{
"path": "README.md",
"chars": 170618,
"preview": "# cloc\n*Count Lines of Code*\n\n* * *\ncloc counts blank lines, comment lines, and physical lines of source code in many pr"
},
{
"path": "Unix/AUTHORS",
"chars": 1064,
"preview": "Al Danial <al.danial@gmail.com>, https://github.com/AlDanial\nhttps://github.com/stsnel\nhttps://github.com/MichaelDimmitt"
},
{
"path": "Unix/COPYING",
"chars": 18092,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Fr"
},
{
"path": "Unix/INSTALL",
"chars": 235,
"preview": "Adjust prefix variables to install to other than system default:\n\n\tmake [-n] [prefix=/usr/local] install\n\nFor more infor"
},
{
"path": "Unix/Makefile",
"chars": 3613,
"preview": "#!/usr/bin/make -f\n#\n# Copyright information\n#\n#\tCopyright (C) 2012 Jari Aalto\n#\n# License\n#\n#\tThis program is free "
},
{
"path": "Unix/NEWS",
"chars": 57348,
"preview": " Release Notes for cloc version 2.08\n https://github.com/AlDanial/cloc\n "
},
{
"path": "Unix/README",
"chars": 918,
"preview": "README: cloc - statistics utility to count lines of code\n---------------------------------------------------------------"
},
{
"path": "Unix/cloc",
"chars": 707280,
"preview": "#!/usr/bin/env perl\n# cloc -- Count Lines of Code {{{1\n# Copyright (C) 2006-2026 Al Danial <al.danial@g"
},
{
"path": "Unix/cloc.1.pod",
"chars": 27397,
"preview": "# Copyright\n#\n# Copyright (C) 2018-2026 Al Danial <al.danial@gmail.com>.\n# Copyright (C) 2010-2017 Jari Aalt"
},
{
"path": "Unix/pod2man.mk",
"chars": 2008,
"preview": "# pod2man.mk -- Makefile portion to convert *.pod files to manual pages\n#\n# Copyright information\n#\n#\tCopyright (C) 20"
},
{
"path": "Unix/t/00_C.t",
"chars": 71549,
"preview": "#!/usr/bin/env perl\nuse warnings;\nuse strict;\nuse Test::More;\nuse Cwd;\nuse Getopt::Std;\nmy %opt;\ngetopts('u', \\%opt); #"
},
{
"path": "Unix/t/01_opts.t",
"chars": 44274,
"preview": "#!/usr/bin/env perl\nuse warnings;\nuse strict;\nuse Test::More;\nuse File::Copy \"cp\";\nuse Cwd;\nuse Getopt::Std;\nmy %opt;\nge"
},
{
"path": "Unix/t/02_git.t",
"chars": 6975,
"preview": "#!/usr/bin/env perl\nuse warnings;\nuse strict;\nuse Test::More;\nuse File::Copy \"cp\";\nuse Cwd;\nuse Getopt::Std;\nmy %opt;\nge"
},
{
"path": "Unix/why_this_directory_exists.txt",
"chars": 821,
"preview": "The contents of the cloc/Unix/ directory are intended for\ncloc package maintainers on distributions such as Ubuntu,\nDebi"
},
{
"path": "cloc",
"chars": 807715,
"preview": "#!/usr/bin/env perl\n# cloc -- Count Lines of Code {{{1\n# Copyright (C) 2006-2026 Al Danial <al.danial@g"
},
{
"path": "sqlite_formatter",
"chars": 1818,
"preview": "#!/usr/bin/env perl\nuse warnings;\nuse strict;\n#\n# Pretty printer for from sqlite3 output.\n# Assumes column headers are e"
},
{
"path": "tests/README",
"chars": 476,
"preview": "To run the tests:\n cd ../Unix\n make test\n\nUnless you see a clear error message, all tests have been executed\nsuccessfu"
},
{
"path": "tests/inputs/955.bpmn",
"chars": 840,
"preview": "<!DOCTYPE html>\n <!-- Activiti Business Process -->\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name"
},
{
"path": "tests/inputs/955.hbm.xml",
"chars": 824,
"preview": "<!DOCTYPE html>\n <!-- Hibernate -->\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" cont"
},
{
"path": "tests/inputs/955.jrxml",
"chars": 841,
"preview": "<!DOCTYPE html>\n <!-- Jasper Report XML/Template -->\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta nam"
},
{
"path": "tests/inputs/955.lb.xml",
"chars": 824,
"preview": "<!DOCTYPE html>\n <!-- Liquibase -->\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" cont"
},
{
"path": "tests/inputs/955.tld",
"chars": 841,
"preview": "<!DOCTYPE html>\n <!-- JSP Tag Library Definition -->\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta nam"
},
{
"path": "tests/inputs/AnsProlog.lp",
"chars": 1047,
"preview": "% ASP logic program for cloc tests.\n% Demonstrates the use of different types of comments in .lp files.\n%\n% There should"
},
{
"path": "tests/inputs/Application_Data_Test.feature.cs",
"chars": 1015,
"preview": "// ------------------------------------------------------------------------------\n// <auto-generated>\n// This code"
},
{
"path": "tests/inputs/Arturo.art",
"chars": 9981,
"preview": "; this is a comment\n; this is another comment\n\n;---------------------------------\n; VARIABLES & VALUES\n;----------------"
},
{
"path": "tests/inputs/Assembler-Intel.asm",
"chars": 207,
"preview": "; Hello World for Intel Assembler (MSDOS)\n; from http://www.roesler-ac.de/wolfram/hello.htm\n\nmov ax,cs\nmov ds,ax\nmov ah,"
},
{
"path": "tests/inputs/Assembly-sysv.S",
"chars": 7087,
"preview": "/*\n Python-3.5.2/Modules/_ctypes/libffi/src/m68k/sysv.S\n */\n/* ---------------------------------------------------------"
},
{
"path": "tests/inputs/BUILD",
"chars": 647,
"preview": "# https://github.com/bazelbuild/bazel/raw/master/examples/cpp/BUILD\n\npackage(default_visibility = [\"//visibility:public\""
},
{
"path": "tests/inputs/BasicPlane.Figures-Rectangle.ixx",
"chars": 482,
"preview": "/*\nhttps://docs.microsoft.com/en-us/cpp/cpp/tutorial-named-modules-cpp?view=msvc-170\n*/\nexport module BasicPlane.Figures"
},
{
"path": "tests/inputs/BoxWidget.ui",
"chars": 216,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<interface>\n\t<template class=\"AtbBoxWidget\" parent=\"GtkBox\">\n\t\t<property name=\"ma"
},
{
"path": "tests/inputs/Buchberger.cocoa5",
"chars": 1996,
"preview": "define Buchberger(F)\r\n -- Make all monic for (sometimes) nicer GB :)\r\n G := [monic(f) | f in F];\r\n r := len(G);\r\n B "
},
{
"path": "tests/inputs/C#.cs",
"chars": 261,
"preview": "// from http://www.roesler-ac.de/wolfram/hello.htm\r\n// Hello World in Microsoft C# (\"C-Sharp\").\r\n\r\nusing System;\r\n\r\nclas"
},
{
"path": "tests/inputs/C++-MFC.cc",
"chars": 553,
"preview": "// Hello World in C++ for Microsoft Foundation Classes\n// (Microsoft Visual C++).\n// from http://www.roesler-ac.de/wolfr"
},
{
"path": "tests/inputs/C++-uppercase.CPP",
"chars": 27,
"preview": "// Comment\n\nint main() {}\n\n"
},
{
"path": "tests/inputs/C-Ansi.c",
"chars": 196,
"preview": "/* Hello World in C, Ansi-style */\n/* from http://www.roesler-ac.de/wolfram/hello.htm */\n\n#include <stdio.h>\n#include <s"
},
{
"path": "tests/inputs/C.g4",
"chars": 19766,
"preview": "/* https://github.com/antlr/grammars-v4/raw/master/c/C.g4\n [The \"BSD licence\"]\n Copyright (c) 2013 Sam Harwell\n All righ"
},
{
"path": "tests/inputs/ChangeProperties.il",
"chars": 980,
"preview": ";; This is SKILL\n;; https://www.mics.ece.vt.edu/ICDesign/Tutorials/Cadence/layout_pg5.html\n\n/*\n This procedure will cha"
},
{
"path": "tests/inputs/Chapel.chpl",
"chars": 1891,
"preview": "// \"Production-grade\" hello world\n// From https://github.com/chapel-lang/chapel/blob/release/1.16/test/release/examples/"
},
{
"path": "tests/inputs/Cobol.cbl",
"chars": 293,
"preview": " * from http://www.roesler-ac.de/wolfram/hello.htm\n * Hello World in Cobol\n\n*****************************\nIDEN"
},
{
"path": "tests/inputs/CodeQL.ql",
"chars": 478,
"preview": "/**\n * @name Find unused variables\n * @description Finds local variables that are defined but never used.\n * @kind probl"
},
{
"path": "tests/inputs/ColdFusion.cfm",
"chars": 164,
"preview": "<!--- from http://www.roesler-ac.de/wolfram/hello.htm --->\r\n<!---Hello world in ColdFusion--->\r\n\r\n<cfset message = \"Hell"
},
{
"path": "tests/inputs/Combinators.idr",
"chars": 7595,
"preview": "-- https://github.com/ziman/lightyear/raw/master/Lightyear/Combinators.idr\n-- ------------------------------------------"
},
{
"path": "tests/inputs/Containerfile",
"chars": 1500,
"preview": "# this is a copy of tests/inputs/Dockerfile\n\nFROM centos:centos6\n\n# just a comment\n\nRUN yum clean all && \\\n yum -y in"
},
{
"path": "tests/inputs/Counter.razor",
"chars": 462,
"preview": "@*\n https://docs.microsoft.com/en-us/aspnet/core/tutorials/build-your-first-blazor-app?view=aspnetcore-3.1\n*@\n@page \""
},
{
"path": "tests/inputs/DIEnumerator-10.0.ll",
"chars": 489,
"preview": "; https://github.com/llvm/llvm-project/raw/master/llvm/test/Bitcode/DIEnumerator-10.0.ll\n;; DIEnumerator-10.0.ll.bc was "
},
{
"path": "tests/inputs/DocTest.thrift",
"chars": 6330,
"preview": "// https://github.com/apache/thrift/raw/master/test/DocTest.thrift\n/*\n * Licensed to the Apache Software Foundation (ASF"
},
{
"path": "tests/inputs/Dockerfile",
"chars": 1455,
"preview": "FROM centos:centos6\n\n# just a comment\n\nRUN yum clean all && \\\n yum -y install epel-release && \\\n yum -y install \\\n"
},
{
"path": "tests/inputs/ERC20.cairo",
"chars": 2822,
"preview": "// https://raw.githubusercontent.com/OpenZeppelin/cairo-contracts/main/src/openzeppelin/token/erc20/presets/ERC20.cairo\n"
},
{
"path": "tests/inputs/ExprParser.g",
"chars": 12754,
"preview": "// https://github.com/apache/drill/raw/master/logical/src/main/antlr3/org/apache/drill/common/expression/parser/ExprPars"
},
{
"path": "tests/inputs/FOCUS.focexec",
"chars": 98,
"preview": "-* from http://www.roesler-ac.de/wolfram/hello.htm\r\n-* Hello World in FOCUS\r\n\r\n-TYPE Hello world\r\n"
},
{
"path": "tests/inputs/Fortran77.f",
"chars": 142,
"preview": "C from http://www.roesler-ac.de/wolfram/hello.htm\nC Hello World in Fortran 77\n\n PROGRAM HELLO\n PRINT*, 'He"
},
{
"path": "tests/inputs/Fortran90.f90",
"chars": 162,
"preview": "! from http://www.roesler-ac.de/wolfram/hello.htm\r\n! Hello World in Fortran 90, 95, and 2003\r\n\r\nPROGRAM HelloWorld\r\n "
},
{
"path": "tests/inputs/FreemarkerTemplate.ftl",
"chars": 615,
"preview": "<html>\n<head>\n <title>Welcome!</title>\n</head>\n<body>\n <#-- Greet the user with his/her name -->\n <h1>Welcome ${user "
},
{
"path": "tests/inputs/GamePanel.tscn",
"chars": 1749,
"preview": "; https://github.com/zacryol/spindle-of-serendipity/raw/develop/godot/game/GamePanel.tscn\n[gd_scene load_steps=19 format"
},
{
"path": "tests/inputs/Gencat-NLS.msg",
"chars": 655,
"preview": "$ Base file borrowed from $FreeBSD$\n$ freebsd/usr.bin/grep/nls/C.msg\n$ \n\n$set 1\n$quote \"\n1 \"(standard input)\"\n2 \"cannot "
},
{
"path": "tests/inputs/Haskell.hs",
"chars": 140,
"preview": "-- from http://www.roesler-ac.de/wolfram/hello.htm\r\n-- Hello World in Haskell\r\n\r\nmodule Hello where\r\nhello::String\r\nhell"
},
{
"path": "tests/inputs/Hello.lidr",
"chars": 186,
"preview": "http://docs.idris-lang.org/en/latest/tutorial/miscellany.html\n> module literate\n\nThis is a comment. The main program is "
},
{
"path": "tests/inputs/HelpersView.axaml",
"chars": 6023,
"preview": "<!--\nhttps://github.com/kikipoulet/SukiUI/raw/b1d624b2472ebd9e442b4870e6e53b8852b86345/SukiUI.Demo/Features/Helpers/Hel"
},
{
"path": "tests/inputs/IDL.idl",
"chars": 123,
"preview": "; Hello World in IDL (Interactive Data Language)\r\n; from http://www.roesler-ac.de/wolfram/hello.htm\r\nprint, \"Hello World"
},
{
"path": "tests/inputs/ItemView.vue",
"chars": 1961,
"preview": "<!-- https://github.com/vuejs/vue-hackernews/raw/gh-pages/src/components/ItemView.vue -->\n<template>\n <div class=\"item-"
},
{
"path": "tests/inputs/Java.java",
"chars": 514,
"preview": "// from http://www.roesler-ac.de/wolfram/hello.htm\n// Hello World in Java\n\n// 2016-12-02: additional code by https://gi"
},
{
"path": "tests/inputs/JetCar.cls",
"chars": 1269,
"preview": "' https://github.com/badcodes/vb6.git NextPage/JetCar.cls\r\n\r\nVERSION 1.0 CLASS\r\nBEGIN\r\n MultiUse = -1 'True\r\n Persist"
},
{
"path": "tests/inputs/LaTeX.tex",
"chars": 7311,
"preview": "% ftp://tug.ctan.org/tex-archive/macros/latex/base/sample2e.tex\n% This is a sample LaTeX input file. (Version of 12 Aug"
},
{
"path": "tests/inputs/Lanczos.m",
"chars": 3072,
"preview": "function [phiKM, AscendingLambda] = Lanczos(K, M, sigma, Jmax)\n[rows,cols] = size(K); "
},
{
"path": "tests/inputs/LogMain.re",
"chars": 235,
"preview": "/* LogMain.re */\n/*\n * Example from http://2ality.com/2017/12/modules-reasonml.html\n */\n\nlet () = Log.make()\n |> Log.lo"
},
{
"path": "tests/inputs/Lookup.agda",
"chars": 1193,
"preview": "{- \nhttps://raw.githubusercontent.com/agda/agda/master/examples/Lookup.agda\n -}\nmodule Lookup where\n\ndata Bool : Set whe"
},
{
"path": "tests/inputs/MSDOS.bat",
"chars": 111,
"preview": "REM from http://www.roesler-ac.de/wolfram/hello.htm\n@ECHO OFF\nREM Hello World for DOS batch\n\nECHO Hello World!\n"
},
{
"path": "tests/inputs/Makefile",
"chars": 4378,
"preview": "############################################################################\n#\n# Program: ARPACK\n#\n# Module: "
},
{
"path": "tests/inputs/Mako.mako",
"chars": 406,
"preview": "## This is the test file for mako extenstion\n## As Mako can be used as a template to render almost any other\n## language"
},
{
"path": "tests/inputs/Mathematica_1.m",
"chars": 611,
"preview": "(* http://spot.colorado.edu/~sitelic/samplecode/mathematica/imagesfile.html\n *)\n\nimage = Import[\"denise.png\",\"PNG\"] (*"
},
{
"path": "tests/inputs/Mathematica_2.wlt",
"chars": 616,
"preview": "(* \n http://spot.colorado.edu/~sitelic/samplecode/mathematica/imagesfile.html\n *)\n\nimage = Import[\"denise.png\",\"PNG\"]"
},
{
"path": "tests/inputs/Mojo.mojom",
"chars": 738,
"preview": "// Mojo files usually start with a multiline comment and/or copyright\n// statement. They are otherwise quite close to C"
},
{
"path": "tests/inputs/Mumps.mps",
"chars": 97,
"preview": "; from http://www.roesler-ac.de/wolfram/hello.htm\r\n; Hello World in Mumps-M\r\n w !,\"Hello World\"\r\n"
},
{
"path": "tests/inputs/Octave.m",
"chars": 126,
"preview": "% from http://www.roesler-ac.de/wolfram/hello.htm\r\n#Hello World in Octave (http://www.octave.org/)\r\nprintf(\"Hello World\\"
},
{
"path": "tests/inputs/Once.HC",
"chars": 1234,
"preview": "/*\nhttps://raw.githubusercontent.com/cia-foundation/TempleOS/archive/Once.HC\n*/\n//Place this file in /Home and change\n//"
},
{
"path": "tests/inputs/Pascal.p",
"chars": 145,
"preview": "(* from http://www.roesler-ac.de/wolfram/hello.htm *)\n{Hello World in Pascal}\n\nprogram HelloWorld(output);\nbegin\n Write"
},
{
"path": "tests/inputs/Pascal.pas",
"chars": 145,
"preview": "(* from http://www.roesler-ac.de/wolfram/hello.htm *)\n{Hello World in Pascal}\n\nprogram HelloWorld(output);\nbegin\n Write"
},
{
"path": "tests/inputs/Pascal.pp",
"chars": 193,
"preview": "(* from http://www.roesler-ac.de/wolfram/hello.htm *)\n{Hello World in Pascal}\n{! compiler directive, not a comment}\n\npro"
},
{
"path": "tests/inputs/PlusCalExample.tla",
"chars": 1225,
"preview": "---- MODULE PlusCalExample ----\n(* TLA+/PlusCal example program. *)\n(* Multi-line\n (* nested *)\n comment *)\n\\* Singl"
},
{
"path": "tests/inputs/Prelude.dhall",
"chars": 1274,
"preview": "{- https://github.com/dhall-lang/dhall-nethack/raw/master/Prelude.dhall\n This file provides a central `Prelude` import"
},
{
"path": "tests/inputs/ProcessPO.odx",
"chars": 5067,
"preview": "#if __DESIGNER_DATA\n#error Do not define __DESIGNER_DATA.\n<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<om:M"
},
{
"path": "tests/inputs/RedBlackTree.res",
"chars": 6127,
"preview": "// a portion of https://github.com/github/linguist/raw/master/samples/ReScript/RedBlackTree.res\n\n/*\nCredit to Wikipedia'"
},
{
"path": "tests/inputs/RemoteSiteHelperTest.cls",
"chars": 1294,
"preview": "// https://github.com/financialforcedev/apex-mdapi.git\n// apex-mdapi/apex-mdapi/src/classes/RemoteSiteHelperTest.cl"
},
{
"path": "tests/inputs/RenderTest.metal",
"chars": 1583,
"preview": "//\n// RenderTest.metal\n// RenderTest\n//\n\n#include <metal_stdlib>\nusing namespace metal;\n#include \"RenderTest.h\"\n\n// Ve"
},
{
"path": "tests/inputs/Rounds.scad",
"chars": 1643,
"preview": "// https://raw.githubusercontent.com/UBaer21/UB.scad/main/examples/UBexamples/Rounds.scad\r\ninclude<ub.scad>//https://git"
},
{
"path": "tests/inputs/Sample.mc",
"chars": 1626,
"preview": "; /* http://msdn.microsoft.com/en-us/library/windows/desktop/dd996907%28v=vs.85%29.aspx \n; more comments\n; */\n\n; // ***"
},
{
"path": "tests/inputs/SimpleODE.mo",
"chars": 2348,
"preview": "/*\nbased on\nhttps://raw.githubusercontent.com/casella/ScalableTestSuite/master/ScalableTestSuite/Elementary/SimpleODE.mo"
},
{
"path": "tests/inputs/Slim.html.slim",
"chars": 368,
"preview": "<div class=\"widget-test-holder\"></div>\n<ul class=\"widget-test-items\">\n - @test.each do |test|\n <li>\n <a href=\"#"
},
{
"path": "tests/inputs/Slint-helloworld.slint",
"chars": 432,
"preview": "component MyButton inherits Text {\n color: black;\n // ...\n}\n\nexport component MyApp inherits Window {\n preferre"
},
{
"path": "tests/inputs/Snakefile",
"chars": 1270,
"preview": "\"\"\"\nA sample Snakefile for testing line counting\n\"\"\"\n\nSAMPLES = [\"A\", \"B\"]\n\n\n# This is a\n# multiline\n# comment\nrule all:"
},
{
"path": "tests/inputs/Splice.hs-boot",
"chars": 1738,
"preview": "-- https://gitlab.haskell.org/ghc/ghc.git\n-- ghc/compiler/GHC/Tc/Gen/Splice.hs-boot\n\n{-# LANGUAGE TypeFamilies #-}\n\nmodu"
},
{
"path": "tests/inputs/Sys.hx",
"chars": 5444,
"preview": "/*\n https://raw.githubusercontent.com/HaxeFoundation/haxe/development/std/Sys.hx\n * Copyright (C)2005-2016 Haxe Foundati"
},
{
"path": "tests/inputs/TLAExample.tla",
"chars": 222,
"preview": "---- MODULE TLAExample ----\n(* TLA+ example program. *)\n(* Multi-line\n (* nested *)\n comment *)\n\\* Single-line comme"
},
{
"path": "tests/inputs/TableGen-ARM.td",
"chars": 84741,
"preview": "//===-- ARM.td - Describe the ARM Target Machine -----------*- tablegen -*-===//\n//\n// Part of the LLVM Project, under t"
},
{
"path": "tests/inputs/Test.daml",
"chars": 1619,
"preview": "-- https://raw.githubusercontent.com/digital-asset/daml/refs/heads/main/sdk/test-common/src/main/daml/model/Test.daml\n--"
},
{
"path": "tests/inputs/Tk",
"chars": 134,
"preview": "#!/usr/local/bin/wish -f\n# from http://www.roesler-ac.de/wolfram/hello.htm\n# Hello World in Tk\n\nlabel .l -text \"Hello Wo"
},
{
"path": "tests/inputs/Trapezoid_Rule.ipynb",
"chars": 3404,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"# Basic Numerical Integration: the "
},
{
"path": "tests/inputs/TypeScript.ts",
"chars": 3500,
"preview": "//\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 ("
},
{
"path": "tests/inputs/TypeScript_2.ts",
"chars": 401,
"preview": "import { createServer } from 'http' // from @frankdugan3, an example of TypeScript code\n "
},
{
"path": "tests/inputs/USS.uss",
"chars": 248,
"preview": "/* https://github.com/AlDanial/cloc/pull/919 */\n/* name selector (like ID selector in CSS) */\n#root {\n /* \n some s"
},
{
"path": "tests/inputs/UXML.uxml",
"chars": 474,
"preview": "<!-- https://github.com/AlDanial/cloc/pull/919 -->\n<ui:UXML xmlns:ui=\"UnityEngine.UIElements\" xmlns:uie=\"UnityEditor.UIE"
},
{
"path": "tests/inputs/X++.xpo",
"chars": 1671,
"preview": "Exportfile for AOT version 1.0 or later\nFormatversion: 1\n\n***Element: CLS\n\n; Microsoft Dynamics Class: HelloWorld nicht "
},
{
"path": "tests/inputs/XML.xml",
"chars": 235,
"preview": "<!-- from http://www.roesler-ac.de/wolfram/hello.htm -->\r\n<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n<?xml-stylesheet "
},
{
"path": "tests/inputs/XSL-FO.xsl",
"chars": 680,
"preview": "<!-- from http://www.roesler-ac.de/wolfram/hello.htm -->\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<!-- Hello World in XS"
},
{
"path": "tests/inputs/XSLT.xslt",
"chars": 331,
"preview": "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n<!-- Hello World in XSLT -->\r\n<!-- from http://www.roesler-ac.de/wolfram/he"
},
{
"path": "tests/inputs/Xtend.xtend",
"chars": 4955,
"preview": "/* https://raw.githubusercontent.com/tsaglam/JavaCodeEcorification/master/src/main/java/jce/generators/EFactoryImplement"
},
{
"path": "tests/inputs/ZosMsg.mc",
"chars": 10640,
"preview": ";// ZosMsg.h - Messages\r\n;\r\n;#pragma once\r\n;\r\n\r\nMessageIdTypedef=DWORD\r\n\r\nSeverityNames=(Success=0x0:STATUS_SEVERITY_SUC"
},
{
"path": "tests/inputs/ZosNet.rc",
"chars": 10596,
"preview": "// Microsoft Visual C++ generated resource script.\r\n//\r\n#include \"Resource.h\"\r\n\r\n#define APSTUDIO_READONLY_SYMBOLS\r\n////"
},
{
"path": "tests/inputs/ZosNp.def",
"chars": 635,
"preview": "LIBRARY ZosNp\r\n; Bruce Engle\r\n\r\nEXPORTS\r\n NPGetConnection @12\r\n NPGetCaps @13\r\n N"
},
{
"path": "tests/inputs/aa/bb/cc/plasma.c",
"chars": 11216,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "tests/inputs/acpclust.R",
"chars": 8911,
"preview": "### Code by Eric Lecoutre, Universite catholique de Louvain, Belgium\n### Winner of the R Homepage graphics competition 2"
},
{
"path": "tests/inputs/apertium-dan.dan.rlx",
"chars": 3069,
"preview": "# based on\n# https://raw.githubusercontent.com/apertium/apertium-dan/master/apertium-dan.dan.rlx\n# -*- cg-pre-pipe: \"ape"
},
{
"path": "tests/inputs/args.janet",
"chars": 1455,
"preview": "# https://github.com/MorganPeterson/args/blob/main/args.janet\n\n# https://github.com/AlDanial/cloc/issues/802\n(defn- to-b"
},
{
"path": "tests/inputs/arvo.hoon",
"chars": 6579,
"preview": ":< first 120 lines of https://raw.githubusercontent.com/urbit/arvo/master/sys/arvo.hoon\n:::::: ::::::::::::::::::::::::"
},
{
"path": "tests/inputs/asciidoctor.adoc",
"chars": 3330,
"preview": "// https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/man/asciidoctor.adoc\n// Stripped down, added block c"
},
{
"path": "tests/inputs/assembly.cs",
"chars": 675,
"preview": "using System.Reflection;\n\n// General Information about an assembly is controlled through the following\n// set of attribu"
},
{
"path": "tests/inputs/basic.luau",
"chars": 171,
"preview": " -- https://github.com/luau-lang/luau/blob/master/fuzz/basic.lua\nlocal function test(t)\n\tfor k,v in pairs(t) do\n\t\tprint("
},
{
"path": "tests/inputs/basic.p4",
"chars": 4613,
"preview": "// https://raw.githubusercontent.com/p4lang/tutorials/master/exercises/basic/basic.p4\n/* -*- P4_16 -*- */\n#include <core"
},
{
"path": "tests/inputs/bbf-device.yang",
"chars": 2454,
"preview": "// fragment of\n// https://github.com/BroadbandForum/yang/raw/eaac2c3904365d3c7b17100c7d5120ed06a56b74/standard/common/bb"
},
{
"path": "tests/inputs/beluga.bel",
"chars": 319,
"preview": "%%% This aims at testing\n%%% cloc's configuration file\n%%% for beluga.\n\n% Refer to Beluga's reference guide for syntax\n%"
},
{
"path": "tests/inputs/birds.pro",
"chars": 2865,
"preview": "% https://raw.githubusercontent.com/Anniepoo/prolog-examples/master/birds.pl\n% renamed birds.pro to test pro disambiguat"
},
{
"path": "tests/inputs/blur.glsl",
"chars": 2082,
"preview": "// Adapted from:\n// http://callumhay.blogspot.com/2010/09/gaussian-blur-shader-glsl.html\n/* \n https://github.com/genek"
},
{
"path": "tests/inputs/body.gjs",
"chars": 2476,
"preview": "{{!\n https://github.com/miguelcobain/ember-yeti-table/raw/a6642a4f16b6786a0f72d1caaa3270d0cb194d05/ember-yeti-table/s"
},
{
"path": "tests/inputs/bubs_tak_ard.prc",
"chars": 2385,
"preview": "CREATE OR REPLACE TRIGGER bubs_tak_ard\r\n/* ***************************************************************************\r\n"
},
{
"path": "tests/inputs/build.bzl",
"chars": 464,
"preview": "\"\"\"This example creates a rule with a declared output.\"\"\"\n\ndef _impl(ctx):\n ctx.actions.write(\n # Access the defau"
},
{
"path": "tests/inputs/build.cake",
"chars": 1002,
"preview": "var target = Argument(\"target\", \"Test\");\r\nvar configuration = Argument(\"configuration\", \"Release\");\r\n\r\n/////////////////"
},
{
"path": "tests/inputs/cad.asy",
"chars": 1465,
"preview": "// https://asymptote.sourceforge.io/gallery/CAD1.asy\nimport CAD;\n\nsCAD cad=sCAD.Create();\n\n/* Freehand line\nthis is a co"
},
{
"path": "tests/inputs/cadence_test.cdc",
"chars": 1151,
"preview": "/* https://cadence-lang.org/docs/testing-framework\n*/\n// A `setup` function that always runs before the rest of the test"
},
{
"path": "tests/inputs/captcha.cs",
"chars": 771,
"preview": "\"http://smalltalk.gnu.org/blog/bonzinip/captcha-simplest-gst-external-module\"\nDLD addModule: 'GD'.\nFileStream fileIn: 'G"
},
{
"path": "tests/inputs/capture.ecr",
"chars": 416,
"preview": "<%# Embedded Crystal example %>\n<%#\nhttps://raw.githubusercontent.com/ysbaddaden/frost/master/test/views/capture.ecr\n\n%>"
},
{
"path": "tests/inputs/certificates.sls",
"chars": 2214,
"preview": "# https://github.com/saltstack-formulas/nginx-formula/tree/master/nginx\n{% from 'nginx/map.jinja' import nginx with cont"
},
{
"path": "tests/inputs/ch10-REPL-oriented-repl-interactions.cj",
"chars": 4364,
"preview": "; https://github.com/clojurebook/ClojureProgramming/blob/master/ch10-REPL-oriented-repl-interactions.clj\n; then renamed "
},
{
"path": "tests/inputs/chat.st",
"chars": 1850,
"preview": "\"SimpleChat -- a SimpleTCP handler for a chat server\"\n\"http://sblinn.jottit.com/gnu_smalltalk_simplechat_tcp_server\"\n\nNa"
},
{
"path": "tests/inputs/child_template.jinja2",
"chars": 382,
"preview": "{# https://jinja.palletsprojects.com/en/2.11.x/templates/#comments #}\nse.html\" %}\n{% block title %}Index{% endblock %}\n"
},
{
"path": "tests/inputs/child_template.njk",
"chars": 382,
"preview": "{# https://jinja.palletsprojects.com/en/2.11.x/templates/#comments #}\nse.html\" %}\n{% block title %}Index{% endblock %}\n"
},
{
"path": "tests/inputs/clarityfiles.clar",
"chars": 563,
"preview": ";; Test fixture for Clarity language\n;; This file covers various comment and code patterns\n\n(define-constant TEST_CONSTA"
},
{
"path": "tests/inputs/class.imba",
"chars": 2884,
"preview": "# https://github.com/imba/imba/raw/master/test/syntax/class.imba\nextern describe, test, ok, eq, it\n\nclass Organism\n\n\tvar"
},
{
"path": "tests/inputs/cli-args.nf",
"chars": 909,
"preview": "#!/usr/bin/env nextflow\n// https://github.com/nextflow-io/nextflow/raw/refs/heads/master/tests/cli-args.nf\n/*\n * Copyrig"
},
{
"path": "tests/inputs/cloc-dev.code-workspace",
"chars": 223,
"preview": "{\n // this is a comment\n\t\"folders\": [\n\t\t{\n\t\t\t\"path\": \".\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"tests\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"Unix\"\n\t\t}\n "
},
{
"path": "tests/inputs/cloc_counts.csv",
"chars": 2911,
"preview": "files,language,blank,comment,code,\"github.com/AlDanial/cloc v 1.89 T=0.15 s (1625.6 files/s, 119625.7 lines/s)\"\n2,ANTLR"
},
{
"path": "tests/inputs/clusterConf.ttcn",
"chars": 1147,
"preview": "// http://www.wiley.com/legacy/wileychi/ttcn-3/supp/clusterConf.ttcn\n\n/* -----------------------------------------------"
},
{
"path": "tests/inputs/comments.rhai",
"chars": 432,
"preview": "// https://github.com/rhaiscript/rhai/raw/refs/heads/main/scripts/comments.rhai\n\n// Note: nested /* */ comments, as bel"
},
{
"path": "tests/inputs/comments_in_str.svelte",
"chars": 129,
"preview": "<script lang=\"ts\">\n const x = \"/*\";\n const y = '/*';\n const z = `/*`;\n const re = /\\/*/;\n</script>\n\n<div>Hel"
},
{
"path": "tests/inputs/comp.ecpp",
"chars": 4919,
"preview": "<html>\n<head>\n <style type=\"text/css\">\n p.example { background-color: #fcc;\n font-family: monospace;\n "
},
{
"path": "tests/inputs/complex_union.derw",
"chars": 434,
"preview": "-- https://github.com/eeue56/derw/blob/main/examples/complex_union.derw\ntype Animal =\n Dog { name: string }\n | Cat"
},
{
"path": "tests/inputs/conditions.CBL",
"chars": 1079,
"preview": " $ SET SOURCEFORMAT\"FREE\"\r\nIDENTIFICATION DIVISION.\r\nPROGRAM-ID. Conditions.\r\nAUTHOR. Michael Coughlan.\r\n* An exa"
},
{
"path": "tests/inputs/config.junos",
"chars": 3681,
"preview": "## Last commit: 2017-02-16 10:48:24 PST by root\n# based on https://github.com/Juniper/Intro-to-Using-Ansible-with-Junos-"
},
{
"path": "tests/inputs/cpp-example.inc",
"chars": 417,
"preview": "#\n# Copyright OpenEmbedded Contributors\n#\n# SPDX-License-Identifier: MIT\n#\n\nLICENSE = \"MIT\"\nLIC_FILES_CHKSUM = \"file://$"
},
{
"path": "tests/inputs/cross-platform.just",
"chars": 869,
"preview": "# https://github.com/casey/just/blob/master/examples/cross-platform.just\n# use with https://github.com/casey/just\n#\n# Ex"
},
{
"path": "tests/inputs/csharp-designer.designer.cs",
"chars": 2475,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code w"
},
{
"path": "tests/inputs/cucumber.feature",
"chars": 1341,
"preview": "# https://raw.githubusercontent.com/diaspora/diaspora/master/features/mobile/activity_stream.feature\n@javascript @mobile"
},
{
"path": "tests/inputs/custom.triple.extension.js",
"chars": 5,
"preview": "js 4\n"
},
{
"path": "tests/inputs/darwin-configuration.nix",
"chars": 2090,
"preview": "# https://raw.githubusercontent.com/input-output-hk/iohk-ops/develop/nix-darwin/darwin-configuration.nix\n{ config, pkgs,"
},
{
"path": "tests/inputs/dd/bb/cc/MoreTeapotsRenderer.cpp",
"chars": 19744,
"preview": "/*\n * Copyright 2013 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\""
},
{
"path": "tests/inputs/dd/bb/config.c",
"chars": 2193,
"preview": "/* Generated automatically from /s/ndk-toolchain/src/python/Python-2.7.5/Modules/config.c.in by makesetup. */\n/* -*- C -"
},
{
"path": "tests/inputs/dd/bb/ee/TeapotRenderer.cpp",
"chars": 8932,
"preview": "/*\n * Copyright 2013 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\""
},
{
"path": "tests/inputs/demo.odin",
"chars": 3960,
"preview": "// portion of https://github.com/odin-lang/Odin/raw/master/examples/demo/demo.odin\npackage main\n\nimport \"core:fmt\"\nimpor"
},
{
"path": "tests/inputs/dev.exs",
"chars": 2372,
"preview": "/*\n https://github.com/qhwa/bonfire/blob/master/config/dev.exs\n*/\nuse Mix.Config\n\nconfig :bonfire, Bonfire.EventStore,\n "
},
{
"path": "tests/inputs/diff/A/d1/hello.f90",
"chars": 158,
"preview": "! Hello World\nprogram hello\n implicit none\n print '(\"Hello, World!\")'\n print '(\"line 2\")'\nend program hello\n!hpf$ not"
},
{
"path": "tests/inputs/diff/A/d2/hello.java",
"chars": 313,
"preview": "/* hello.java */\nimport java.io.*;\nclass Hi {\n static public void main( String args[] ) {\n System.out.println( \"anot"
},
{
"path": "tests/inputs/diff/A/d2/hi.py",
"chars": 233,
"preview": "#/usr/bin/env python\n\n# pound comment\n\nimport time\nprint('Hello. The time is %f Unix epoch.' % (time.time())) # inline"
},
{
"path": "tests/inputs/diff/A/hello.C",
"chars": 199,
"preview": "// hello.C\n#include <iostream>\nint main ()\n{\n std::cout << \"hello\" << std::endl; // comment 1\n std::cout << \"agai"
},
{
"path": "tests/inputs/diff/B/d1/hello.f90",
"chars": 157,
"preview": "! Hello World\nprogram hello\n implicit none\n print '(\"Hello, World!\")'\nend program hello\n!hpf$ not a comment\n!omp$ not "
},
{
"path": "tests/inputs/diff/B/d2/hi.py",
"chars": 233,
"preview": "#/usr/bin/env python\n\n# pound comment\n\nimport time\nprint('Hello. The time is %f Unix epoch.' % (time.time())) # inline"
},
{
"path": "tests/inputs/diff/B/extra_file.pl",
"chars": 33,
"preview": "#!/usr/bin/perl\nprint \"extra\\n\";\n"
},
{
"path": "tests/inputs/diff/B/hello.C",
"chars": 208,
"preview": "// hello.C -- stuff\n#include <iostream>\nint main ()\n{\n std::cout << \"hello\" << std::endl; // comment 1\n std::cout"
},
{
"path": "tests/inputs/dlist.lean",
"chars": 4314,
"preview": "-- https://github.com/leanprover/lean/raw/master/library/data/dlist.lean\n/-\nCopyright (c) 2017 Microsoft Corporation. Al"
},
{
"path": "tests/inputs/door.tres",
"chars": 1027,
"preview": "; https://github.com/godotengine/tps-demo/raw/master/door/model/door.tres\n[gd_resource type=\"SpatialMaterial\" load_steps"
},
{
"path": "tests/inputs/dotNET_intermediate.il",
"chars": 1420,
"preview": "// This is .NET Intermediate Language\n// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Found"
},
{
"path": "tests/inputs/double_doors.dsc",
"chars": 1077,
"preview": "doubledoors_world:\r\n type: world\r\n debug: false\r\n events:\r\n # Use monitor to allow the event to be cance"
},
{
"path": "tests/inputs/drools.drl",
"chars": 1795,
"preview": "// https://github.com/AlDanial/cloc/issues/172\n\n/*\n * Copyright 2010 Red Hat, Inc. and/or its affiliates.\n *\n * Licensed"
},
{
"path": "tests/inputs/drupal.mxml",
"chars": 2764,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<mx:Application xmlns:mx=\"http://www.adobe.com/2006/mxml\" layout=\"absolute\" creat"
},
{
"path": "tests/inputs/eddsa.circom",
"chars": 3721,
"preview": "// https://raw.githubusercontent.com/iden3/circomlib/master/circuits/eddsa.circom\n/*\n Copyright 2018 0KIMS associatio"
},
{
"path": "tests/inputs/elixir.ex",
"chars": 224,
"preview": "# This is a test for the Elixir SLOC counter.\n\ndefmodule Test do\n @moduledoc \"\"\"\n Test module\n \"\"\"\n @notdoc :foo\n\n "
},
{
"path": "tests/inputs/en_AU.po",
"chars": 1941,
"preview": "# portions of\n# https://raw.githubusercontent.com/xfce-mirror/xfce4-terminal/master/po/en_AU.po\n# SOME DESCRIPTIVE TITLE"
},
{
"path": "tests/inputs/example_2d.gdshader",
"chars": 456,
"preview": "// https://github.com/AlDanial/cloc/issues/641\nshader_type canvas_item;\n\nuniform float blue = 1.0; // you can assign a d"
},
{
"path": "tests/inputs/fib.dfy",
"chars": 598,
"preview": "/*\nhttps://dafny.org/latest/OnlineTutorial/guide\n*/\nfunction fib(n: nat): nat\n{\n if n == 0 then 0\n else if n == 1 then"
},
{
"path": "tests/inputs/fib_class.pkl",
"chars": 1040,
"preview": "/* \n\nhttps://raw.githubusercontent.com/apple/pkl/refs/heads/main/bench/src/jmh/resources/org/pkl/core/fib_class.pkl\n*/ \n"
},
{
"path": "tests/inputs/fibonacci.ncl",
"chars": 338,
"preview": "# https://raw.githubusercontent.com/tweag/nickel/master/examples/fibonacci/fibonacci.ncl\n# test = 'pass'\n\n# This is the "
},
{
"path": "tests/inputs/find.plm",
"chars": 716,
"preview": "/*\n https://en.wikipedia.org/wiki/PL/M\n*/\n FIND: PROCEDURE(PA,PB) BYTE;\n DECLARE (PA,PB) BYTE;\n /* FIND THE STRING"
},
{
"path": "tests/inputs/flatbuffers.fbs",
"chars": 65,
"preview": "\n/* Comment 1 */\ntable TestTable {\n\t// Comment 2\n Item: int32;\n}"
},
{
"path": "tests/inputs/fmt.ha",
"chars": 1152,
"preview": "// License: MPL-2.0\n// (c) 2022 Alexey Yerin <yyp@disroot.org>\n// (c) 2021 Andri Yngvason <andri@yngvason.is>\n// (c) 202"
},
{
"path": "tests/inputs/foo_bar/bar/foo/momo/tbfm.sh",
"chars": 11,
"preview": "echo hello\n"
},
{
"path": "tests/inputs/foo_bar/foo/bar/lala/tfbl.sh",
"chars": 8,
"preview": "echo hi\n"
},
{
"path": "tests/inputs/fortran.inc",
"chars": 629,
"preview": "C https://en.wikibooks.org/wiki/Fortran/Fortran_examples\n! sum.f90\n! Performs summations using in a loop using EXIT stat"
},
{
"path": "tests/inputs/fractal.um",
"chars": 883,
"preview": "/*\n https://github.com/vtereshkov/umka-lang/raw/master/examples/fractal/fractal.um\n*/\n// Fractal demo in Umka (adapted f"
}
]
// ... and 827 more files (download for full content)
About this extraction
This page contains the full source code of the AlDanial/cloc GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1027 files (3.1 MB), approximately 850.5k tokens, and a symbol index with 179 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.