Showing 3 of 11 total issues
SyncthingClient
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class SyncthingClient(Resource):
"""SyncthingClient class"""
def __init__(self, api_key, api_url='https://127.0.0.1:8384', **kwargs):
"""Init"""
Function _request
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def _request(self, *args, **kwargs):
"""Make the request"""
try:
self.response = self.request(
*args, headers=self._request_headers(), **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 get_readme
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_readme():
"""Generate long description"""
pandoc = None
for path in os.environ["PATH"].split(os.pathsep):
path = path.strip('"')
- 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"