nephila/python-taiga

View on GitHub

Showing 23 of 85 total issues

File models.py has 1607 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import datetime
import warnings
from io import IOBase

from .. import exceptions
Severity: Major
Found in taiga/models/models.py - About 4 days to fix

    Project has 61 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Project(InstanceResource):
        """Taiga project model
    
        :param requester: :class:`Requester` instance
        :param name: name of the project
    Severity: Major
    Found in taiga/models/models.py - About 1 day to fix

      Function towncrier_check has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      def towncrier_check(c):  # NOQA
          """Check towncrier files."""
          output = io.StringIO()
          c.run("git branch -a --contains HEAD", out_stream=output)
          skipped_branch_prefix = ["pull/", "release/", "develop", "master", "HEAD"]
      Severity: Minor
      Found in tasks.py - About 1 hr 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 list has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def list(self, pagination=True, page_size=None, page=None, **queryparams):  # noqa: A003
              """
              Retrieves a list of objects.
      
              By default uses local cache and remote pagination
      Severity: Minor
      Found in taiga/models/base.py - About 1 hr 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 auth_app has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def auth_app(self, app_id, app_secret, auth_code, state=""):
              """
              Authenticate an app
      
              :param app_id: the app id
      Severity: Minor
      Found in taiga/client.py - About 1 hr 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 _init_resources has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def _init_resources(self):
              self.projects = Projects(self.raw_request)
              self.user_stories = UserStories(self.raw_request)
              self.user_story_attachments = UserStoryAttachments(self.raw_request)
              self.users = Users(self.raw_request)
      Severity: Minor
      Found in taiga/client.py - About 1 hr to fix

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

            def get(self, **query):
                for obj in self:
                    ok_obj = True
                    for key, value in query.items():
                        if key not in obj.__dict__ or obj.__dict__[key] != value:
        Severity: Minor
        Found in taiga/models/base.py - About 55 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 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def get(self, uri, query=None, cache=False, paginate=True, **parameters):
                try:
                    full_url = self.urljoin(self.host, self.api_path, uri.format(**parameters))
        
                    result = None
        Severity: Minor
        Found in taiga/requestmaker.py - About 55 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 import_ has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def import_(self, project, subject, priority, status, issue_type, severity, **attrs):
        Severity: Major
        Found in taiga/models/models.py - About 50 mins to fix

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

              def create(self, project, subject, priority, status, issue_type, severity, **attrs):
          Severity: Major
          Found in taiga/models/models.py - About 50 mins to fix

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

                def import_issue(self, subject, priority, status, issue_type, severity, **attrs):
            Severity: Minor
            Found in taiga/models/models.py - About 45 mins to fix

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

                  def __init__(self, api_path, host, token, token_type="Bearer", tls_verify=True, enable_pagination=True):
              Severity: Minor
              Found in taiga/requestmaker.py - About 45 mins to fix

                Function filter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def filter(self, **query):  # noqa: A003
                        result_objs = []
                        for obj in self:
                            ok_obj = True
                            for key, value in query.items():
                Severity: Minor
                Found in taiga/models/base.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 add_issue has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def add_issue(self, subject, priority, status, issue_type, severity, **attrs):
                Severity: Minor
                Found in taiga/models/models.py - About 45 mins to fix

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

                      def create(self, project, name, url, key, **attrs):
                  Severity: Minor
                  Found in taiga/models/models.py - About 35 mins to fix

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

                        def get(self, uri, query=None, cache=False, paginate=True, **parameters):
                    Severity: Minor
                    Found in taiga/requestmaker.py - About 35 mins to fix

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

                          def duplicate(self, name, description, is_private=False, users=[], **attrs):
                      Severity: Minor
                      Found in taiga/models/models.py - About 35 mins to fix

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

                            def __init__(
                        Severity: Minor
                        Found in taiga/client.py - About 35 mins to fix

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

                              def create(self, project, name, estimated_start, estimated_finish, **attrs):
                          Severity: Minor
                          Found in taiga/models/models.py - About 35 mins to fix

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

                                def post(self, uri, payload=None, query=None, files=None, **parameters):
                            Severity: Minor
                            Found in taiga/requestmaker.py - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language