Showing 8 of 33 total issues
Function create_app
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_app(config):
app = Flask(__name__)
config_name = config
if not isinstance(config, str):
- Create a ticketCreate a ticket
Function join_from_invite
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def join_from_invite(user_id, token):
"""
Confirm new user's account with provided token and prompt them to set
a password.
"""
- Read upRead up
- Create a ticketCreate a ticket
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 reset_password
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def reset_password(token):
"""Reset an existing user's password."""
if not current_user.is_anonymous:
return redirect(url_for('main.index'))
form = ResetPasswordForm()
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid too many return
statements within this function. Open
return render_template('account/reset_password.html', form=form)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return render_template('account/join_invite.html', form=form)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return redirect(url_for('main.index'))
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return True
- Create a ticketCreate a ticket
Function login
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def login():
"""Log in an existing user."""
form = LoginForm()
if form.validate_on_submit():
user = User.query.filter_by(email=form.email.data).first()
- Read upRead up
- Create a ticketCreate a ticket
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"