Showing 35 of 64 total issues
Function __init__
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, mode='major', tonic='C', octave=4, descending=False,
chromatic=False, n_octaves=1, valid_intervals=CHROMATIC_TYPE,
user_durations=None, prequestion_method=None,
resolution_method=None, default_durations=None,
*args, **kwargs):
- 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 a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, cli_prompt_next=False,
cli_no_scroll=False, cli_no_resolution=False,
exercise=None, *args, **kwargs):
"""This function implements the birdears loop for command line.
- 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 process_key
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def process_key(self, user_input):
if user_input in self.question.keyboard_index \
and user_input != ' ': # spc
- 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
File urwid.py
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
import threading
try:
import urwid
except ImportError:
File __main__.py
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
"__Main__ docs are here."
try:
import urwid
except ImportError:
Function __init__
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, scale, question_tonic_pitch, main_loop=None,
keyboard_index=None, *args, **kwargs):
self.main_loop = main_loop
- 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 a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, exercise=None, *args, **kwargs):
self.exercise = exercise
self.arguments = kwargs
- 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 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, mode='major', wait_time=11, n_repeats=1,
Function __init__
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, mode='major', max_intervals=3, n_notes=4, tonic='C',
Function async_play
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def async_play(self, callback, end_callback, args, kwargs):
"""Plays the Sequence elements of notes and/or chords and wait for
`Sequence.pos_delay` seconds.
"""
- 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 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, mode='major', tonic='C', octave=4, descending=False,
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, mode='major', tonic='C', octave=4, descending=False,
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, mode='major', tonic='C', octave=4, descending=False,
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, mode='major', tonic='C', octave=4, descending=False,
Function get_valid_pitches
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_valid_pitches(scale, valid_intervals=CHROMATIC_TYPE):
tonic_pitch = scale[0]
valid_scale = list()
- 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 nearest_tonic
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def nearest_tonic(question):
"""Resolution method that resolve the intervals to their nearest tonics.
Args:
question (obj): Question object from which to generate the
- 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 highlight_key
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def highlight_key(self, element=None):
with LOCK:
# for key in self.key_index.values():
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, top="", middle="", bottom="", pitch=None, *args,
Function cli
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def cli(debug, urwid, cli, prompt, no_scroll, no_resolution):
Avoid deeply nested control flow statements. Open
if user_input2 in ('q', 'Q'):
sys.exit()
# any key - play next question
elif user_input2:
break