mstuttgart/pynocchio

View on GitHub

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

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

                    if self.fit_type == MainWindowModel._VERTICAL_FIT:
                        f = h / height
                        if int(f*width) > w:
                            h -= self.scroll_bar_size
                            f = h / height
            Severity: Major
            Found in pynocchio/main_window_model.py and 1 other location - About 1 day to fix
            pynocchio/main_window_model.py on lines 197..207

            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 131.

            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

                    elif self.fit_type == MainWindowModel._HORIZONTAL_FIT:
                        f = w / width
                        if int(f*height) > h:
                            w -= self.scroll_bar_size
                            f = w / width
            Severity: Major
            Found in pynocchio/main_window_model.py and 1 other location - About 1 day to fix
            pynocchio/main_window_model.py on lines 185..195

            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 131.

            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

            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

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

                              if option == QtWidgets.QMessageBox.Ok:
                                  for index in self.ui.bookmark_table.selectedIndexes():
                                      self.model.removeRow(index.row())
              
                                  self.model.submitAll()
              Severity: Major
              Found in pynocchio/bookmark_manager_dialog.py and 1 other location - About 6 hrs to fix
              pynocchio/bookmark_manager_dialog.py on lines 92..102

              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 107.

              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

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

                      if option == QtWidgets.QMessageBox.Ok:
              
                          for index in self.ui.bookmark_table.selectedIndexes():
                              self.model.removeRow(index.row())
              
              
              Severity: Major
              Found in pynocchio/bookmark_manager_dialog.py and 1 other location - About 6 hrs to fix
              pynocchio/bookmark_manager_dialog.py on lines 122..131

              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 107.

              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

              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

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

                        def add_page_number_label(self):
                            if self.page_number is None:
                                self.remove_progress_bar()
                                self.page_number = QtWidgets.QLabel(self)
                                self.page_number.setMinimumWidth(120)
                    Severity: Major
                    Found in pynocchio/uic_files/custom_widgets/status_bar.py and 1 other location - About 3 hrs to fix
                    pynocchio/uic_files/custom_widgets/status_bar.py on lines 26..33

                    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 70.

                    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

                        def add_page_resolution_label(self):
                            if self.page_resolution is None:
                                self.remove_progress_bar()
                                self.page_resolution = QtWidgets.QLabel(self)
                                self.page_resolution.setMinimumWidth(140)
                    Severity: Major
                    Found in pynocchio/uic_files/custom_widgets/status_bar.py and 1 other location - About 3 hrs to fix
                    pynocchio/uic_files/custom_widgets/status_bar.py on lines 17..24

                    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 70.

                    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 _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

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

                        def retranslateUi(self, GoPageDialog):
                            _translate = QtCore.QCoreApplication.translate
                            GoPageDialog.setWindowTitle(_translate("GoPageDialog", "Go to Page"))
                            self.page_label_2.setText(_translate("GoPageDialog", "Page "))
                            self.total_page_label.setText(_translate("GoPageDialog", "page"))
                    Severity: Major
                    Found in pynocchio/uic_files/go_to_page_dialog_ui.py and 2 other locations - About 3 hrs to fix
                    pynocchio/uic_files/about_dialog_ui.py on lines 70..79
                    pynocchio/uic_files/not_found_dialog_ui.py on lines 70..76

                    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 62.

                    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

                        def retranslateUi(self, AboutDialog):
                            _translate = QtCore.QCoreApplication.translate
                            AboutDialog.setWindowTitle(_translate(
                                "AboutDialog", "About Pynocchio"))
                            self.about_text_browser.setHtml(_translate("AboutDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
                    Severity: Major
                    Found in pynocchio/uic_files/about_dialog_ui.py and 2 other locations - About 3 hrs to fix
                    pynocchio/uic_files/go_to_page_dialog_ui.py on lines 156..160
                    pynocchio/uic_files/not_found_dialog_ui.py on lines 70..76

                    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 62.

                    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

                        def retranslateUi(self, NotFoundDialog):
                            _translate = QtCore.QCoreApplication.translate
                            NotFoundDialog.setWindowTitle(
                                _translate("NotFoundDialog", "File not found"))
                            self.not_found_text_label.setText(_translate(
                    Severity: Major
                    Found in pynocchio/uic_files/not_found_dialog_ui.py and 2 other locations - About 3 hrs to fix
                    pynocchio/uic_files/about_dialog_ui.py on lines 70..79
                    pynocchio/uic_files/go_to_page_dialog_ui.py on lines 156..160

                    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 62.

                    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 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
                      Severity
                      Category
                      Status
                      Source
                      Language