trakt/interfaces/search.py
Function query
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def query(self, query, media=None, year=None, fields=None, extended=None, page=None, per_page=None, **kwargs):
Function lookup
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def lookup(self, id, service=None, media=None, extended=None, page=None, per_page=None, **kwargs):
Function lookup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def lookup(self, id, service=None, media=None, extended=None, page=None, per_page=None, **kwargs):
"""Lookup items by their Trakt, IMDB, TMDB, TVDB, or TVRage ID.
**Note:** If you lookup an identifier without a :code:`media` type specified it
might return multiple items if the :code:`service` is not globally unique.
- 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 query
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def query(self, query, media=None, year=None, fields=None, extended=None, page=None, per_page=None, **kwargs):
"""Search by titles, descriptions, translated titles, aliases, and people.
**Note:** Results are ordered by the most relevant score.
- 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"