From cd4ca317e728e81e5fa7e9912bc319c6a77dab39 Mon Sep 17 00:00:00 2001 From: Sam Sendelbach Date: Wed, 20 Dec 2017 14:20:29 -0600 Subject: [PATCH] Full golang supportf (tested) --- gitinspector/metrics.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gitinspector/metrics.py b/gitinspector/metrics.py index aab03a6..7150616 100644 --- a/gitinspector/metrics.py +++ b/gitinspector/metrics.py @@ -34,9 +34,8 @@ __metric_cc_tokens__ = [[["java", "js", "c", "cc", "cpp"], ["else", r"for\s+\(.* ["assert", "break", "continue", "return"]], [["py"], [r"^\s+elif .*:$", r"^\s+else:$", r"^\s+for .*:", r"^\s+if .*:$", r"^\s+while .*:$"], [r"^\s+assert", "break", "continue", "return"]], - [["go"], ["else", r"for\s+.*\{", r"if\s+.*\{", r"case\s+\w+:", "default:", r"goto\s+\w"], - ["break", "continue", "return"]]] - # check ast.CommClause and range statements + [["go"], ["else", "range" "defer", r"for\s+.*\{", r"if\s+.*\{", r"case\s+\w+:", "default:", r"goto\s+\w"], + ["break", "continue", "return", "quit"]]] METRIC_CYCLOMATIC_COMPLEXITY_THRESHOLD = 50 METRIC_CYCLOMATIC_COMPLEXITY_DENSITY_THRESHOLD = 0.75