nephila/python-taiga

View on GitHub

Showing 20 of 81 total issues

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

import datetime
import warnings

import six

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 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):
              """
              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 six.iteritems(query):
                      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 create has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

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

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

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

              def filter(self, **query):
                  result_objs = []
                  for obj in self:
                      ok_obj = True
                      for key, value in six.iteritems(query):
          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,
          Severity: Minor
          Found in taiga/models/models.py - About 45 mins to fix

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

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

                def __init__(self,
            Severity: Minor
            Found in taiga/requestmaker.py - About 45 mins to fix

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

                  def __init__(self, requester, **params):
                      import dateutil.parser
              
                      self.requester = requester
                      for key, value in six.iteritems(params):
              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,
              Severity: Minor
              Found in taiga/models/models.py - About 45 mins to fix

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

                    def _encode_element(self, element):
                        if isinstance(element, six.string_types):
                            return element.encode('utf-8')
                        elif isinstance(element, list):
                            for idx, value in enumerate(element):
                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 get has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def get(self, uri, query={}, 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,
                  Severity: Minor
                  Found in taiga/models/models.py - About 35 mins to fix

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

                        def import_(self, project, name, estimated_start,
                    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={}, files={}, **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, url, key, **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__(self, host='https://api.taiga.io', token=None,
                          Severity: Minor
                          Found in taiga/client.py - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language