File videomorph.py
has 1175 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# File name: videomorph.py
#
# VideoMorph - A PyQt6 frontend to ffmpeg.
VideoMorphMW
has 75 functions (exceeds 20 allowed). Consider refactoring. Open
class VideoMorphMW(QMainWindow):
"""VideoMorph Main Window class."""
def __init__(self):
"""Class initializer."""
Function _group_settings
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _group_settings(self):
"""Settings group."""
settings_gb = QGroupBox(self.central_widget)
settings_gb.setTitle(self.tr("Conversion Options"))
size_policy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Preferred)
Function _end_encoding_process
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _end_encoding_process(self):
"""End up the encoding process."""
# Test if encoding process is finished
if self.task_list.is_exhausted:
if self.library.error 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"
Further reading
Function add_tasks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_tasks(self, *files):
"""Add video files to conversion list.
Args:
files (list): List of video file paths
- 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 start_encoding
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def start_encoding(self):
"""Start the encoding process."""
self._update_ui_when_converter_running()
self.task_list.position += 1
- 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 _finish_file_encoding
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _finish_file_encoding(self):
"""Finish the file encoding process."""
if self.task_list.running_task_status != STATUS.stopped:
self.notify()
# Close and kill the conversion process
- 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"