fuzeman/trakt.py

View on GitHub
trakt/interfaces/shows/__init__.py

Summary

Maintainability
F
5 days
Test Coverage

Function progress has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def progress(self, progress_type, id, hidden=False, specials=False, count_specials=True, **kwargs):
Severity: Minor
Found in trakt/interfaces/shows/__init__.py - About 45 mins to fix

    Function episode has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def episode(self, id, season, episode, extended=None, **kwargs):
    Severity: Minor
    Found in trakt/interfaces/shows/__init__.py - About 35 mins to fix

      Function recommended has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def recommended(self, period=None, extended=None, page=None, per_page=None, **kwargs):
      Severity: Minor
      Found in trakt/interfaces/shows/__init__.py - About 35 mins to fix

        Function progress_collection has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def progress_collection(self, id, hidden=False, specials=False, count_specials=True, **kwargs):
        Severity: Minor
        Found in trakt/interfaces/shows/__init__.py - About 35 mins to fix

          Function progress_watched has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def progress_watched(self, id, hidden=False, specials=False, count_specials=True, **kwargs):
          Severity: Minor
          Found in trakt/interfaces/shows/__init__.py - About 35 mins to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                def recommended(self, period=None, extended=None, page=None, per_page=None, **kwargs):
                    # Build parameters
                    params = []
            
                    if period:
            Severity: Major
            Found in trakt/interfaces/shows/__init__.py and 1 other location - About 1 day to fix
            trakt/interfaces/movies/__init__.py on lines 27..62

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 155.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

                def trending(self, extended=None, page=None, per_page=None, **kwargs):
                    response = self.http.get('trending', query={
                        'extended': extended,
                        'page': page,
                        'limit': per_page
            Severity: Major
            Found in trakt/interfaces/shows/__init__.py and 3 other locations - About 1 day to fix
            trakt/interfaces/movies/__init__.py on lines 64..84
            trakt/interfaces/movies/__init__.py on lines 86..106
            trakt/interfaces/shows/__init__.py on lines 86..106

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 127.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

                def popular(self, extended=None, page=None, per_page=None, **kwargs):
                    response = self.http.get('popular', query={
                        'extended': extended,
                        'page': page,
                        'limit': per_page
            Severity: Major
            Found in trakt/interfaces/shows/__init__.py and 3 other locations - About 1 day to fix
            trakt/interfaces/movies/__init__.py on lines 64..84
            trakt/interfaces/movies/__init__.py on lines 86..106
            trakt/interfaces/shows/__init__.py on lines 64..84

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 127.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                def last_episode(self, id, extended=None, **kwargs):
                    response = self.http.get(str(id), 'last_episode', query={
                        'extended': extended
                    })
            
            
            Severity: Major
            Found in trakt/interfaces/shows/__init__.py and 1 other location - About 4 hrs to fix
            trakt/interfaces/shows/__init__.py on lines 108..118

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 75.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                def next_episode(self, id, extended=None, **kwargs):
                    response = self.http.get(str(id), 'next_episode', query={
                        'extended': extended
                    })
            
            
            Severity: Major
            Found in trakt/interfaces/shows/__init__.py and 1 other location - About 4 hrs to fix
            trakt/interfaces/shows/__init__.py on lines 120..130

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 75.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                def get(self, id, extended=None, **kwargs):
                    response = self.http.get(str(id), query={
                        'extended': extended
                    })
            
            
            Severity: Major
            Found in trakt/interfaces/shows/__init__.py and 1 other location - About 4 hrs to fix
            trakt/interfaces/movies/__init__.py on lines 14..25

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 74.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            There are no issues that match your filters.

            Category
            Status