videomorph-dev/videomorph

View on GitHub

Showing 23 of 38 total issues

File videomorph_qrc.py has 47940 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

# Resource object code
#
# Created by: The Resource Compiler for PyQt6 (Qt v6.4.0)
Severity: Major
Found in videomorph/forms/videomorph_qrc.py - About 5 mos to fix

    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 __init__ has 109 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def __init__(self, parent=None, position=0, task_list=None):
                super(InfoDialog, self).__init__(parent)
                self.position = position
                self.task_list = task_list
        
        
        Severity: Major
        Found in videomorph/forms/info.py - About 4 hrs to fix

          TaskList has 29 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class TaskList(list):
              """Class to store the list of video files to convert."""
          
              def __init__(self, profile, output_dir=Path.home()):
                  """Class initializer."""
          Severity: Minor
          Found in videomorph/converter/tasklist.py - About 3 hrs to fix

            Function __init__ has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def __init__(self, parent=None):
                    """Class initializer."""
                    super(AboutVMDialog, self).__init__(parent)
                    self.setWindowTitle(self.tr("About"))
                    self.resize(500, 404)
            Severity: Major
            Found in videomorph/forms/about.py - About 2 hrs 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 run_on_console has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                def run_on_console(app, main_win):
                    """Provide options to run VideoMorph from the command line."""
                
                    # Add a parser for command line
                    parser = argparse.ArgumentParser(description=APP_NAME + " " + VERSION)
                Severity: Minor
                Found in videomorph/converter/console.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 _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 search_directory_recursively has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                def search_directory_recursively(directory, files=None):
                    """Search a directory for video files."""
                    if files is None:
                        files = []
                
                
                Severity: Minor
                Found in videomorph/converter/console.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 _codecs_are_available has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _codecs_are_available(self, params):
                        preset_codecs = self._get_preset_codecs(params)
                        vcodec = acodec = scodec = True
                
                        if preset_codecs.vcodec is not None:
                Severity: Minor
                Found in videomorph/converter/profile.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 get_xml_profile_attr has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    def get_xml_profile_attr(self, target_quality, attr_name="preset_params"):
                        """Return a param of Profile."""
                        param_map = {
                            "preset_name_en": 0,
                            "preset_params": 1,
                Severity: Minor
                Found in videomorph/converter/profile.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 _parse_probe has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _parse_probe(self, selected_params, cmd):
                        """Parse the probe output."""
                        info = {}
                
                        with self._probe(cmd) as probe_file:
                Severity: Minor
                Found in videomorph/converter/probe.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 get_xml_profile_qualities has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    def get_xml_profile_qualities(self, locale=LOCALE):
                        """Return a list of available Qualities per conversion profile."""
                        qualities_per_profile = OrderedDict()
                
                        for xml_file in self._xml_files:
                Severity: Minor
                Found in videomorph/converter/profile.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 _generate_changelog has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _generate_changelog(self):
                        """Return a human readable changelog."""
                        changelog_path = join_path(SYS_PATHS["doc"], "changelog.gz")
                        if exists(changelog_path):
                            changelog_file = changelog_path
                Severity: Minor
                Found in videomorph/forms/changelog.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 main has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def main():
                    """Main app function."""
                    # Create the app
                    app = QApplication(sys.argv)
                    qApp= QApplication.instance()
                Severity: Minor
                Found in videomorph/main.py - About 45 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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(
                Severity: Minor
                Found in videomorph/converter/profile.py - About 35 mins to fix

                  Function _get_qualities has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _get_qualities(self, profile, locale=LOCALE):
                          qualities = []
                          for preset in profile:
                              if self._codecs_are_available(preset[1].text):
                                  if locale == "es_ES":
                  Severity: Minor
                  Found in videomorph/converter/profile.py - About 35 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 _read has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _read(self, param, start):
                          """Read the available encoders from ffmpeg."""
                          video = {}
                          audio = {}
                          subtitle = {}
                  Severity: Minor
                  Found in videomorph/converter/codec.py - About 35 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

                  Severity
                  Category
                  Status
                  Source
                  Language