signmeup/signmeup

View on GitHub

Showing 39 of 187 total issues

File methods.js has 442 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Meteor } from "meteor/meteor";
import { ValidatedMethod } from "meteor/mdg:validated-method";
import { SimpleSchema } from "meteor/aldeed:simple-schema";
import { Jobs } from "meteor/msavin:sjobs";
import { Roles } from "meteor/alanning:roles";
Severity: Minor
Found in imports/api/tickets/methods.js - About 6 hrs to fix

    File methods.js has 434 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Meteor } from "meteor/meteor";
    import { ValidatedMethod } from "meteor/mdg:validated-method";
    import { SimpleSchema } from "meteor/aldeed:simple-schema";
    import { Roles } from "meteor/alanning:roles";
    import { Jobs } from "meteor/msavin:sjobs";
    Severity: Minor
    Found in imports/api/queues/methods.js - About 6 hrs to fix

      Function up has 152 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        up() {
          // Announcements
          // - Does not exist on the database currently. NOOP.
      
          // Courses
      Severity: Major
      Found in imports/startup/server/migrations/2-migrate-to-v3.js - About 6 hrs to fix

        Function run has 115 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          run({
            queueId,
            studentEmails,
            question,
            notifications,
        Severity: Major
        Found in imports/api/tickets/methods.js - About 4 hrs to fix

          Function submit #js-modal-join-queue-form has 81 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            "submit #js-modal-join-queue-form"(event, templateInstance) {
              event.preventDefault();
              let errors = false;
          
              let data = {
          Severity: Major
          Found in imports/ui/components/modals/modal-join-queue/modal-join-queue.js - About 3 hrs to fix

            File modal-join-queue.js has 279 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { Meteor } from "meteor/meteor";
            import { Template } from "meteor/templating";
            import { ReactiveArray } from "meteor/manuel:reactivearray";
            import { ReactiveDict } from "meteor/reactive-dict";
            import { SimpleSchema } from "meteor/aldeed:simple-schema";
            Severity: Minor
            Found in imports/ui/components/modals/modal-join-queue/modal-join-queue.js - About 2 hrs to fix

              Function run has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                run({
                  queueId,
                  studentEmails,
                  question,
                  notifications,
              Severity: Minor
              Found in imports/api/tickets/methods.js - About 2 hrs 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 onRendered has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Template.Queue.onRendered(function onRendered() {
                WebNotifications.requestPermission();
                this.autorun(() => {
                  if (this.subscriptionsReady()) {
                    const queue = this.getQueue();
              Severity: Major
              Found in imports/ui/pages/queue/queue.js - About 2 hrs to fix

                Function submit #js-modal-join-queue-form has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                  "submit #js-modal-join-queue-form"(event, templateInstance) {
                    event.preventDefault();
                    let errors = false;
                
                    let data = {
                Severity: Minor
                Found in imports/ui/components/modals/modal-join-queue/modal-join-queue.js - About 2 hrs 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 run has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  run({ queueId }) {
                    const queue = Queues.findOne(queueId);
                    if (!queue) {
                      throw new Meteor.Error(
                        "queues.doesNotExist",
                Severity: Major
                Found in imports/api/queues/methods.js - About 2 hrs to fix

                  Function run has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    run({ queueId, name, locationId, scheduledEndTime }) {
                      const queue = Queues.findOne(queueId);
                      if (!queue || queue.status === "ended") {
                        throw new Meteor.Error(
                          "queues.doesNotExist"`No queue exists with id ${queueId}`
                  Severity: Minor
                  Found in imports/api/queues/methods.js - About 1 hr to fix

                    Function run has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      run({ ticketId }) {
                        const ticket = Tickets.findOne(ticketId);
                        if (!ticket || ticket.status === "deleted") {
                          throw new Meteor.Error(
                            "tickets.doesNotExist"`No ticket exists with id ${ticketId}`
                    Severity: Minor
                    Found in imports/api/tickets/methods.js - About 1 hr to fix

                      Function onRendered has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      Template.Queue.onRendered(function onRendered() {
                        WebNotifications.requestPermission();
                        this.autorun(() => {
                          if (this.subscriptionsReady()) {
                            const queue = this.getQueue();
                      Severity: Minor
                      Found in imports/ui/pages/queue/queue.js - About 1 hr 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 run has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        run({ queueId }) {
                          const queue = Queues.findOne(queueId);
                          if (!queue || queue.status === "ended") {
                            throw new Meteor.Error(
                              "queues.doesNotExist"`No queue exists with id ${queueId}`
                      Severity: Minor
                      Found in imports/api/queues/methods.js - About 1 hr to fix

                        Function onCreated has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Template.ModalJoinQueue.onCreated(function onCreated() {
                          this.errors = new ReactiveDict();
                        
                          this.studentEmails = new ReactiveArray([]);
                          this.addStudentEmail = (email, callback) => {
                        Severity: Minor
                        Found in imports/ui/components/modals/modal-join-queue/modal-join-queue.js - About 1 hr to fix

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

                            run({ ticketId }) {
                              const ticket = Tickets.findOne(ticketId);
                              if (!ticket || ticket.status === "deleted") {
                                throw new Meteor.Error(
                                  "tickets.doesNotExist"`No ticket exists with id ${ticketId}`
                          Severity: Minor
                          Found in imports/api/tickets/methods.js - About 1 hr to fix

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

                              run({ ticketId }) {
                                const ticket = Tickets.findOne(ticketId);
                                if (!ticket || ticket.status === "deleted") {
                                  throw new Meteor.Error(
                                    "tickets.doesNotExist"`No ticket exists with id ${ticketId}`
                            Severity: Minor
                            Found in imports/api/tickets/methods.js - About 1 hr to fix

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

                                run({ ticketId }) {
                                  const ticket = Tickets.findOne(ticketId);
                                  if (!ticket || ticket.status === "deleted") {
                                    throw new Meteor.Error(
                                      "tickets.doesNotExist"`No ticket exists with id ${ticketId}`
                              Severity: Minor
                              Found in imports/api/tickets/methods.js - About 1 hr to fix

                                Function run has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  run({ ticketId }) {
                                    const ticket = Tickets.findOne(ticketId);
                                    if (!ticket) {
                                      throw new Meteor.Error(
                                        "tickets.doesNotExist"`No ticket exists with id ${ticketId}`
                                Severity: Minor
                                Found in imports/api/tickets/methods.js - About 1 hr to fix

                                  Function run has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    run({ queueId }) {
                                      const queue = Queues.findOne(queueId);
                                      if (!queue || queue.status === "ended") {
                                        throw new Meteor.Error(
                                          "queues.doesNotExist",
                                  Severity: Minor
                                  Found in imports/api/queues/methods.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language