count lines of code for entire project
Show older comments
Hi All,
I am looking into counting source code of lines for entire project. Is there a way to do it? I looked into sloc() somebdy posted but it counts only one file at a time. I want to count for the entire project so soemthign can go into the foler and look for each and every .m file
Accepted Answer
More Answers (2)
Demetrio Rodriguez Tereshkin
on 14 Apr 2016
1 vote
This is what you are looking for: https://github.com/AlDanial/cloc
Preetham Manjunatha
on 25 Nov 2025
Edited: Preetham Manjunatha
on 25 Nov 2025
0 votes
Here is a lightweight MATLAB utility that recursively counts code, comment, and blank lines across files or directories and writes a per-file summary and grand totals to lineCount.txt: Count Lines.
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!