stagesepx/api.py
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert classify_result.contain(
from_stage
), f"no stage {from_stage} found in result"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert not os.path.isfile(model_path), f"file {model_path} already existed"
# handle args
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert model_path.is_file(), f"file {model_path} not existed"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert config_path.as_posix().endswith(
".json"
), "config file should be json format"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert config_path.is_file(), f"no config file found in {config_path}"
# todo: support different types in the future
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert classify_result.contain(to_stage), f"no stage {to_stage} found in result"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert not output_path.is_file(), f"file {output_path} already existed"
- Exclude checks
Function run
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def run(config: typing.Union[dict, str]):
"""
run with config
:param config: config file path, or a preload dict
- 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 keras_train
has 7 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
Wontfix
def keras_train(
Function analyse
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def analyse(
Function _diff
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _diff(
Line too long (86 > 79 characters) Open
Open
target_size: typing.Sequence[int] = [int(each) for each in target_size.split("x")]
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (88 > 79 characters) Open
Open
assert classify_result.contain(to_stage), f"no stage {to_stage} found in result"
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.