intracom-telecom-sdn/nstat

View on GitHub
util/process.py

Summary

Maintainability
A
1 hr
Test Coverage

Showing 2 of 2 total issues

Function getpid_listeningonport has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def getpid_listeningonport(port, ssh_client=None):
"""
Finds if there is a running process listening for network connections \
on a specific port.
 
Severity: Minor
Found in util/process.py - About 35 mins to fix

Function is_process_running has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def is_process_running(pid, ssh_client=None):
"""Finds if a process is running, using its process ID.
 
:param pid: The process ID of the target process
:param ssh_client: SSH client provided by paramiko to run the command
Severity: Minor
Found in util/process.py - About 25 mins to fix
Category
Status