Showing 248 of 248 total issues

subprocess call - check for execution of untrusted input.
Open

    p2 = Popen(['openssl', 'pkcs7', '-print_certs'], stdin=PIPE, stdout=PIPE,
               stderr=PIPE, universal_newlines=True)
Severity: Info
Found in ssm/crypto.py by bandit

Starting a process with a partial executable path
Open

    p1 = Popen(['openssl', 'smime', '-verify', '-CApath', capath, '-noverify'],
               stdin=PIPE, stdout=PIPE, stderr=PIPE, universal_newlines=True)
Severity: Info
Found in ssm/crypto.py by bandit

Starting a process with a partial executable path
Open

    p1 = Popen(['openssl', 'smime', '-decrypt',
                '-recip', certpath, '-inkey', keypath],
               stdin=PIPE, stdout=PIPE, stderr=PIPE, universal_newlines=True)
Severity: Info
Found in ssm/crypto.py by bandit

Possible hardcoded password: ''
Open

    def __init__(self, hosts_and_ports, qpath, cert, key, dest=None, listen=None,
                 capath=None, check_crls=False, use_ssl=True, enc_cert=None,
                 verify_enc_cert=True, pidfile=None, path_type='dirq',
                 protocol=STOMP_MESSAGING, project=None, token=''):
        """Create an SSM2 object.
Severity: Info
Found in ssm/ssm2.py by bandit

Refactor this function to reduce its Cognitive Complexity from 28 to the 15 allowed.
Open

    def __init__(self, hosts_and_ports, qpath, cert, key, dest=None, listen=None,
Severity: Critical
Found in ssm/ssm2.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Merge this if statement with the enclosing one.
Open

                if not crypto.verify_cert_path(self._enc_cert, self._capath, self._check_crls):
Severity: Major
Found in ssm/ssm2.py by sonar-python

Merging collapsible if statements increases the code's readability.

Noncompliant Code Example

if condition1:
    if condition2:
        # ...

Compliant Solution

if condition1 and condition2:
    # ...

Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
Open

    def send_all(self):
Severity: Critical
Found in ssm/ssm2.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Method "__init__" has 17 parameters, which is greater than the 7 authorized.
Open

    def __init__(self, hosts_and_ports, qpath, cert, key, dest=None, listen=None,
                 capath=None, check_crls=False, use_ssl=True, enc_cert=None,
                 verify_enc_cert=True, pidfile=None, path_type='dirq',
                 protocol=STOMP_MESSAGING, project=None, token=''):
Severity: Major
Found in ssm/ssm2.py by sonar-python

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...
Severity
Category
Status
Source
Language