File entrypoint_parser.py
has 575 lines of code (exceeds 250 allowed). Consider refactoring.
"""
Entrypoint Parser
-----------------
This module contains high-level objects to manage the functionality of ``generic_parser``: entry
File dict_parser.py
has 376 lines of code (exceeds 250 allowed). Consider refactoring.
"""
Dictionary Parser
-----------------
This module holds classes to handle different `dictionaries` as argument containers.
Function _handle_commandline
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
def _handle_commandline(self, args=None):
"""No input to function."""
try:
with silence():
Function _handle_kwargs
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
def _handle_kwargs(self, kwargs):
"""**kwargs been input."""
if ID_CONFIG in kwargs:
if len(kwargs) > 2 or (len(kwargs) == 2 and ID_SECTION not in kwargs):
raise ArgumentError(
Function _validate_parameters
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
def _validate_parameters(dictionary):
"""
Validates an input dictionary that can be used as parameters.
Args:
Function print_dict_tree
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def print_dict_tree(dictionary, name='Dictionary', print_fun=LOG.info):
"""Prints a dictionary as a tree."""
def print_tree(tree, level_char):
for i, key in enumerate(sorted(tree.keys())):
if i == len(tree) - 1:
Function get_multi_class
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
def get_multi_class(*classes):
"""
Create a class 'behaving' like all classes in `classes`.
In case a value needs to be converted to a class in this list, it is attempted to cast the
Function _check_parameter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
def _check_parameter(self):
"""EntryPoint specific checks for parameter."""
for param in self.parameter:
arg_name = param.get("name", None)
if arg_name is None:
Function parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def parse(self, *args, **kwargs):
"""
Parse whatever input parameter come. This is the heart of EntryPoint and will recognize
the input and parse it accordingly. Allowed inputs are:
- Dictionary with arguments as key-values.