Showing 195 of 515 total issues
Function parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function parse(fileContent) {
// Only 0 when the target wasn't reachable
if (!fileContent.server_scan_results || fileContent.server_scan_results.length === 0) {
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 __configure_proxy_settings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __configure_proxy_settings(self, proxy_config: collections.OrderedDict):
"""Private method to configure all proxy specific setings, based on the configuration settings."""
if self._is_not_empty_string("address", proxy_config):
self.check_zap_result(
- 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_correct_secret
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_correct_secret(domain: str, secrets) -> dict[str, str]:
"""Iterates over given list of secrets to find the secret that matches the URL in the given imageID
:param domain: The domain of the imageID of which the correct secret needs to be identified
:param secrets: List of secrets
:returns: Dict containing the secret matching the given imageID
- 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 getCategory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getCategory(target) {
let category = "Image Vulnerability";
if (target.endsWith("package-lock.json") || target == "Node.js") {
category = "NPM Package Vulnerability";
} else if (target.endsWith("Gemfile.lock")) {
- 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 parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function parse(fileContent) {
const { OWASPZAPReport } = await xml2js.parseStringPromise(fileContent);
const findings = [];
- 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 configure_context_authentication
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def configure_context_authentication(
self, context: collections.OrderedDict, context_id: int
):
"""Protected method to configure the ZAP 'Context / Authentication Settings' based on a given ZAP config.
- 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
async function main() {
console.log("Starting Parser");
let scan = await extractScan();
let parseDefinition = await extractParseDefinition(scan);
const resultFileUrl = process.argv[2];
- 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_domain_from_docker_image
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_domain_from_docker_image(name: str) -> str:
"""
Extracts domain and image from a given docker image. Has the same defaulting behavior when it comes to docker.io image as containerd
Code adapted from https://github.com/containerd/containerd/blob/20de989afcd2fd4edc20e9b85312e49a8bbe152b/reference/docker/normalize.go#L102-L119
:param name: docker image
- 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_spider_summary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def print_spider_summary(self):
"""Method to print out a summary of the spider results"""
logging.info("Ajax Spider complete")
- 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 _configure_alert_filters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _configure_alert_filters(
self, alert_filters: List[collections.OrderedDict], context_id: int
):
"""Protected method to configure the ZAP 'Context / Alert Filters' Settings based on a given ZAP config.
- 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_alerts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_alerts(self, baseurl, ignore_scan_rules, out_of_scope_dict):
# Retrieve the alerts using paging in case there are lots of them
start = 0
count_per_page = 5000
alert_dict = {}
- 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 getScansMatchingRule
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getScansMatchingRule(
parentScan: Scan,
findings: Array<Finding>,
cascadingRule: CascadingRule,
parseDefinition: ParseDefinition
- 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 _configure_context_session_management
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _configure_context_session_management(
self, sessions_config: collections.OrderedDict, context_id: int
):
"""Protected method to configure the ZAP 'Context / Session Mannagement' Settings based on a given ZAP config.
- 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 wait_until_spider_finished
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wait_until_spider_finished(self):
"""
Waits for the ZAP Spider to complete.
This method also enforces the "maxDuration" limit of the spider, ZAP normally enforces it on its own,
- 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_spider_summary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def print_spider_summary(self):
"""Method to print out a summary of the spider results"""
logging.info("HTTP Spider(%s) completed", str(self.get_spider_id))
num_urls = len(self.get_zap.core.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"