um-cseg/chez-betty

View on GitHub

Showing 186 of 349 total issues

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

def send_bcc_email(BCC, SUBJECT, body,
Severity: Minor
Found in chezbetty/utility.py - About 35 mins to fix

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

        def __init__(self, event, user, amount, stripe_id, last4):
    Severity: Minor
    Found in chezbetty/models/transaction.py - About 35 mins to fix

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

      def add_withdrawal(amount, notes, reimbursee, admin, timestamp=None):
      Severity: Minor
      Found in chezbetty/datalayer.py - About 35 mins to fix

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

        def transfer_user_money(sender, recipient, amount, notes, admin):
        Severity: Minor
        Found in chezbetty/datalayer.py - About 35 mins to fix

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

              def __init__(self, request, user, post, staff_post=False, deleted=False):
          Severity: Minor
          Found in chezbetty/models/request_post.py - About 35 mins to fix

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

                def __init__(self, transaction, amount, item_id, quantity, wholesale):
            Severity: Minor
            Found in chezbetty/models/transaction.py - About 35 mins to fix

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

              function ajax_bool (js_obj, object, field, id, status) {
              Severity: Minor
              Found in chezbetty/static/js/chezbetty-user-onload.js - About 35 mins to fix

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

                    def __init__(self, box, item, quantity, percentage, enabled=True):
                Severity: Minor
                Found in chezbetty/models/box_item.py - About 35 mins to fix

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

                  def add_reimbursement(amount, notes, reimbursee, admin, timestamp=None):
                  Severity: Minor
                  Found in chezbetty/datalayer.py - About 35 mins to fix

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

                    def send_email(TO, SUBJECT, body,
                    Severity: Minor
                    Found in chezbetty/utility.py - About 35 mins to fix

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

                          def limitable_all_wrapper(*args, limit=None, offset=None, count=False, **kwargs):
                      Severity: Minor
                      Found in chezbetty/models/model.py - About 35 mins to fix

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

                        def bitcoin_deposit(user, amount, btc_transaction, address, amount_btc):
                        Severity: Minor
                        Found in chezbetty/datalayer.py - About 35 mins to fix

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

                          def limitable_request(request, fn, prefix=None, limit=None, count=False):
                          Severity: Minor
                          Found in chezbetty/models/model.py - About 35 mins to fix

                            Function admin_users_archive_old_submit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def admin_users_archive_old_submit(request):
                                count = 0
                                users = User.get_normal_users()
                                for user in users:
                                    if user.days_since_last_purchase is not None and user.days_since_last_purchase >= 180:
                            Severity: Minor
                            Found in chezbetty/views_admin.py - About 35 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_item_from_barcode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def get_item_from_barcode(barcode):
                                try:
                                    item = Item.from_barcode(barcode)
                                except:
                                    # Could not find the item. Check to see if the user scanned a box
                            Severity: Minor
                            Found in chezbetty/views_terminal.py - About 35 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 all_accessable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def all_accessable(cls, user, only_enabled=False):
                                    # Get all pools the user can access
                                    pools = []
                                    for pool in Pool.all_by_owner(user, only_enabled):
                                        if not only_enabled or pool.enabled:
                            Severity: Minor
                            Found in chezbetty/models/pool.py - About 35 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 dynamic_item_img has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def dynamic_item_img(request):
                                item = Item.from_id(request.matchdict['item_id'])
                                response = Response(content_type='image/jpeg')
                                class Hack():
                                    def __init__(self, img):
                            Severity: Minor
                            Found in chezbetty/views_dynamic.py - About 35 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 make_link has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def make_link(obj, str_len=0):
                                if obj is None:
                                    return ''
                                elif type(obj) is box.Box:
                                    return '<a href="/admin/box/edit/{}">{}</a>'.format(obj.id, shorten(obj.name, str_len))
                            Severity: Minor
                            Found in chezbetty/jinja2_filters.py - About 35 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_days_on_shame has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def get_days_on_shame(user, rows):
                                directions = {
                                    'purchase':   -1, # user balance goes down by amount
                                    'cashdeposit': 1, # user balance goes up by amount
                                    'ccdeposit':   1,
                            Severity: Minor
                            Found in chezbetty/utility.py - About 35 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 admin_pool_addmember_submit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def admin_pool_addmember_submit(request):
                                try:
                                    pool = Pool.from_id(request.POST['pool-id'])
                            
                                    # Look up the user that is being added to the pool
                            Severity: Minor
                            Found in chezbetty/views_admin.py - About 35 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

                            Severity
                            Category
                            Status
                            Source
                            Language