diff --git a/slither/core/declarations/function_contract.py b/slither/core/declarations/function_contract.py index 72632690c..01077353b 100644 --- a/slither/core/declarations/function_contract.py +++ b/slither/core/declarations/function_contract.py @@ -90,7 +90,7 @@ class FunctionContract(Function, ChildContract, ChildInheritance): [str(x) for x in self.state_variables_written], [str(x) for x in self.internal_calls], [str(x) for x in self.external_calls_as_expressions], - compute_cyclomatic_complexity(self) + compute_cyclomatic_complexity(self), ) # endregion diff --git a/slither/printers/summary/function.py b/slither/printers/summary/function.py index 8d58170ab..7f1633865 100644 --- a/slither/printers/summary/function.py +++ b/slither/printers/summary/function.py @@ -48,7 +48,7 @@ class FunctionSummary(AbstractPrinter): "Write", "Internal Calls", "External Calls", - "Cyclomatic Complexity" + "Cyclomatic Complexity", ] ) for ( @@ -60,7 +60,7 @@ class FunctionSummary(AbstractPrinter): write, internal_calls, external_calls, - cyclomatic_complexity + cyclomatic_complexity, ) in func_summaries: read = self._convert(sorted(read)) write = self._convert(sorted(write)) @@ -75,7 +75,7 @@ class FunctionSummary(AbstractPrinter): write, internal_calls, external_calls, - cyclomatic_complexity + cyclomatic_complexity, ] ) txt += "\n \n" + str(table) @@ -87,6 +87,7 @@ class FunctionSummary(AbstractPrinter): "Write", "Internal Calls", "External Calls", + "Cyclomatic Complexity", ] ) for ( @@ -98,12 +99,23 @@ class FunctionSummary(AbstractPrinter): write, internal_calls, external_calls, + cyclomatic_complexity, ) in modif_summaries: read = self._convert(sorted(read)) write = self._convert(sorted(write)) internal_calls = self._convert(sorted(internal_calls)) external_calls = self._convert(sorted(external_calls)) - table.add_row([f_name, visi, read, write, internal_calls, external_calls]) + table.add_row( + [ + f_name, + visi, + read, + write, + internal_calls, + external_calls, + cyclomatic_complexity, + ] + ) txt += "\n\n" + str(table) txt += "\n" self.info(txt)