videomorph-dev/videomorph

View on GitHub
videomorph/forms/videomorph.py

Summary

Maintainability
F
5 days
Test Coverage

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.
Severity: Major
Found in videomorph/forms/videomorph.py - About 3 days to fix

    VideoMorphMW has 75 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class VideoMorphMW(QMainWindow):
        """VideoMorph Main Window class."""
    
        def __init__(self):
            """Class initializer."""
    Severity: Major
    Found in videomorph/forms/videomorph.py - About 1 day to fix

      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)
      Severity: Minor
      Found in videomorph/forms/videomorph.py - About 1 hr to fix

        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:
        Severity: Minor
        Found in videomorph/forms/videomorph.py - About 1 hr to fix

        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
        Severity: Minor
        Found in videomorph/forms/videomorph.py - About 55 mins to fix

        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
        Severity: Minor
        Found in videomorph/forms/videomorph.py - About 25 mins to fix

        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
        Severity: Minor
        Found in videomorph/forms/videomorph.py - About 25 mins to fix

        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

        There are no issues that match your filters.

        Category
        Status