fuzeman/trakt.py

View on GitHub

Showing 249 of 249 total issues

Function get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get(self, username, media=None, rating=None, store=None, extended=None,
            page=None, per_page=None, **kwargs):

        # Build parameters
        params = []
Severity: Minor
Found in trakt/interfaces/users/ratings.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

Function episode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def episode(cls, client, item, **kwargs):
        if 'episode' in item:
            i_episode = item['episode']
        else:
            i_episode = item
Severity: Minor
Found in trakt/mapper/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

Function custom_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def custom_list(cls, client, item, username=None, **kwargs):
        if 'list' in item:
            i_list = item['list']
        else:
            i_list = item
Severity: Minor
Found in trakt/mapper/list.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

Function on has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def on(self, events, func=None, on_bound=None):
        if not func:
            # assume decorator, wrap
            return self.__wrap(self.on, events, on_bound=on_bound)

Severity: Minor
Found in trakt/core/emitter.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

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

Function get_interfaces has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_interfaces():
    for interface in INTERFACES:
        if not interface.path:
            continue

Severity: Minor
Found in trakt/interfaces/__init__.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

Function season has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def season(cls, client, item, **kwargs):
        if not item:
            return None

        if 'season' in item:
Severity: Minor
Found in trakt/mapper/summary.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

Function episode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def episode(cls, client, item, **kwargs):
        if 'episode' in item:
            i_episode = item['episode']
        else:
            i_episode = item
Severity: Minor
Found in trakt/mapper/list_item.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

Function find_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def find_list(self, index):
        count = len(self)

        if index >= count:
            raise IndexError()
Severity: Minor
Found in trakt/core/context_collection.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

Severity
Category
Status
Source
Language