Showing 74 of 202 total issues
File MusicManager.py
has 677 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import shutil
import zipfile
from xml.sax._exceptions import *
File qtclass.py
has 675 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# This file is part of pyqt4topyqt5
MODULES = [
File musicdata.py
has 633 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This class handles very low level queries to the database file, including
creation of tables when files are first created (will do if not exists so
there are no clashes), handling connection and disconnection from the DB,
etc.
File MainWindow.py
has 428 lines of code (exceeds 250 allowed). Consider refactoring. Open
from PyQt4 import QtGui, QtCore, uic
import sip
import os
import difflib
import time
MusicData
has 39 functions (exceeds 20 allowed). Consider refactoring. Open
class MusicData(querylayer.QueryLayer):
parsers = {"tempos": TempoParser(),
"time_signatures": MeterParser(),
"instruments": InstrumentParser()}
Application
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Application(QtCore.QObject):
windows = {}
def __init__(self, app):
self.wifi = True
File querylayer.py
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
from sqlalchemy import create_engine, update
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql.expression import exists, alias, select, or_
from sqlalchemy import Table, Column, Integer, String, MetaData, \
MainWindow
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class MainWindow(QtGui.QMainWindow, themedWindow.ThemedWindow):
widgets = {}
frames = {}
colors = {}
File Application.py
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
from threading import Lock
import os
import pickle
from PyQt4 import QtGui, QtCore, QtXml
from implementation.primaries.GUI import renderingErrorPopup, SetupWindow
Function parseThemePath
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def parseThemePath(path, theme_folder):
path_to_parse = path
prefix = ''
postfix = ''
parsed_path = path
- 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
QueryLayer
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class QueryLayer(object):
tables = {}
join_tables = {"keys": "keys_ins_piece",
"clefs": "clefs_ins_piece",
"instruments": "clefs_ins_piece",
MusicManager
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class MusicManager(SearchLayer):
"""
Grand master class which pulls together features from every other class. This class is instantiated by the Application
class and should provide methods for the application to access everything else, from rendering to info extraction
to API access.
Function LoadMeta
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def LoadMeta(self):
try:
col_fob = open(self.meta_file(), 'rb')
except:
self.SaveMeta()
- 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
SearchLayer
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class SearchLayer(MusicData):
def __init__(self, folder, database):
super().__init__(database)
self.folder = folder
File Widgets.py
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
from PyQt4 import uic, QtCore, QtGui
from implementation.primaries.GUI.helpers import get_base_dir, merge_clefs_and_keys, merge_instruments, fit_columns_to_widget
import os
Function setup_data_items
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def setup_data_items(
self,
playlist_fnames,
playlist_data,
start_index,
- 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 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load(self):
file = os.path.join(self.design_folder, "MainWindow.ui")
uic.loadUi(file, self)
self.setGeometry(0, 0, self.width(), self.height())
self.widgets["scorebook"] = Widgets.Scorebook
Function handleInstrumentQueries
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def handleInstrumentQueries(self, search_data, online=False):
results = {}
all_matched = True
result_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 add_instruments_to_piece
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def add_instruments_to_piece(self, data, piece_id):
result_data = copy.deepcopy(data)
data_keys = ['keys', 'clefs']
for instrument in result_data["instruments"]:
name = instrument['name']
- 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 loadFrame
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def loadFrame(self, child, ypos=72):
"""
method which fetches the appropriate widget, puts it in the
content frame and starts an animation to pull the frame out
:param child: the name of the widget to load