Showing 32 of 32 total issues
Function feat_to_cols
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def feat_to_cols(feat, proc_fk, wrap, init_prefix=(), open_to_fk=True) -> list:
Function _get_persistent_state_dependencies
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_persistent_state_dependencies(self, conf: Config):
for dep in self.dependencies:
if isinstance(dep, type) and (PersistentState in dep.mro()):
base = [CONF_KEYS.persistent_states, dep.get_full_name()]
for k in conf.persistent_states.get(base[-1], {}).keys():
- 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 _get_data_envs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_data_envs(self):
arg_set = set()
for env in self.config.envs:
for project_name, data_env in env.import_envs.items():
a_imp = self.config.get_import(project_name)
- 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 _parse_elem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _parse_elem(elem, env: str) -> str:
if isinstance(elem, ReportFile):
return [elem.env_posix(env)]
if isinstance(elem, ScruTable):
with elem.env_ctx(env):
- 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 _validate_table
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _validate_table(self, table: ScruTable):
dt_map = {}
table_id = table.id_.sql_id
logger.info("validating table", table=table_id)
if not is_postgres(self.engine):
- 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 get_raw_data_path
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_raw_data_path(leaf_name: str, project: Optional[str] = None) -> Path:
"""if project is None, raw data output path is given, otherwise imported"""
loc = Path.cwd()
for _ in range(MAX_LEVELS):
if is_dz_project(loc):
- 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 _type_or_fun_elem(elem)
Function _fill_projects
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _fill_projects(self):
for base_id, ns_meta in self._ns_meta_dic.items():
proj_id = base_id.project
if proj_id not in self.metadata_dic.keys():
proj_v = _get_v_of_ext_project(proj_id)
- 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 zid_from_readme
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def zid_from_readme(self):
zid = None
for readme_line in README_PATH.read_text().split("\n"):
if readme_line == CITE_HEADER:
break
- 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 feat_to_cols
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def feat_to_cols(feat, proc_fk, wrap, init_prefix=(), open_to_fk=True) -> list:
new_open_to_fk = True
fk_to = None
if isinstance(feat, PrimitiveFeature):
name = PREFIX_SEP.join([*init_prefix, feat.name])
- 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 deposit_to_zenodo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def deposit_to_zenodo(
env: str = "",
publish: bool = False,
test: bool = False,
path_filter: 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
Function get_table_for_entity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_table_for_entity(
self, ec: EntityClass, base_table: ScruTable, feat_elems
) -> ScruTable:
fixed = base_table.key_map.get(feat_elems)
if fixed is not None:
- 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"