Showing 10 of 24 total issues
Function main
has a Cognitive Complexity of 178 (exceeds 5 allowed). Consider refactoring. Open
def main():
# create config
if not os.path.exists(getConfigPaths().config()):
os.mkdir(getConfigPaths().app(), mode=0o750)
os.mkdir(getConfigPaths().config(), mode=0o750)
- 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 taskbutler.py
has 503 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import logging
Function gettaskwithlabelid
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def gettaskwithlabelid(labelid, api):
"""
Returns a list of Task IDs found with given label-ID
:param labelid: (str) label ID of label to search for
- 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
Avoid deeply nested control flow statements. Open
for label in task['labels']:
if label == label_grocery_id:
logger.debug("Found grocery list: {}".format(task['content']))
grocery_value_total_old = float(0)
Avoid deeply nested control flow statements. Open
if label == label_progress_id:
logger.debug("Found task to track: {}".format(task['content']))
counter_progress = counter_progress + 1
subtasks_total = 0
Function createpaperdocument
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def createpaperdocument(title, dbx, todoistfolderid, todoistpaperurl, sharing) -> str:
Function createdropboxfile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def createdropboxfile(title, dbx, templatefile, dropbox_prepart_files, folder) -> str:
Function getprogresssymbols
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def getprogresssymbols(progress_done, secrets):
"""
Returns unicode bar based on given percentage.
:param secrets:
- 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 gettodoistfolderid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def gettodoistfolderid(foldername: str, dbx):
"""
Dropbox - Get Folder ID of folder "todoist" from user account
Note : only finds folder once a paper is created in. create test paper first.
- 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
Avoid too many return
statements within this function. Open
return 1