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 '*.js' \
-o -name '*.tsx' \
-o -name '*.sh' \
-o -name '*.md' \
-o -name '*.xml' \
-o -name '*.yaml' -o -name '*.yml' \
-o -name '*.groovy' \
-o -name '*.gradle' \
-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
# Via https://text.causal.agency/004-uloc.txt
@ -179,7 +181,7 @@ function uloc {
# Top lines of code
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