MAKENTNU/web

View on GitHub

Showing 230 of 230 total issues

Function modifyToFirstValid has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function modifyToFirstValid(rules, startTime, endTime, modificationDirection) {
/**
* Modifies either startTime (modificationDirection 0) or endTime (modificationDirection 1) until the period
* [startTime, endTime] is valid for the given set of rules.
*/
Severity: Minor
Found in src/make_queue/static/make_queue/js/reservation_rule_utils.js - About 1 hr to fix

    Function mazeMapSearch has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    mazeMapSearch: function () {
    // Data attributes set by the widget
    const campusID = this.data("campus-id");
    const maxResults = this.data("max-results");
    const urlField = this.data("url-field");
    Severity: Minor
    Found in src/web/static/web/js/forms/widgets/mazemap_search.js - About 1 hr to fix

      Error: invalid syntax (<unknown>, line 13)</unknown>
      Open

      match action:
      Severity: Minor
      Found in src/internal/signals.py by radon

      Error: invalid syntax (<unknown>, line 67)</unknown>
      Open

      match self.usage_requirement:
      Severity: Minor
      Found in src/make_queue/models/machine.py by radon

      Error: invalid syntax (<unknown>, line 33)</unknown>
      Open

      match value:
      Severity: Minor
      Found in src/card/modelfields.py by radon

      Error: invalid syntax (<unknown>, line 40)</unknown>
      Open

      match cleaned_data:
      Severity: Minor
      Found in src/util/formfields.py by radon

      Error: invalid syntax (<unknown>, line 134)</unknown>
      Open

      match status_action:
      Severity: Minor
      Found in src/internal/forms.py by radon

      Error: invalid syntax (<unknown>, line 273)</unknown>
      Open

      match self.query_params['owner']:
      Severity: Minor
      Found in src/make_queue/views/reservation.py by radon

      Error: invalid syntax (<unknown>, line 118)</unknown>
      Open

      match calendar_year, calendar_week:
      Severity: Minor
      Found in src/make_queue/forms/machine.py by radon

      Error: invalid syntax (<unknown>, line 158)</unknown>
      Open

      match self.direction:
      Severity: Minor
      Found in src/web/widgets.py by radon

      Function updateDisplay has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function updateDisplay() {
      const startIndex = state.page * state.elementsPerPage;
      const endIndex = (state.page + 1) * state.elementsPerPage;
       
      let numRegistrationsFiltered = 0;
      Severity: Minor
      Found in src/make_queue/static/make_queue/js/printer_3d_course_list.js - About 1 hr to fix

        Function clean has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        def clean(self, data: InMemoryUploadedFile | bool | None, initial: ImageFieldFile = None):
        cleaned_data: ImageFieldFile | InMemoryUploadedFile | TemporaryUploadedFile | bool | None = super().clean(data, initial=initial)
        if data and cleaned_data:
        try:
        if initial and file_contents_equal(cleaned_data, initial):
        Severity: Minor
        Found in src/util/formfields.py - About 1 hr to fix

        Function updateDisplay has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function updateDisplay() {
        const startIndex = state.page * state.elementsPerPage;
        const endIndex = (state.page + 1) * state.elementsPerPage;
         
        let numRegistrationsFiltered = 0;
        Severity: Minor
        Found in src/make_queue/static/make_queue/js/printer_3d_course_list.js - About 1 hr to fix

        Function setUpState has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function setUpState() {
        $("tbody tr").each(function () {
        state.elements.push({
        pk: $(this).data("pk"),
        name: $(this).data("name").toLowerCase(),
        Severity: Minor
        Found in src/make_queue/static/make_queue/js/printer_3d_course_list.js - About 1 hr to fix

          Function updateSelection has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          ReservationCalendar.prototype.updateSelection = function () {
          /**
          * Updates the shown selection.
          */
          const calendar = this;
          Severity: Minor
          Found in src/make_queue/static/make_queue/js/calendar.js - About 1 hr to fix

            Function registerProfilePost has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function registerProfilePost($element) {
            $.ajaxSetup({
            beforeSend: function (xhr, settings) {
            xhr.setRequestHeader("X-CSRFToken", csrfToken);
            },
            Severity: Minor
            Found in src/checkin/static/checkin/js/profile_detail.js - About 1 hr to fix

              Function getPeriodIn has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              function getPeriodIn(rules, date, direction) {
              date = (date.getDay() + 6) % 7 + date.getHours() / 24 + date.getMinutes() / (24 * 60);
              for (const rule of rules) {
              for (const period of rule.periods) {
              if (direction === 1 && period[0] === date) {
              Severity: Minor
              Found in src/make_queue/static/make_queue/js/reservation_rule_utils.js - About 1 hr to fix

              Function get_error_message has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              def get_error_message(self, form, reservation):
              """
              Generates the correct error message for the given form.
               
              :param reservation: The reservation to generate an error message for
              Severity: Minor
              Found in src/make_queue/views/reservation.py - About 1 hr to fix

              Function selectionPopupContent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              ReservationCalendar.prototype.selectionPopupContent = function () {
              /**
              * Creates the default content for the popup after selection is finished. The content produced is a simple card with
              * information about the selection and a button to create a reservation using the selection.
              */
              Severity: Minor
              Found in src/make_queue/static/make_queue/js/calendar.js - About 1 hr to fix

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

                specific_ticket_urlpatterns = [
                path("", event_views.EventTicketDetailView.as_view(), name='event_ticket_detail'),
                path("cancel/", login_required(event_views.EventTicketCancelView.as_view()), name='event_ticket_cancel'),
                Severity: Major
                Found in src/news/urls.py and 1 other location - About 1 hr to fix
                src/make_queue/urls.py on lines 17..19
                Severity
                Category
                Status
                Source
                Language