Showing 74 of 202 total issues
Function add_instrument_to_piece
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_instrument_to_piece(self, data, piece_id, clefs={}, keys={}):
ins = self.get_or_add(data, table='instruments')[0]
for clef_data in clefs:
clef = self.query(clef_data, table='clefs')
if len(clef) > 0:
- 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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, parent, file, title, design_folder, data_set="mine"):
Function handleTransposition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handleTransposition(tags, attrs, chars, parts, data):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, method, callback, queue, data, kwargs={}):
Function create_elem
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_elem(chars, key1, key2, cast1=int, cast2=str):
Function handleMeter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handleMeter(tags, attrs, chars, parts, data):
Function handle_clef_or_key
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_clef_or_key(tags, attrs, chars, parts, data):
Function handleBibliography
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handleBibliography(tags, attrs, chars, parts, data):
Function fetch_and_form_results
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fetch_and_form_results(self, data, key, method, *args, **kwargs):
Function fetch_results
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fetch_results(self, data, key, method, *args, **kwargs):
Function make_new_part
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_new_part(tags, attrs, chars, parts, data):
Function getPieceByTitle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def getPieceByTitle(self, title, *args,
Function handle_tempo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_tempo(tags, attrs, chars, parts, data):
Function parseNewFiles
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parseNewFiles(self, file_list):
"""
method to call the sax parser on each of the new files then send the data to the data layer
:param file_list:
:return:
- 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 getPieceByMeter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def getPieceByMeter(self, meters, archived=False, online=False):
results = set()
for meter in meters:
if "/" in meter:
values = meter.split("/")
- 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 getPieceByInstrumentIn_
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def getPieceByInstrumentIn_(
self,
data,
table="clefs",
archived=False,
- 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 query_multiple
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def query_multiple(
self,
data,
filter_col="piece.id",
table="clefs_ins_piece"):
- 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 cleanupContentLayout
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cleanupContentLayout(self, layout):
if layout is not None:
while layout.count():
item = layout.takeAt(0)
widge = item.widget()
- 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 make_new_part
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def make_new_part(tags, attrs, chars, parts, data):
"""
handler which works with anything inside the score-part tag, which creates a new part inside the data dict
:param tags: current list of xml tags
:param attrs: current dict of attribs
- 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 handle_beat_unit_dot
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def handle_beat_unit_dot(list_of_dicts, tag):
if tag == "beat-unit-dot":
copy_of_dict = copy.deepcopy(list_of_dicts)
if len(copy_of_dict) > 0:
if "beat_2" in copy_of_dict[-1]:
- 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"