Function _get_account_info_if_not_exist
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
def _get_account_info_if_not_exist(self):
"""
Method to fetch the account from the user
"""
if self.conjurrc_data.conjur_account is None:
Function _run_command_flow
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
def _run_command_flow(self, args, resource):
ssl_verification_meta_data = get_ssl_verification_meta_data_from_conjurrc(args.ssl_verify)
conjurrc_data = ConjurrcData.load_from_file()
client = Client(ssl_verification_mode=ssl_verification_meta_data.mode,
connection_info=conjurrc_data.get_client_connection_info(),
Function handle_init_logic
has 9 arguments (exceeds 4 allowed). Consider refactoring.
def handle_init_logic(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring.
def __init__(self, conjur_url: str = None, account: str = None, cert_file: str = None,
Function run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def run(self):
"""
Main entrypoint for the class invocation from both CLI, Package, and
test sources. Parses CLI args and invokes the appropriate client command.
"""
Function validate_init_action_ssl_verification_input
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def validate_init_action_ssl_verification_input(ca_path, is_self_signed, ssl_verify):
"""
Validate the input related to ssl verification for the init action
"""
use_ca_bundle = False
Function handle_init_logic
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def handle_init_logic(
url: str = None, account: str = None,
authn_type: str = None, service_id: str = None,
cert: str = None, force: bool = None,
ssl_verify=None, is_self_signed: bool = False,
Function is_exists
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def is_exists(self, conjur_url: str) -> bool:
if not os.path.exists(DEFAULT_NETRC_FILE) or os.path.getsize(DEFAULT_NETRC_FILE) == 0:
return False
netrc_auth = ""
Function parse_args
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def parse_args(self, args: list = None, namespace: str = None, resource: str = None) -> list:
args, arg_flags = self.parse_known_args(args, namespace)
resource = args.resource if args else None
if arg_flags:
Function __repr__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def __repr__(self) -> str:
result = []
if self.kind: result.append(f"'kind': '{self.kind}'")
if self.limit: result.append(f"'limit': '{self.limit}'")