Showing 34 of 36 total issues
File route_proxy.py
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Any, Dict, Generic, List, Mapping, Optional, Tuple, Type, Union
try:
from types import UnionType # type: ignore
except ImportError: # coverage: ignore
File route_proxy.py
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Any, Dict, Generic, List, Mapping, Optional, Tuple, Type, Union
try:
from types import UnionType # type: ignore
except ImportError: # coverage: ignore
File params.py
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
import abc
import warnings
from dataclasses import dataclass
from functools import partial
from typing import (
ResponseBox
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class ResponseBox(Generic[TResponse, TError_co]):
"""
Wrap a HTTP response and deserialize it.
::
SyncRouteProxy
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class SyncRouteProxy(Generic[TCollectionResponse, TResponse, TError_co]):
"""Proxy from resource to its associate routes."""
client_name: ClientName
name: ResourceName
Function serialize_response
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def serialize_response(resp: HTTPRawResponse) -> HTTPResponse:
"""
Deserialize an http response to the http intermediate representation that will
become the pydantic based response.
Basically it parse json bytes a a python structure. But this function is here
- 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 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function register
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def register(
Function register
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def register(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function build_request
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def build_request(typ: Type[Any], params: Mapping[str, Any]) -> Request:
if is_union(typ):
err: Optional[Exception] = None
for t in typ.__args__: # type: ignore
try:
- 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 build_request
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def build_request(typ: Type[Any], params: Mapping[str, Any]) -> Request:
if is_union(typ):
err: Optional[Exception] = None
for t in typ.__args__: # type: ignore
try:
- 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 parse_header_links
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_header_links(value: str) -> List[Dict[str, str]]:
"""
Returns a list of parsed link headers, for more info see:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(