nephila/python-taiga

View on GitHub

Showing 20 of 81 total issues

File models.py has 1524 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 57 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 --contains HEAD", out_stream=output)
          skipped_branch_prefix = ["pull/", "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 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 list has a Cognitive Complexity of 10 (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 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 __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 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 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 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 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 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

                        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 import_ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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

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

                                def __init__(self, requester, **params):
                                    import dateutil.parser
                            
                                    self.requester = requester
                                    for key, value in params.items():
                            Severity: Minor
                            Found in taiga/models/base.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