williamfzc/stagesepx

View on GitHub

Showing 212 of 220 total issues

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert classify_result.contain(to_stage), f"no stage {to_stage} found in result"
Severity: Info
Found in stagesepx/api.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert max_retry != 0, f"fail to get range dynamically: {stable_num_limit}"
Severity: Info
Found in stagesepx/cutter/cut_result.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

    assert ret, f"read frame failed, frame id: {frame_id}"

Severity: Info
Found in stagesepx/toolbox.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert os.path.isfile(model_path), f"model file {model_path} not existed"
        # assert model data is empty
Severity: Info
Found in stagesepx/classifier/keras.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

    assert os.path.isfile(img_path), f"file {img_path} is not existed"
Severity: Info
Found in stagesepx/toolbox.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert self.data, "load_frames() first"
Severity: Info
Found in stagesepx/video.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert not output_path.is_file(), f"file {output_path} already existed"
Severity: Info
Found in stagesepx/api.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

            assert p.is_dir(), f"{p} is not a valid directory"
            # validate: at least two classes
Severity: Info
Found in stagesepx/classifier/keras.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

            assert (
                number_of_dir > 1
            ), f"dataset only contains one class. maybe some path errors happened: {p}?"

            # more than 6 classes?
Severity: Info
Found in stagesepx/classifier/keras.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert os.path.isfile(from_file), f"file {from_file} not existed"
Severity: Info
Found in stagesepx/reporter.py by bandit

subprocess call - check for execution of untrusted input.
Open

    return subprocess.check_call(command)
Severity: Info
Found in stagesepx/toolbox.py by bandit

Remove this commented out code.
Open

        # model  = Sequential()
Severity: Major
Found in example/with_keras.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"
Severity
Category
Status
Source
Language