i.e:
- webapi-plugins(SAM)$ tools/sam/run_sam.sh -a 55unified
+ webapi-plugins(SAM)$ tools/sam/run_sam.sh -a unified
Analysis Report will be located in output/html/ directory.
-Script assumes that `55unified` profile exists in ~/.gbs.conf file.
+Script assumes that `unified` profile exists in ~/.gbs.conf file.
# Links
[Getting Started](https://github.sec.samsung.net/RS7-Architectural-Refactoring/SAM-Tools/wiki/Getting-Started)
-[SAM Metric](https://github.sec.samsung.net/RS7-Architectural-Refactoring/SAM-Tools/wiki/Metrics-in-SAM)
\ No newline at end of file
+[SAM Metric](https://github.sec.samsung.net/RS7-Architectural-Refactoring/SAM-Tools/wiki/Metrics-in-SAM)
+
+# Troubleshooting
+
+In case of problems with processing files - too small Lines of Code number - use `tools/sam/run_sam_svace3.0.sh`.
+
+More details [here](https://github.sec.samsung.net/RS7-Architectural-Refactoring/SAM-Tools/issues/708).
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+
+WEBAPI_DIRECTORY="${PWD}"
+DIR_NAME="${PWD##*/}"
+
+BUILD_PROFILE="unified"
+
+PATH_TO_SAM_TOOLS="$WEBAPI_DIRECTORY/../SAM-Tools"
+
+if [ "$PWD" != "$(git rev-parse --show-toplevel)" ] ; then
+ echo "Script must be executed from root directory of git repository"
+ exit 0
+fi
+
+function generate {
+ if [ -z "$1" ] ; then
+ echo "No gbs profile provided, using $BUILD_PROFILE"
+ else
+ BUILD_PROFILE="$1"
+ fi
+
+ if [ ! -f "$PATH_TO_SAM_TOOLS/hub/code-analysis-hub/scap/plugins/scra/svace-3.0.0-x64-linux/bin/svace" ] ; then
+ echo "ERROR: SVACE binary not found in $PATH_TO_SAM_TOOLS/hub/code-analysis-hub/scap/plugins/scra/svace-3.0.0-x64-linux/bin/svace"
+ exit 0
+ fi
+ "$PATH_TO_SAM_TOOLS/hub/code-analysis-hub/bin/scap" init
+ "$PATH_TO_SAM_TOOLS/hub/code-analysis-hub/scap/plugins/scra/svace-3.0.0-x64-linux/bin/svace" init
+ "$PATH_TO_SAM_TOOLS/hub/code-analysis-hub/scap/plugins/scra/svace-3.0.0-x64-linux/bin/svace" scra-params SCRA_RUNLINK_DYNAMIC_LIBS on
+ "$PATH_TO_SAM_TOOLS/hub/code-analysis-hub/scap/plugins/scra/svace-3.0.0-x64-linux/bin/svace" scra-params SCRA_BUILD_IGNORE_MACRO_METRIC on
+
+ mkdir -p ".scap/workspace/scra/"
+ "$PATH_TO_SAM_TOOLS/hub/code-analysis-hub/scap/plugins/scra/svace-3.0.0-x64-linux/bin/svace" build gbs build -A armv7l --profile="$BUILD_PROFILE" --include-all
+
+ "$PATH_TO_SAM_TOOLS/hub/code-analysis-hub/scap/plugins/scra/svace-3.0.0-x64-linux/bin/svace" scra-analyze -T -o ".scap/workspace/scra/"
+
+ $WEBAPI_DIRECTORY/tools/sam/run_sam.sh -g "$BUILD_PROFILE"
+}
+
+function usage {
+echo "Usage:
+$0 GBS_PROFILE
+
+Be sure that you have SVACE 3.0 engine in your SAM-Tools directory.
+1. Download the latest version of SVACE3.0 engine from at http://code.sec.samsung.net/ahub/resources/scra/dev/to-sam/
+2. Extract it to <SAM-Tools path>/hub/code-analysis-hub/scap/plugins/scra/
+"
+}
+
+function main {
+ LOOP=false
+ while getopts "h" opt; do
+ LOOP=true
+ case "$opt" in
+ "h")
+ usage
+ ;;
+ esac
+ done
+ if [ "$LOOP" = false ] ; then
+ generate $@
+ fi
+}
+
+main "$@"