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)
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!
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)
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
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:
MainWindowView
has 58 functions (exceeds 20 allowed). Consider refactoring. Open
class MainWindowView(QtWidgets.QMainWindow):
MAX_RECENT_FILES = 5
MAX_BOOKMARK_FILES = 5
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'
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"),
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(
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()
- Read upRead up
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"))
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()
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()
- Read upRead up
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, AboutDialog):
AboutDialog.setObjectName("AboutDialog")
AboutDialog.setWindowModality(QtCore.Qt.ApplicationModal)
AboutDialog.resize(506, 363)
sizePolicy = QtWidgets.QSizePolicy(
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(
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)
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)
- Read upRead up
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
- Read upRead up
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():
- Read upRead up
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
- Read upRead up
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"