owlmixin/__init__.py
File __init__.py
has 965 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# coding: utf-8
# pylint: disable=too-many-lines
import inspect
import sys
Function traverse
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Open
def traverse(
type_, name, value, cls, force_snake_case: bool, force_cast: bool, restrict: bool
) -> Any:
# pylint: disable=too-many-return-statements,too-many-branches,too-many-arguments
if isinstance(type_, 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"
Further reading
OwlMixin
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class OwlMixin(DictTransformer, JsonTransformer, YamlTransformer, metaclass=OwlMeta):
@classmethod
def from_dict(
cls,
d: dict,
Function traverse
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def traverse(
Function from_csvf_to_iterator
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_csvf_to_iterator(
Function from_yamlf_to_list
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_yamlf_to_list(
Function from_yamlf_to_iterator
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_yamlf_to_iterator(
Function from_csvf_to_list
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_csvf_to_list(
Function from_yamlf
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_yamlf(
Function from_jsonf_to_list
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_jsonf_to_list(
Function from_jsonf
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_jsonf(
Function from_jsonf_to_iterator
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_jsonf_to_iterator(
Function from_yaml_to_list
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_yaml_to_list(
Function from_iterable_dicts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_iterable_dicts(
Function from_dicts_by_key
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_dicts_by_key(
Function from_optional_dicts_by_key
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_optional_dicts_by_key(
Function from_json_to_iterator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_json_to_iterator(
Function from_json
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_json(
Function from_optional_dicts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_optional_dicts(
Function from_json_to_list
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_json_to_list(
Function from_dict
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_dict(
Function from_optional_dict
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_optional_dict(
Function from_optional_iterable_dicts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_optional_iterable_dicts(
Function from_json_url
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_json_url(
Function from_yaml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_yaml(
Function from_yaml_to_iterator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_yaml_to_iterator(
Function from_dicts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_dicts(
Function from_dict
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def from_dict(
cls,
d: dict,
*,
force_snake_case: bool = True,
- 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
Open
return TDict(
Avoid too many return
statements within this function. Open
Open
return type_.from_value(value)
Avoid too many return
statements within this function. Open
Open
return TList(
Avoid too many return
statements within this function. Open
Open
return TOption(None)
Avoid too many return
statements within this function. Open
Open
return type_(value)
Avoid too many return
statements within this function. Open
Open
return TIterator(
Avoid too many return
statements within this function. Open
Open
return TOption(
Avoid too many return
statements within this function. Open
Open
return value