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
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
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"]
- Read upRead up
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
- Read upRead up
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
- Read upRead up
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)
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:
- Read upRead up
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
- Read upRead up
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):
Function create
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(self, project, subject, priority, status, issue_type, severity, **attrs):
Function import_issue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def import_issue(self, subject, priority, status, issue_type, severity, **attrs):
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):
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():
- Read upRead up
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):
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(self, project, name, url, key, **attrs):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, uri, query=None, cache=False, paginate=True, **parameters):
Function duplicate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def duplicate(self, name, description, is_private=False, users=[], **attrs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(self, project, name, estimated_start, estimated_finish, **attrs):
Function post
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def post(self, uri, payload=None, query=None, files=None, **parameters):