Showing 577 of 577 total issues
Function merge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def merge(
Function dissolve
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def dissolve(
Function save_endpoint
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def save_endpoint(protocol: str, url_id: int, port: int, ip_version: int, origin: str = ""):
Function ticker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def ticker(
Function organization_report_by_id
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def organization_report_by_id(
Function improvements
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def improvements(
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 organization_report_by_name
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def organization_report_by_name(
Function map_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def map_data(
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 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"
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 get_ipv6
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_ipv6(url: str):
# https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
ipv6 = ""
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 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 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 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 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_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 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 clean_for_organization
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def clean_for_organization(self):
if not self.contest:
raise ValidationError("You're not in a contest", "no_contest")
# mandatory check is done elsewhere.
- 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"