Api
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Api(object):
"""A Python interface to the DHIS2 API
Example usage:
Function get_sqlview
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_sqlview(
self,
uid: str,
execute: bool = False,
var: dict = None,
- 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_paged
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_paged(
self,
endpoint: str,
params: Union[dict, List[tuple]] = None,
page_size: Union[int, str] = 50,
- 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 post_partitioned
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def post_partitioned(
self,
endpoint: str,
json: dict,
params: Union[dict, List[tuple]] = None,
- 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 _validate_request
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _validate_request(
endpoint: str,
file_type: str = "json",
data: dict = None,
params: Union[dict, List[tuple]] = None,
- 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 _make_request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _make_request(
self, method: str, endpoint: str, **kwargs: Any
) -> requests.Response:
"""
Do the actual request with supplied HTTP method
- 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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(
Function get_sqlview
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_sqlview(
Function set_api_version
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_api_version(self, number: Union[str, int]) -> None:
if number:
try:
i = int(number)
if i < 25:
- 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 set_base_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_base_url(self, server: str) -> None:
if "/api" in server:
raise ClientException("Do not include /api/ in the DHIS2 `server` argument")
server = server.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"