File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ PYLINT="$(command -v pylint 2>/dev/null || true)"
1717RADON=" $( command -v radon 2> /dev/null || true) "
1818PYLINT_ARGS=" --output-format=parseable"
1919RADON_ARGS=' cc --min C --no-assert --show-closures --show-complexity --average'
20+ RADON_AWK_MAP=' m["A"]=1; m["B"]=1; m["C"]=2; m["D"]=3; m["E"]=5; m["F"]=8;'
2021
2122trap " status=\$ ?; cd '$GIT_REPO '; rm -rf '$TMP_REPO '; exit \$ status" EXIT
2223mkdir -p " $CACHE_DIR "
@@ -139,7 +140,7 @@ Cyclomatic_complexity ()
139140 echo " $CHANGED_FILES " |
140141 xargs " $RADON " $RADON_ARGS |
141142 tee " $cached "
142- } | awk -F'[ ()] ' ' / .+\( [0-9]+ \) $ / { tot += $2 } END { print tot }' || true
143+ } | awk " BEGIN{ $RADON_AWK_MAP } " ' / .+- [A-F] \( / { tot += m[$5] } END { print tot }' || true
143144}
144145
145146Get_diffable ()
You can’t perform that action at this time.
0 commit comments