<NME> analyze_code.sh
<BEF> ADDFILE
<MSG> Merge pull request #28 from BjornArnelid/master

Created Shell script to generate static code analyzis for Python (related to issue #7)
<DFF> @@ -0,0 +1,38 @@
+#!/bin/sh
+# Automated static code analysis for Python and JavaScript
+# Python tools pylint, pep8, pyflakes
+NOW=$(date +%Y%m%d_%H%M%S)
+
+echo "Creating folder $NOW"
+mkdir -p results/$NOW
+cd results/$NOW
+
+echo "Analyzing python code"
+if hash pyflakes 2>/dev/null; then
+	echo "Running pyflakes"
+	pyflakes ../.. > pyflakes.txt
+else
+	echo "Could not find pyflakes"
+fi
+
+if hash pylint 2>/dev/null; then
+	echo "Running pylint"
+	pylint ../../*/*.py --output-format=parseable > pylint.txt
+else
+	echo "Could not find pylint"
+fi
+
+if hash pep8 2>/dev/null; then
+	echo "Running pep8"
+	pep8 ../../*/*.py > pep8.txt
+else
+	echo "Could not find pep8"
+fi
+if hash pymetrics 2>/dev/null; then
+	echo "Running pymetrics"
+	pymetrics ../../*/*.py > pymetrics.txt
+else
+	echo "Could not find pymetrics"
+fi
+# TBD Analyze JavaScript Code
+

{'commit': 'diff --git a/analyze_code.sh b/analyze_code.sh\nnew file mode 100755\nindex 00000000..1ae74a63\n--- /dev/null\n+++ b/analyze_code.sh\n@@ -0,0 +1,38 @@\n+#!/bin/sh\n+# Automated static code analysis for Python and JavaScript\n+# Python tools pylint, pep8, pyflakes\n+NOW=$(date +%Y%m%d_%H%M%S)\n+\n+echo "Creating folder $NOW"\n+mkdir -p results/$NOW\n+cd results/$NOW\n+\n+echo "Analyzing python code"\n+if hash pyflakes 2>/dev/null; then\n+\techo "Running pyflakes"\n+\tpyflakes ../.. > pyflakes.txt\n+else\n+\techo "Could not find pyflakes"\n+fi\n+\n+if hash pylint 2>/dev/null; then\n+\techo "Running pylint"\n+\tpylint ../../*/*.py --output-format=parseable > pylint.txt\n+else\n+\techo "Could not find pylint"\n+fi\n+\n+if hash pep8 2>/dev/null; then\n+\techo "Running pep8"\n+\tpep8 ../../*/*.py > pep8.txt\n+else\n+\techo "Could not find pep8"\n+fi\n+if hash pymetrics 2>/dev/null; then\n+\techo "Running pymetrics"\n+\tpymetrics ../../*/*.py > pymetrics.txt\n+else\n+\techo "Could not find pymetrics"\n+fi\n+# TBD Analyze JavaScript Code\n+\n', 'commit_subject': 'Merge pull request #28 from BjornArnelid/master', 'repo_name': 'mozilla/MozDef', 'committer': {'name': 'jeffbryner', 'email': 'f3e731dfa293c7a83119d8aacfa41b5d2d780be9@jeffbryner.com', 'time_sec': '1396639242', 'tz_offset': '-420', 'date': {'seconds': '1396639242'}}, 'commit_tree': 'bf5dae37e231ad235c8d9556ade50d8850dbc154', 'commit_message': 'Merge pull request #28 from BjornArnelid/master\n\nCreated Shell script to generate static code analyzis for Python (related to issue #7)', 'language_name': 'Python', 'license': 'mpl-2.0', 'hunks': '@@ -0,0 +1,38 @@\n+#!/bin/sh\n+# Automated static code analysis for Python and JavaScript\n+# Python tools pylint, pep8, pyflakes\n+NOW=$(date +%Y%m%d_%H%M%S)\n+\n+echo "Creating folder $NOW"\n+mkdir -p results/$NOW\n+cd results/$NOW\n+\n+echo "Analyzing python code"\n+if hash pyflakes 2>/dev/null; then\n+\techo "Running pyflakes"\n+\tpyflakes ../.. > pyflakes.txt\n+else\n+\techo "Could not find pyflakes"\n+fi\n+\n+if hash pylint 2>/dev/null; then\n+\techo "Running pylint"\n+\tpylint ../../*/*.py --output-format=parseable > pylint.txt\n+else\n+\techo "Could not find pylint"\n+fi\n+\n+if hash pep8 2>/dev/null; then\n+\techo "Running pep8"\n+\tpep8 ../../*/*.py > pep8.txt\n+else\n+\techo "Could not find pep8"\n+fi\n+if hash pymetrics 2>/dev/null; then\n+\techo "Running pymetrics"\n+\tpymetrics ../../*/*.py > pymetrics.txt\n+else\n+\techo "Could not find pymetrics"\n+fi\n+# TBD Analyze JavaScript Code\n+\n', 'addition_count': 38, 'deletion_count': 0, 'src_file': '/dev/null', 'tgt_file': 'b/analyze_code.sh', 'file_extension': '.sh', 'before_file': 'ADDFILE', 'message': 'Merge pull request #28 from BjornArnelid/master\n\nCreated Shell script to generate static code analyzis for Python (related to issue #7)', 'author_name': 'jeffbryner', 'lang': 'sh'}