Showing 267 of 577 total issues
Function explain
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def explain(scan_id: int, scan_type: str, explanation: str, explained_by: str, days: int = 365) -> Dict[str, Any]:
Function ticker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def ticker(
Function organization_report_by_name
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def organization_report_by_name(
Function improvements
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def improvements(
Function organization_report_by_id
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def organization_report_by_id(
Function inquire_organization
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def inquire_organization():
"""
Get one or more organizations to add urls to.
:return:
"""
- 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 askreset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def askreset():
# The dev dataset should not mean anything.
if settings.DEBUG:
and_its_gone()
- 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 check_valid_urls
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_valid_urls(urls):
valid = []
for url in urls:
url = url.lower()
- 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 get_or_create_module_models
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_or_create_module_models(self, user):
module_models = []
i = 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 compose
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def compose(self, *args, **options):
scanners = [
dnssec,
ftp,
http,
- 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 qualys_scan_bulk
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def qualys_scan_bulk(proxy: Dict[str, Any], urls: List[str]):
log.debug("Initiating bulk scan")
log.debug("Received proxy: %s" % proxy)
log.debug("Received urls: %s" % urls)
- 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 filter_websites
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def filter_websites(sites):
incomplete = []
not_resolvable = []
valid = []
- 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 get_impact
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_impact(severity):
if severity["is_explained"]:
return "good"
return "high" if severity["high"] else "medium" if severity["medium"] else "low" if severity["low"] else "good"
- 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 store
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def store(result: dict, endpoint_id: int):
"""
:param result: param endpoint:
:param endpoint:
- 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 list_outdated
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def list_outdated(published_scan_types):
for map_configuration in filter_map_configs():
print(f"Outdated items for {map_configuration['country']}/{map_configuration['organization_type__name']}:")
organizations_on_map = Organization.objects.all().filter(
country=map_configuration["country"], type=map_configuration["organization_type"]
- 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 get_cert_chain
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_cert_chain(url, port, ip_version) -> List[OpenSSL.crypto.X509]:
# https://stackoverflow.com/questions/19145097/getting-certificate-chain-with-python-3-3-ssl-module
# Relatively new Dutch governmental sites relying on anything less < TLS 1.2 is insane.
log.debug(f"Retrieving certificate chain from {url}:{port}.")
try:
- 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 store
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def store(results, endpoint_id):
resolves, can_connect_result, redirects_to_safety_result = results
if not resolves:
- 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 valid_api_settings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def valid_api_settings(scan: InternetNLV2Scan):
if not config.INTERNET_NL_API_USERNAME:
update_state(
scan.pk,
"configuration_error",
- 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 redirects_to_safety
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def redirects_to_safety(url: str):
"""
Also includes the ip-version of the endpoint. Implies that the endpoint resolves.
Any safety over any network is accepted now, both A and AAAA records.
- 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 scan_tasks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def scan_tasks(url_chunk):
tasks = []
for scanner in DEFAULT_SCANNERS:
# Tls qualys scans are inserted per 25. This is due to behaviour of the qualys service.
- 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"