|
|
|
@ -91,18 +91,19 @@ class ComplexFunction(AbstractDetector): |
|
|
|
|
func, cause = issue.values() |
|
|
|
|
func_name = func.name |
|
|
|
|
|
|
|
|
|
txt = "Complex function in {} Contract: {}, Function: {}" |
|
|
|
|
txt = "Complex function in {}\n\t- {}.{} ({})\n" |
|
|
|
|
|
|
|
|
|
if cause == self.CAUSE_EXTERNAL_CALL: |
|
|
|
|
txt += ", Reason: High number of external calls" |
|
|
|
|
txt += "\t- Reason: High number of external calls" |
|
|
|
|
if cause == self.CAUSE_CYCLOMATIC: |
|
|
|
|
txt += ", Reason: High number of branches" |
|
|
|
|
txt += "\t- Reason: High number of branches" |
|
|
|
|
if cause == self.CAUSE_STATE_VARS: |
|
|
|
|
txt += ", Reason: High number of modified state variables" |
|
|
|
|
txt += "\t- Reason: High number of modified state variables" |
|
|
|
|
|
|
|
|
|
info = txt.format(self.filename, |
|
|
|
|
contract.name, |
|
|
|
|
func_name) |
|
|
|
|
func_name, |
|
|
|
|
func.source_mapping_str) |
|
|
|
|
self.log(info) |
|
|
|
|
|
|
|
|
|
results.append({'vuln': 'ComplexFunc', |
|
|
|
|