File __init__.py
has 730 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
Abstract Classes for Providers
------------------------------
Function login_decorator
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def login_decorator(func):
"""
Decorate the :meth:`.BaseProvider.login` implementations with this
decorator.
- 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 _update_or_create_user
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def _update_or_create_user(self, data, credentials=None, content=None):
"""
Updates or creates :attr:`.user`.
:returns:
- 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
BaseProvider
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class BaseProvider(object):
"""
Abstract base class for all providers.
"""
Function _fetch
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _fetch(self, url, method='GET', params=None, headers=None,
body='', max_redirects=5, content_parser=None,
certificate_file=None, ssl_verify=True):
"""
Fetches a URL.
- 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 _fetch
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def _fetch(self, url, method='GET', params=None, headers=None,
Function access
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def access(self, url, params=None, method='GET', headers=None,
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, settings, adapter, provider_name, session=None,
Function create_request_elements
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_request_elements(self, request_type, credentials,
Function _log_param
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _log_param(cls, param, value='', last=None,