Showing 12 of 395 total issues
Function vulners_query
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
def vulners_query(self):
try:
os = "None"
os_v = "None"
descr = "None"
- 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 write_iocs
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def write_iocs(self):
today = datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d')
logging.info("Processing indicators ...")
- 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 print_conversation_header
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def print_conversation_header(pkt):
try:
start = time.time()
protocol = pkt.transport_layer
- 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 database_write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def database_write(today, timestamp, protocol, src_addr, src_port, dst_addr, dst_port, qry_name):
Function csv_file_write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def csv_file_write(today, timestamp, protocol, src_addr, src_port, dst_addr, dst_port, qry_name):
Avoid deeply nested control flow statements. Open
if self.host_info.json()[hit]["ssh"]["v2"]["metadata"].get('version'):
version = self.host_info.json()[hit]["ssh"]["v2"]["metadata"]["version"]
if self.host_info.json()[hit].get('http'):
Avoid deeply nested control flow statements. Open
if product == "httpd":
product = "Apache"
if self.host_info.json()[hit]["http"]["get"]["metadata"].get('version'):
Avoid deeply nested control flow statements. Open
for i in vulns:
vulns2 = iter(vulns)
for v in vulns2:
vdesc = v[0]["description"]
title = v[0]["title"]
Avoid deeply nested control flow statements. Open
if self.host_info.json()[hit]["http"]["get"]["metadata"].get('version'):
version = self.host_info.json()[hit]["http"]["get"]["metadata"]["version"]
if self.host_info.json()[hit].get('https'):
Avoid deeply nested control flow statements. Open
if self.host_info.json()[hit]["ftp"]["banner"]["metadata"].get('version'):
version = self.host_info.json()[hit]["ftp"]["banner"]["metadata"]["version"]
if self.host_info.json()[hit].get('smb'):
Function database_write
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def database_write(stats, mem, disk, timestamp, today):
Function write_iocs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write_iocs(self):
logging.info("Processing indicators ...")
with open(self.gs, newline='') as csvfile:
spamreader = csv.reader(csvfile, delimiter=',', quotechar='|')
- 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"