mstuttgart/pynocchio

View on GitHub

Showing 26 of 47 total issues

File main_window_view_rc.py has 5491 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.11.2)
Severity: Major
Found in pynocchio/uic_files/main_window_view_rc.py - About 2 wks to fix

    File style_rc.py has 1547 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # Resource object code
    #
    # Created by: The Resource Compiler for PyQt5 (Qt v5.8.0)
    #
    # WARNING! All changes made in this file will be lost!
    Severity: Major
    Found in pynocchio/uic_files/style_rc.py - About 4 days to fix

      Function setupUi has 569 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def setupUi(self, MainWindowView):
              MainWindowView.setObjectName("MainWindowView")
              MainWindowView.resize(1048, 537)
              sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
              sizePolicy.setHorizontalStretch(0)
      Severity: Major
      Found in pynocchio/uic_files/main_window_view_ui.py - About 2 days to fix

        File main_window_view_ui.py has 642 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        
        # Form implementation generated from reading ui file 'forms/main_window_view.ui'
        #
        # Created by: PyQt5 UI code generator 5.10.1
        Severity: Major
        Found in pynocchio/uic_files/main_window_view_ui.py - About 1 day to fix

          File main_window_view.py has 544 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import logging
          
          from PyQt5 import QtCore, QtGui, QtWidgets
          
          try:
          Severity: Major
          Found in pynocchio/main_window_view.py - About 1 day to fix

            MainWindowView has 58 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class MainWindowView(QtWidgets.QMainWindow):
            
                MAX_RECENT_FILES = 5
                MAX_BOOKMARK_FILES = 5
            
            
            Severity: Major
            Found in pynocchio/main_window_view.py - About 1 day to fix

              MainWindowModel has 47 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class MainWindowModel(QtCore.QObject):
                  _ORIGINAL_FIT = 'action_original_fit'
                  _VERTICAL_FIT = 'action_vertical_fit'
                  _HORIZONTAL_FIT = 'action_horizontal_fit'
                  _BEST_FIT = 'action_best_fit'
              Severity: Minor
              Found in pynocchio/main_window_model.py - About 6 hrs to fix

                Function setupUi has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def setupUi(self, GoPageDialog):
                        GoPageDialog.setObjectName("GoPageDialog")
                        GoPageDialog.resize(285, 514)
                        icon = QtGui.QIcon()
                        icon.addPixmap(QtGui.QPixmap(":/icons/icons/edit-find.png"),
                Severity: Major
                Found in pynocchio/uic_files/go_to_page_dialog_ui.py - About 4 hrs to fix

                  Function setupUi has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def setupUi(self, Bookmark_Dialog):
                          Bookmark_Dialog.setObjectName("Bookmark_Dialog")
                          Bookmark_Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
                          Bookmark_Dialog.resize(776, 441)
                          sizePolicy = QtWidgets.QSizePolicy(
                  Severity: Major
                  Found in pynocchio/uic_files/bookmark_manager_dialog_ui.py - About 3 hrs to fix

                    Function _resize_page has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _resize_page(self, pix_map):
                    
                            width = pix_map.width()
                            height = pix_map.height()
                    
                    
                    Severity: Minor
                    Found in pynocchio/main_window_model.py - About 3 hrs 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 retranslateUi has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def retranslateUi(self, MainWindowView):
                            _translate = QtCore.QCoreApplication.translate
                            MainWindowView.setWindowTitle(_translate("MainWindowView", "Pynocchio"))
                            MainWindowView.setAccessibleName(_translate("MainWindowView", "Pynocchio"))
                            MainWindowView.setAccessibleDescription(_translate("MainWindowView", "The Best Comic Reader"))
                    Severity: Major
                    Found in pynocchio/uic_files/main_window_view_ui.py - About 2 hrs to fix

                      Function setupUi has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def setupUi(self, config_dialog):
                              config_dialog.setObjectName("config_dialog")
                              config_dialog.setWindowModality(QtCore.Qt.ApplicationModal)
                              config_dialog.resize(400, 213)
                              icon = QtGui.QIcon()
                      Severity: Major
                      Found in pynocchio/uic_files/preference_dialog_ui.py - About 2 hrs to fix

                        Function _get_comic_to_open has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _get_comic_to_open(self):
                                selection_model = self.ui.bookmark_table.selectionModel()
                        
                                if selection_model.hasSelection():
                                    path = selection_model.selectedRows(1)[0].data()
                        Severity: Minor
                        Found in pynocchio/bookmark_manager_dialog.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 setupUi has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def setupUi(self, NotFoundDialog):
                                NotFoundDialog.setObjectName("NotFoundDialog")
                                NotFoundDialog.setWindowModality(QtCore.Qt.ApplicationModal)
                                NotFoundDialog.resize(506, 363)
                                sizePolicy = QtWidgets.QSizePolicy(
                        Severity: Minor
                        Found in pynocchio/uic_files/not_found_dialog_ui.py - About 1 hr to fix

                          Function setupUi has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def setupUi(self, AboutDialog):
                                  AboutDialog.setObjectName("AboutDialog")
                                  AboutDialog.setWindowModality(QtCore.Qt.ApplicationModal)
                                  AboutDialog.resize(506, 363)
                                  sizePolicy = QtWidgets.QSizePolicy(
                          Severity: Minor
                          Found in pynocchio/uic_files/about_dialog_ui.py - About 1 hr to fix

                            Function setupUi has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def setupUi(self, Thumbnails):
                                    Thumbnails.setObjectName("Thumbnails")
                                    Thumbnails.resize(183, 195)
                                    sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
                                    sizePolicy.setHorizontalStretch(0)
                            Severity: Minor
                            Found in pynocchio/uic_files/thumbnails_ui.py - About 1 hr to fix

                              Function load has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def load(self, filename, initial_page=None):
                                      logger.info('Loading %s at %i', filename,
                                                  0 if initial_page is None else initial_page)
                              
                                      loader = ComicLoaderFactory.create_loader(filename)
                              Severity: Minor
                              Found in pynocchio/main_window_model.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 load has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def load(self, filename):
                                      """ Load tar file and create Page objects with them.
                              
                                          Args:
                                              filename: name of tar file
                              Severity: Minor
                              Found in pynocchio/comic_file_loader_tar.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 on_action_fullscreen_triggered has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def on_action_fullscreen_triggered(self):
                              
                                      if self.isFullScreen():
                                          self.ui.menubar.show()
                                          if self.ui.action_show_toolbar.isChecked():
                              Severity: Minor
                              Found in pynocchio/main_window_view.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 load has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def load(self, dirname):
                                      """ Load image files in directory and create Page objects with them.
                              
                                      Args:
                                          dirname: name of directory
                              Severity: Minor
                              Found in pynocchio/comic_file_loader_dir.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

                              Severity
                              Category
                              Status
                              Source
                              Language