Function generate_inputs
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def generate_inputs():
inputs = []
for directory, _, filenames in walk(resolveRelativePath('../contracts')):
if 'libraries' in directory: continue
if 'legacy_reputation' in directory: continue
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function analyze_results
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def analyze_results(results):
for contractPath, contracts in results.items():
for contract, data in contracts.items():
for vuln, vuln_data in data['vulnerabilities'].items():
if len(vuln_data) > 0:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function main
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-a", "--analyze", help="Do some sort of programatic analysis. Right now nothing interesting. Later!", action="store_true")
parser.add_argument("-p", "--prettyprint", help="Pretty print results of the run like the oyente tool typically does", action="store_true")
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"