ganesshkumar/git-reminder

View on GitHub

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):
Severity: Minor
Found in contribution_checker.py - About 35 mins to fix

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'
Severity: Minor
Found in app.py - About 25 mins to fix

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:
Severity: Minor
Found in app.py - About 25 mins to fix

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

Severity
Category
Status
Source
Language