Showing 48 of 49 total issues
Function login
has a Cognitive Complexity of 26 (exceeds 10 allowed). Consider refactoring. Open
def login(self):
if self.request.params.get('to'):
# timeout occured, redirected from a javascript json request
self.request.session.flash(SESSION_TIMEOUT, 'error')
- 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 export_members_vcf
has a Cognitive Complexity of 21 (exceeds 10 allowed). Consider refactoring. Open
def export_members_vcf():
parser = gocept.logging.ArgumentParser(
description="Export members in vcf format.")
parser.add_argument('-c', '--config', default='portal.ini',
help='Specify the config file. (default: portal.ini)')
- 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 update
has a Cognitive Complexity of 20 (exceeds 10 allowed). Consider refactoring. Open
def update(self):
if self.recipients == [None]:
return
recipients = []
if not self.context.sent:
- 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_transaction
has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring. Open
def add_transaction(data, account):
from sw.allotmentclub import Member
accounting_year = data['date'].year
org_title = None
org = Organization.get(account.organization_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 update
has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring. Open
def update(self):
data = []
items = [] # id, text, parent, state, icon
for text, id, icon, children in NAVIGATION_ITEMS:
parent = '#'
- 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_membership_fees
has a Cognitive Complexity of 17 (exceeds 10 allowed). Consider refactoring. Open
def get_membership_fees(year=None, currency_formatter=None):
if year is None:
year = get_selected_year()
members = {}
for parcel in Parcel.query().all():
- 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 update
has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring. Open
def update(self):
output = PdfFileWriter()
if self.recipients == [None] or self.preview:
recipients = self.recipients
else:
- 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 __call__
has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring. Open
def __call__(self):
result = []
for title, route, css, sublinks in NAVIGATION_ITEMS:
if not route_permitted(route, self.request):
continue
- 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 __call__
has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring. Open
def __call__(self):
result = super(HomeView, self).__call__()
last = None
timeline = []
for date, user_id, type_, msg in sw.allotmentclub.json_result(
- 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_form_attributes
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def get_form_attributes(self):
form_attributes = []
for item in self.form_attributes:
form_attributes.append(item.copy())
for item in form_attributes:
- 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 moneyfmt
has 9 arguments (exceeds 8 allowed). Consider refactoring. Open
def moneyfmt(value, places=2, curr='', sep=',', dp='.', pos='', neg='-',
Function render_pdf
has 9 arguments (exceeds 8 allowed). Consider refactoring. Open
def render_pdf(
Function write_cell
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def write_cell(self, row, column, cell):
style = {}
value = cell
if isinstance(cell, tuple):
- 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 moneyfmt
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def moneyfmt(value, places=2, curr='', sep=',', dp='.', pos='', neg='-',
trailneg='', request=None):
"""Convert Decimal to a money formatted string.
see: http://docs.python.org/2/library/decimal.html#recipes
- 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 export_events_ics
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def export_events_ics():
import sw.allotmentclub.browser.calendar
parser = gocept.logging.ArgumentParser(
description="Export events in ics format.")
parser.add_argument('-c', '--config', default='portal.ini',
- 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 __call__
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def __call__(self):
incoming = get_incoming_raw(self.context.id, self.request)
columns = [
{'name': name, 'css_class': 'hide' if id == 0 else ''}
for id, name in enumerate(
- 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 update
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def update(self):
try:
json = self.request.json
except ValueError:
json = 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
Possible SQL injection vector through string-based query construction. Open
""".format(pw='$2b$12$i8SjfxgMnw464DAyFJEipeXswIvtC.OcrSGYYZ/PBAC97NvJus0ou'))
- Exclude checks
Use of insecure MD2, MD4, MD5, or SHA1 hash function. Open
hashlib.md5(
user.email.encode('utf-8')).hexdigest()))
- Exclude checks
Use of exec detected. Open
exec(open("src/sw/allotmentclub/version.py").read())
- Exclude checks