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
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
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"]
- 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 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
- 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, **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 __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 add_issue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_issue(self, subject, priority, status, issue_type, severity, **attrs):
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 import_issue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def import_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 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):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function import_
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def import_(self, project, name, estimated_start, estimated_finish, **attrs):
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():
- 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"