um-cseg/chez-betty

View on GitHub

Showing 349 of 349 total issues

Avoid too many return statements within this function.
Open

        return HTTPFound(location=request.route_url('user_pools'))
Severity: Major
Found in chezbetty/views_user.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return ["serviceaccount"]
    Severity: Major
    Found in chezbetty/models/user.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return '<a href="/admin/vendor/edit/{}">{}</a>'.format(obj.id, shorten(obj.name, str_len))
      Severity: Major
      Found in chezbetty/jinja2_filters.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return zip(create_x_y_from_group(data,  start, end, period, float, 0.0))
        Severity: Major
        Found in chezbetty/views_data.py - About 30 mins to fix

          Similar blocks of code found in 7 locations. Consider refactoring.
          Open

          function deposit_alert_success (error_str) {
              html = '<div class="alert alert-success" role="alert">'+error_str+'</div>';
              deposit_alert_clear();
              $("#deposit-alerts").html(html);
          }
          Severity: Major
          Found in chezbetty/static/js/chezbetty-terminal.js and 6 other locations - About 30 mins to fix
          chezbetty/static/js/chezbetty-common.js on lines 10..14
          chezbetty/static/js/chezbetty-common.js on lines 16..20
          chezbetty/static/js/chezbetty-terminal.js on lines 47..51
          chezbetty/static/js/chezbetty-terminal.js on lines 57..61
          chezbetty/static/js/chezbetty-user.js on lines 37..41
          chezbetty/static/js/chezbetty-user.js on lines 43..47

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 45.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Avoid too many return statements within this function.
          Open

                  return '%s.post%d.dev%d' % (
          Severity: Major
          Found in version.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return HTTPFound(location=request.route_url('admin_user_balance_edit'))
            Severity: Major
            Found in chezbetty/views_admin.py - About 30 mins to fix

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

              def new_user_email(user):
                  send_email(
                          TO=user.uniqname+'@umich.edu',
                          SUBJECT='[Chez Betty] Welcome to Chez Betty!',
                          body=render('templates/admin/email_new_user.jinja2',
              Severity: Minor
              Found in chezbetty/utility.py and 2 other locations - About 30 mins to fix
              chezbetty/utility.py on lines 124..128
              chezbetty/views_terminal.py on lines 374..379

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 32.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 7 locations. Consider refactoring.
              Open

              function alert_success (success_str) {
                  html = '<div class="alert alert-success" role="alert">'+success_str+'</div>';
                  alert_clear();
                  $("#alerts").html(html);
              }
              Severity: Major
              Found in chezbetty/static/js/chezbetty-user.js and 6 other locations - About 30 mins to fix
              chezbetty/static/js/chezbetty-common.js on lines 10..14
              chezbetty/static/js/chezbetty-common.js on lines 16..20
              chezbetty/static/js/chezbetty-terminal.js on lines 41..45
              chezbetty/static/js/chezbetty-terminal.js on lines 47..51
              chezbetty/static/js/chezbetty-terminal.js on lines 57..61
              chezbetty/static/js/chezbetty-user.js on lines 43..47

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 45.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Avoid too many return statements within this function.
              Open

                          return {'status': 'error'}
              Severity: Major
              Found in chezbetty/views_admin.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return HTTPFound(location=request.route_url('admin_cash_reconcile'))
                Severity: Major
                Found in chezbetty/views_admin.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return m.group('ver').decode('utf-8')
                  Severity: Major
                  Found in version.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return HTTPFound(location=request.route_url('admin_events'))
                    Severity: Major
                    Found in chezbetty/views_admin.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return HTTPFound(location=request.route_url('admin_events'))
                      Severity: Major
                      Found in chezbetty/views_admin.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return HTTPFound(location=request.route_url('admin_user_purchase_add'))
                        Severity: Major
                        Found in chezbetty/views_admin.py - About 30 mins to fix

                          Similar blocks of code found in 7 locations. Consider refactoring.
                          Open

                          function alert_success (success_str) {
                              html = '<div class="alert alert-success" role="alert">'+success_str+'</div>';
                              alert_clear();
                              $("#alerts").html(html);
                          }
                          Severity: Major
                          Found in chezbetty/static/js/chezbetty-common.js and 6 other locations - About 30 mins to fix
                          chezbetty/static/js/chezbetty-common.js on lines 16..20
                          chezbetty/static/js/chezbetty-terminal.js on lines 41..45
                          chezbetty/static/js/chezbetty-terminal.js on lines 47..51
                          chezbetty/static/js/chezbetty-terminal.js on lines 57..61
                          chezbetty/static/js/chezbetty-user.js on lines 37..41
                          chezbetty/static/js/chezbetty-user.js on lines 43..47

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 45.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 7 locations. Consider refactoring.
                          Open

                          function alert_error (error_str) {
                              html = '<div class="alert alert-danger" role="alert">'+error_str+'</div>';
                              alert_clear();
                              $("#alerts").html(html);
                          }
                          Severity: Major
                          Found in chezbetty/static/js/chezbetty-common.js and 6 other locations - About 30 mins to fix
                          chezbetty/static/js/chezbetty-common.js on lines 10..14
                          chezbetty/static/js/chezbetty-terminal.js on lines 41..45
                          chezbetty/static/js/chezbetty-terminal.js on lines 47..51
                          chezbetty/static/js/chezbetty-terminal.js on lines 57..61
                          chezbetty/static/js/chezbetty-user.js on lines 37..41
                          chezbetty/static/js/chezbetty-user.js on lines 43..47

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 45.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 3 locations. Consider refactoring.
                          Open

                              send_email(
                                      TO=user.uniqname+'@umich.edu',
                                      SUBJECT='[Chez Betty] You are on top of the Wall of Shame! :(',
                                      body=render('templates/admin/email_new_top_wall_of_shame.jinja2',
                                          {'user': user})
                          Severity: Minor
                          Found in chezbetty/utility.py and 2 other locations - About 30 mins to fix
                          chezbetty/utility.py on lines 140..145
                          chezbetty/views_terminal.py on lines 374..379

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 32.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Avoid too many return statements within this function.
                          Open

                                  return HTTPFound(location=request.route_url('admin_box_edit', box_id=int(request.POST['box-id'])))
                          Severity: Major
                          Found in chezbetty/views_admin.py - About 30 mins to fix

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                                $(this).parent().parent().find(".item-total").html(format_price(quantity*item_price));
                            Severity: Minor
                            Found in chezbetty/static/js/chezbetty-terminal.js and 1 other location - About 30 mins to fix
                            chezbetty/static/js/chezbetty-terminal.js on lines 672..672

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 45.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language