update toploc to show only top 50 results

This commit is contained in:
MorganGeek 2020-07-09 07:42:09 +02:00
parent c3a54e77b3
commit 1bbe0e985a

View File

@ -164,12 +164,14 @@ cmd_loc="find . -type f \( \
-o -name '*.c' -o -name '*.h' \ -o -name '*.c' -o -name '*.h' \
-o -name '*.js' \ -o -name '*.js' \
-o -name '*.tsx' \ -o -name '*.tsx' \
-o -name '*.sh' \
-o -name '*.md' \ -o -name '*.md' \
-o -name '*.xml' \ -o -name '*.xml' \
-o -name '*.yaml' -o -name '*.yml' \
-o -name '*.groovy' \ -o -name '*.groovy' \
-o -name '*.gradle' \ -o -name '*.gradle' \
-o -name '*.properties' \ -o -name '*.properties' \
\) -exec \cat \{\} \; | LANG=C LC_CTYPE=C sed -e 's/^[ \t]*//;s/[ \t]*$//'" \) -exec \cat \{\} \; | LANG=C LC_CTYPE=C sed -e 's/^[ \t]*//;s/[ \t]*$//'"
# Unique lines of code # Unique lines of code
# Via https://text.causal.agency/004-uloc.txt # Via https://text.causal.agency/004-uloc.txt
@ -179,7 +181,7 @@ function uloc {
# Top lines of code # Top lines of code
function toploc { function toploc {
eval "$cmd_loc | LANG=C LC_CTYPE=C cut -c 1-100 | LANG=C LC_CTYPE=C sort | uniq -c | LANG=C LC_CTYPE=C sort -nr" eval "$cmd_loc | LANG=C LC_CTYPE=C cut -c 1-100 | LANG=C LC_CTYPE=C sort | uniq -c | LANG=C LC_CTYPE=C sort -nr | head -50"
} }
# Find files bigger than X size and sort them by size # Find files bigger than X size and sort them by size