Showing 3 of 3 total issues
Function did_contribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def did_contribute(date):
for day_elem in soup.svg.g.find_all('g'):
day_data = day_elem.find_all('rect')[-1]
day_date = datetime.strptime(day_data['data-date'], '%Y-%m-%d').date()
if (date == day_date):
- 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 check_for_updates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_for_updates():
''' Checking new incoming messages '''
global last_update_id
print datetime.today().time()
print 'Last Update ' + str(last_update_id) + '\n'
- 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 notify_contribution
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def notify_contribution():
global skip_hours, last_contributed_date
today = datetime.today()
if today.time().minute is not 0 or today.time().hour in skip_hours:
- 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"