forked from sveinbjornt/Platypus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrc_loc_stats.sh
executable file
·50 lines (41 loc) · 2.47 KB
/
src_loc_stats.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#
# Print total lines of code for project
#
echo "Lines of code in Platypus codebase"
echo "LOC Total:"
find . -name \*.\[m\|h\] -exec cat {} \; | wc -l
echo "LOC Total implementation files"
find . -name \*.\[m\] -exec cat {} \; | wc -l
echo "LOC Total header files"
find . -name \*.\[h\] -exec cat {} \; | wc -l
echo "LOC Platypus App"
APP_TOTAL=`find Application -name \*.\[m\|h\] -exec cat {} \; | wc -l`
APP_HEAD=`find Application -name \*.\[h\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
APP_IMPL=`find Application -name \*.\[m\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
echo "${APP_TOTAL} (${APP_HEAD}/${APP_IMPL})"
echo "LOC ScriptExec"
SCRIPTEXEC_TOTAL=`find ScriptExec -name \*.\[m\|h\] -exec cat {} \; | wc -l`
SCRIPTEXEC_HEAD=`find ScriptExec -name \*.\[h\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
SCRIPTEXEC_IMPL=`find ScriptExec -name \*.\[m\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
echo "${SCRIPTEXEC_TOTAL} (${SCRIPTEXEC_HEAD}/${SCRIPTEXEC_IMPL})"
echo "LOC Command Line Tool"
CMDLINETOOL_TOTAL=`find CommandLineTool -name \*.\[m\|h\] -exec cat {} \; | wc -l`
CMDLINETOOL_HEAD=`find CommandLineTool -name \*.\[h\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
CMDLINETOOL_IMPL=`find CommandLineTool -name \*.\[m\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
echo "${CMDLINETOOL_TOTAL} (${CMDLINETOOL_HEAD}/${CMDLINETOOL_IMPL})"
echo "LOC Shared"
SHARED_TOTAL=`find Shared -name \*.\[m\|h\] -exec cat {} \; | wc -l`
SHARED_HEAD=`find Shared -name \*.\[h\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
SHARED_IMPL=`find Shared -name \*.\[m\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
echo "${SHARED_TOTAL} (${SHARED_HEAD}/${SHARED_IMPL})"
echo "LOC Shared (Platypus)"
SHARED_US_TOTAL=`find Shared -not -path "Shared/Others*" -name \*.\[m\|h\] -exec cat {} \; | wc -l`
SHARED_US_HEAD=`find Shared -not -path "Shared/Others*" -name \*.\[h\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
SHARED_US_IMPL=`find Shared -not -path "Shared/Others*" -name \*.\[m\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
echo "${SHARED_US_TOTAL} (${SHARED_US_HEAD}/${SHARED_US_IMPL})"
echo "LOC Shared (Others)"
SHAREDOTHERS_TOTAL=`find Shared/Others -name \*.\[m\|h\] -exec cat {} \; | wc -l`
SHAREDOTHERS_HEAD=`find Shared/Others -name \*.\[h\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
SHAREDOTHERS_IMPL=`find Shared/Others -name \*.\[m\] -exec cat {} \; | wc -l | sed -e 's/^[ \t]*//'`
echo "${SHAREDOTHERS_TOTAL} (${SHAREDOTHERS_HEAD}/${SHAREDOTHERS_IMPL})"