keelerm84/surveydoc

View on GitHub

Showing 5 of 5 total issues

Function main has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def main(credentials_path, config_path):
credentials = authenticate(credentials_path)
 
config = json.load(config_path)
config_path.close()
Severity: Minor
Found in surveydoc/__main__.py - About 1 hr to fix

Function generate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def generate(self, subject, timestamps, answers):
answers = answers.apply(lambda x: int(x) if x != '' and x is not None else 0)
answers = answers[answers > 0]
frequencies = pd.crosstab(timestamps, answers, normalize='index')
 
 
Severity: Minor
Found in surveydoc/formatters.py - About 45 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

frequencies[0] = 1 - frequencies[1] - frequencies[2]
Severity: Minor
Found in surveydoc/formatters.py and 1 other location - About 45 mins to fix
surveydoc/formatters.py on lines 24..24

Similar blocks of code found in 2 locations. Consider refactoring.
Open

frequencies[5] = 1 - frequencies[3] - frequencies[4]
Severity: Minor
Found in surveydoc/formatters.py and 1 other location - About 45 mins to fix
surveydoc/formatters.py on lines 23..23

Function authenticate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def authenticate(credentials_path):
scopes = [
'https://www.googleapis.com/auth/documents',
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/spreadsheets.readonly'
Severity: Minor
Found in surveydoc/google.py - About 35 mins to fix
Severity
Category
Status
Source
Language