Showing 212 of 220 total issues
File base.py
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pathlib
import typing
from collections import OrderedDict
import os
import json
ClassifierResult
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class ClassifierResult(object):
LABEL_DATA: str = "data"
LABEL_VIDEO_PATH: str = "video_path"
def __init__(self, data: typing.List[SingleClassifierResult]):
Function run
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. 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 classify
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def classify(
self,
video: typing.Union[str, VideoObject],
valid_range: typing.List[VideoCutRange] = None,
step: int = 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"
Further reading
Function draw
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def draw(
self,
classifier_result: ClassifierResult,
report_path: str = None,
unstable_ranges: typing.List[VideoCutRange] = 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"
Further reading
Function _convert_video_into_range_list
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _convert_video_into_range_list(
self, video: VideoObject, block: int, window_size: int, window_coefficient: int
) -> typing.List[VideoCutRange]:
step = self.step
- 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 multi_compare_ssim
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def multi_compare_ssim(
pic1_list: typing.List, pic2_list: typing.List, hooks: typing.List = None
) -> typing.List[float]:
# avoid import loop
from stagesepx.video import VideoFrame
- 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 pick_and_save
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def pick_and_save(
self,
range_list: typing.List[VideoCutRange],
frame_count: int,
to_dir: str = 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"
Further reading
Function calc_changing_cost
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def calc_changing_cost(
self,
) -> typing.Dict[str, typing.Tuple[SingleClassifierResult, SingleClassifierResult]]:
"""calc time cost between stages"""
# add changing cost
- 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_unstable_range
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_unstable_range(
self, limit: int = None, range_threshold: float = None, **kwargs
) -> typing.List[VideoCutRange]:
"""return unstable range only"""
change_range_list = sorted(
- 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_range
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_range(
self, limit: int = None, unstable_limit: int = None, **kwargs
) -> typing.Tuple[typing.List[VideoCutRange], typing.List[VideoCutRange]]:
"""
return stable_range_list and unstable_range_list
- 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 diff
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def diff(
Function classify
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def classify(
Function thumbnail
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def thumbnail(
Function analyse
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def analyse(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get_range_dynamic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_range_dynamic(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _diff
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _diff(
Function diff
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def diff(