Showing 100 of 266 total issues
Avoid deeply nested control flow statements. Open
if ip not in failed_lookups_dict.keys():
failed_lookups_dict[ip] = 1
# This IP has already failed at least once, increment
- Create a ticketCreate a ticket
Function lookup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def lookup(self, nir=None, inc_raw=False, retry_count=3, response=None,
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if key == 'contacts':
for k, v in val.items():
if v:
- Create a ticketCreate a ticket
Function get_asn_whois
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_asn_whois(self, retry_count=3):
"""
The function for retrieving ASN information for an IP address from
Cymru via port 43/tcp (WHOIS).
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if rir == 'lacnic':
lacnic_total_left -= 1
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if rir == 'lacnic':
rate_tracker[rir]['count'] += 1
# Get the next proxy opener to use, or None
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if isinstance(val, str):
val = val.splitlines()
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for k, v in val.items():
if k in ['phone', 'address', 'email']:
output += generate_output(
- Create a ticketCreate a ticket
Function parse_fields
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_fields(self, response, fields_dict, net_start=None,
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if ip not in rated_lookups:
rated_lookups.append(ip)
stats[rir]['rate_limited'].append(ip)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for contact in val:
if contact in global_contacts.keys():
temp_net['contacts'][key] = (
- Create a ticketCreate a ticket
Function lookup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def lookup(self, asn=None, inc_raw=False, retry_count=3, response=None,
- Create a ticketCreate a ticket
Function parse_fields
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_fields(self, response, fields_dict, net_start=None,
- Create a ticketCreate a ticket
Function get_contact
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_contact(self, response=None, nir=None, handle=None,
- Create a ticketCreate a ticket
Function get_whois
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_whois(self, asn_registry='arin', retry_count=3, server=None,
- Create a ticketCreate a ticket
Function lookup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def lookup(self, inc_raw=False, retry_count=3, extra_org_map=None,
- Create a ticketCreate a ticket
Function get_asn_origin_whois
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_asn_origin_whois(self, asn_registry='radb', asn=None,
- Create a ticketCreate a ticket
Function get_http_raw
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_http_raw(self, url=None, retry_count=3, headers=None,
- Create a ticketCreate a ticket
Function lookup_rdap
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def lookup_rdap(self, inc_raw=False, retry_count=3, depth=0,
excluded_entities=None, bootstrap=False,
rate_limit_timeout=120, extra_org_map=None,
inc_nir=True, nir_field_list=None, asn_methods=None,
get_asn_description=True, root_ent_check=True):
- Read upRead up
- Create a ticketCreate a ticket
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 get_nets_krnic
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_nets_krnic(self, response):
"""
The function for parsing network blocks from krnic whois data.
Args:
- Read upRead up
- Create a ticketCreate a ticket
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"