fuzeman/trakt.py

View on GitHub
trakt/interfaces/search.py

Summary

Maintainability
A
3 hrs
Test Coverage

Function query has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def query(self, query, media=None, year=None, fields=None, extended=None, page=None, per_page=None, **kwargs):
Severity: Major
Found in trakt/interfaces/search.py - About 1 hr to fix

    Function lookup has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def lookup(self, id, service=None, media=None, extended=None, page=None, per_page=None, **kwargs):
    Severity: Major
    Found in trakt/interfaces/search.py - About 50 mins to fix

      Function lookup has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      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.
      Severity: Minor
      Found in trakt/interfaces/search.py - About 45 mins to fix

      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

          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.
      
      
      Severity: Minor
      Found in trakt/interfaces/search.py - About 25 mins to fix

      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

      There are no issues that match your filters.

      Category
      Status