You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functions that takes array arguments like void foo(int a[3]) are not recognized as functions by ravioli.
Adding '[', ']' characters to function_matcher regex fixes the problem.
diff --git a/ravioli/complexity.py b/ravioli/complexity.py
index 87d79b8..20631c8 100644
--- a/ravioli/complexity.py+++ b/ravioli/complexity.py@@ -10,7 +10,7 @@ def calculate_complexity(code):
original_code = code
code = strip_comments(code)
results = []
- function_matcher = re.compile(r'\s+(\w+)\s*\([\w\s,\*]*\)\s*{', re.MULTILINE)+ function_matcher = re.compile(r'\s+(\w+)\s*\([\w\s,\[\]\*]*\)\s*{', re.MULTILINE)
for m in function_matcher.finditer(code):
name = m.group(1)
The text was updated successfully, but these errors were encountered:
Functions that takes array arguments like
void foo(int a[3])
are not recognized as functions by ravioli.Adding '[', ']' characters to function_matcher regex fixes the problem.
The text was updated successfully, but these errors were encountered: