Description
Hello,
nice tool, works well with AIX 7.2.1.4 and bash 4.3.30.
The shellmetrics 0.5.0 tool pass all your tests, after I changed all "run script" statements to "run" (I use shellspec 0.20.2).
Unfortunately my favorit shell, the "ksh", is not supported today. On the other hand shellspec and shellmetrics does not support "csh" or "tcsh" also.
I do some tests based of my scripts, the calculated value seems to be correct. But sometimes your syntax analysis will not fit.
#!/bin/bash
function func1 { echo '1'; }
case "$1" in
1) func1 ;& << should handled like ;;
2) func1 ;;
3|5) echo '3' ;; << only one path is counted, but this are two
4) echo '4' ;;
*) : ;;
esac
exit 0
On the other hand, the number of pathes are not counted well for some "if" statements also.
#!/bin/bash
function func1 { echo '1'; }
if [ "$1" -lt 0 -a "$2" -gt 10 ]; then << only one path is counted, but this are two
func1
fi
exit 0
In a short form, nice tool.
The most other tools I know are not able to handle concatenated "if" or "case" terms and the old McCabe samples does not count the number of all pathes also, in these circumstances.
But you should add ";&" to your list of closeing statements, like the ";;", this is available in the bash also (but used only in "ksh" mostly).
A nice tool to give me some useful information to prepare new tests.
With regards,
Lutz