videomorph-dev/videomorph

View on GitHub

Showing 38 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      class _LinuxLauncher(_Launcher):
          """Concrete class to implement external apps launcher in Linux."""
      
          def __init__(self):
              super(_LinuxLauncher, self).__init__()
      Severity: Major
      Found in videomorph/converter/launchers.py and 1 other location - About 2 days to fix
      videomorph/converter/launchers.py on lines 117..164

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 222.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      class _DarwinLauncher(_Launcher):
          """Concrete class to implement external apps launcher in MacOS."""
      
          def __init__(self):
              super(_DarwinLauncher, self).__init__()
      Severity: Major
      Found in videomorph/converter/launchers.py and 1 other location - About 2 days to fix
      videomorph/converter/launchers.py on lines 67..114

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 222.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                    if preset_codecs.vcodec is not None:
                        if not (
                            preset_codecs.vcodec in self._available_codecs.vencoders
                            or preset_codecs.vcodec in self._available_codecs.vcodecs
                        ):
            Severity: Major
            Found in videomorph/converter/profile.py and 2 other locations - About 2 hrs to fix
            videomorph/converter/profile.py on lines 173..178
            videomorph/converter/profile.py on lines 180..185

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                    if preset_codecs.acodec is not None:
                        if not (
                            preset_codecs.acodec in self._available_codecs.aencoders
                            or preset_codecs.acodec in self._available_codecs.acodecs
                        ):
            Severity: Major
            Found in videomorph/converter/profile.py and 2 other locations - About 2 hrs to fix
            videomorph/converter/profile.py on lines 166..171
            videomorph/converter/profile.py on lines 180..185

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                    if preset_codecs.scodec is not None:
                        if not (
                            preset_codecs.scodec in self._available_codecs.sencoders
                            or preset_codecs.scodec in self._available_codecs.scodecs
                        ):
            Severity: Major
            Found in videomorph/converter/profile.py and 2 other locations - About 2 hrs to fix
            videomorph/converter/profile.py on lines 166..171
            videomorph/converter/profile.py on lines 173..178

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            SYS_PATHS["help"].__str__(),
                            [
                                Path(VM_PATHS["help"], "manual_es.pdf").__str__(),
                                Path(VM_PATHS["help"], "manual_en.pdf").__str__(),
                Severity: Major
                Found in setup.py and 3 other locations - About 1 hr to fix
                setup.py on lines 99..102
                setup.py on lines 120..123
                setup.py on lines 158..161

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 46.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            SYS_PATHS["profiles"].__str__(),
                            [
                                Path(VM_PATHS["profiles"], "default.xml").__str__(),
                                Path(VM_PATHS["profiles"], "customized.xml").__str__(),
                Severity: Major
                Found in setup.py and 3 other locations - About 1 hr to fix
                setup.py on lines 99..102
                setup.py on lines 120..123
                setup.py on lines 179..182

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 46.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            SYS_PATHS["profiles"].__str__(),
                            [
                                Path(VM_PATHS["profiles"], "default.xml").__str__(),
                                Path(VM_PATHS["profiles"], "customized.xml").__str__(),
                Severity: Major
                Found in setup.py and 3 other locations - About 1 hr to fix
                setup.py on lines 120..123
                setup.py on lines 158..161
                setup.py on lines 179..182

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 46.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            SYS_PATHS["help"].__str__(),
                            [
                                Path(VM_PATHS["help"], "manual_es.pdf").__str__(),
                                Path(VM_PATHS["help"], "manual_en.pdf").__str__(),
                Severity: Major
                Found in setup.py and 3 other locations - About 1 hr to fix
                setup.py on lines 99..102
                setup.py on lines 158..161
                setup.py on lines 179..182

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 46.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

                Severity
                Category
                Status
                Source
                Language