Showing 27 of 27 total issues
Function get_schema
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_schema(df: pd.DataFrame, path: str, dataset_name: str, format: str, dsv_separator: str):
Function _replace_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _replace_value(df, eval_column, columns, evaluator, replace_by):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get_schema
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_schema(df: pd.DataFrame, path: str, dataset_name: str, format: str, dsv_separator: str):
fields = []
for name, dtype in zip(df.columns, df.dtypes):
# TODO : Bool and others
- 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 __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, path: Path = None, env_setter=None):
if env_setter is None:
env_setter = environ
- 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
Avoid too many return
statements within this function. Open
return read_file(Path(base_path).joinpath(resource_name))
Function get_resource_object
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_resource_object(
resource_type: str,
resource: Any,
datapackage_path: str,
resource_name: str,
- 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"